> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deepslate.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Agent Task

> Creates a new task for a specific agent.



## OpenAPI

````yaml POST /api/v1/vendors/{vendorId}/organizations/{organizationId}/agents/{agentId}/tasks
openapi: 3.1.0
info:
  title: Deepslate
  description: OpenAPI specification of the public Deepslate API
  version: v1.0
servers:
  - url: https://app.deepslate.eu
    description: Generated server url
security: []
tags:
  - name: SIP Credentials Management
    description: API endpoints for managing SIP Credentials within an Organization
  - name: Assistant Management
    description: API endpoints for managing Assistants within an Organization
  - name: SIP Numbers Management
    description: API endpoints for managing SIP Numbers within an Organization
  - name: Agent Task Management
    description: API endpoints for retrieving Agent Tasks
  - name: Organization Management
    description: API endpoints for managing Organizations
  - name: Agent Management
    description: API endpoints for managing Agents within an Organization
  - name: LLM Generation Strategy Management
    description: >-
      API endpoints for managing LLM Generation Strategies within an
      Organization
paths:
  /api/v1/vendors/{vendorId}/organizations/{organizationId}/agents/{agentId}/tasks:
    post:
      tags:
        - Agent Task Management
      summary: Create Agent Task
      description: Creates a new task for a specific agent.
      operationId: createTask
      parameters:
        - name: vendorId
          in: path
          description: ID of the Vendor (UUID)
          required: true
          schema:
            type: string
          example: a1b2c3d4-e5f6-7890-1234-567890abcdef
        - name: organizationId
          in: path
          description: ID of the Organization (UUID)
          required: true
          schema:
            type: string
          example: f0e9d8c7-b6a5-4321-fedc-ba9876543210
        - name: agentId
          in: path
          description: ID of the Agent (UUID)
          required: true
          schema:
            type: string
          example: 98765432-10fe-dcba-9876-543210fedcba
      requestBody:
        description: Agent task create data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentTaskRestCreateViewV1'
        required: true
      responses:
        '200':
          description: Agent task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentTaskDetailsResponse'
        '400':
          description: Bad Request - Invalid input data
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - User does not have permission
        '404':
          description: Vendor, Organization, or Agent not found
components:
  schemas:
    AgentTaskRestCreateViewV1:
      type: object
      properties:
        userValues:
          type: object
          additionalProperties:
            type: string
          description: >-
            Key-value pairs representing user-specific data relevant to the
            task.
          example:
            customer_name: Alice Wonderland
            product_interest: Teapot
            callback_reason: Price query
        targetNumber:
          type: string
          description: >-
            Target phone number for the task (e.g., customer callback number,
            preferably E.164 format).
          example: '+491721234567'
        allowedHoursBegin:
          type: integer
          format: int32
          description: >-
            Start hour (0-23) of the allowed execution window in UTC. Null means
            no restriction.
          example: 9
        allowedHours:
          type: integer
          format: int32
          description: >-
            Length of the allowed execution window in hours. Null means no
            restriction.
          example: 8
        onlyWeekdays:
          type: boolean
          description: When true, only schedule calls on weekdays (Mon-Fri).
          example: true
        execute:
          type: boolean
          description: When true, schedule the task for execution.
          example: true
      required:
        - targetNumber
        - userValues
    AgentTaskDetailsResponse:
      type: object
      description: Standard API response wrapper
      properties:
        success:
          type: boolean
          description: Indicates if the request was successful
          example: true
        message:
          type: string
          description: Human-readable message
        data:
          $ref: '#/components/schemas/AgentTaskDetails'
          description: Payload data object
        timestamp:
          type: string
          format: date-time
          description: Response timestamp in ISO-8601 format
          example: '2025-04-17T14:23:30Z'
        traceId:
          type: string
          description: Correlation or trace ID
      required:
        - success
        - timestamp
    AgentTaskDetails:
      type: object
      description: Detailed view of an Agent Task.
      properties:
        id:
          type: string
          description: Unique identifier of the agent task (UUID).
          example: 77aaddcc-88bb-11ee-aacc-112233445566
        userValues:
          type: object
          additionalProperties:
            type: string
          description: >-
            Key-value pairs representing user-specific data relevant to the
            task.
          example:
            customer_name: Alice Wonderland
            product_interest: Teapot
            callback_reason: Price query
        targetNumber:
          type: string
          description: >-
            Target phone number for the task (e.g., customer callback number,
            preferably E.164 format).
          example: '+491721234567'
        status:
          type: string
          description: Current task status.
          enum:
            - IDLE
            - SCHEDULED
            - RUNNING
            - SUCCEEDED
            - FAILED
          example: SCHEDULED
        allowedHoursBegin:
          type: integer
          format: int32
          description: >-
            Start hour (0-23) of the allowed execution window in UTC. Null means
            no restriction.
          example: 9
        allowedHours:
          type: integer
          format: int32
          description: >-
            Length of the allowed execution window in hours. Null means no
            restriction.
          example: 8
        onlyWeekdays:
          type: boolean
          description: When true, calls are only executed on weekdays (Mon-Fri).
          example: true
        createdAt:
          type: string
          format: date-time
          description: Task creation timestamp (UTC, ISO-8601).
          example: '2024-02-01T09:15:30Z'
        conclusionId:
          type: string
          description: Conclusion data for a completed task, if available.
      required:
        - createdAt
        - id
        - onlyWeekdays
        - status
        - targetNumber
        - userValues

````