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

# Criar tarefa

> Cria uma nova tarefa no workspace.

<Accordion title="Escopo necessário">
`tasks:write`
</Accordion>



## OpenAPI

````yaml /pt/api-reference/openapi.json post /v1/tasks
openapi: 3.1.0
info:
  title: OAuth 2.1
  description: Endpoints para registrar aplicativos e gerenciar tokens OAuth 2.1.
  version: 1.0.0
  contact:
    name: Suporte Vendaze
    email: suporte@vendaze.com
servers:
  - url: https://api.vendaze.com
    description: Produção
security:
  - bearerAuth: []
tags:
  - name: OAuth
  - name: Pessoas
  - name: Empresas
  - name: Negócios
  - name: Pipelines
  - name: Tarefas
  - name: Tipos de Tarefas
  - name: Produtos
  - name: Tags
  - name: Listas
  - name: Campos Adicionais
  - name: Webhooks
paths:
  /v1/tasks:
    post:
      tags:
        - Tarefas
      summary: Criar tarefa
      description: |-
        Cria uma nova tarefa no workspace.

        <Accordion title="Escopo necessário">
        `tasks:write`
        </Accordion>
      operationId: createTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTaskRequest'
      responses:
        '201':
          description: Tarefa criada com sucesso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/InsufficientScope'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    CreateTaskRequest:
      type: object
      required:
        - title
        - due_date
      properties:
        title:
          type: string
          minLength: 1
          maxLength: 200
          description: Título da tarefa.
          example: Ligar para o prospect
        due_date:
          type: string
          format: date-time
          description: Data e hora de vencimento em ISO 8601 UTC.
          example: '2026-06-15T09:00:00Z'
        notes:
          type: string
          maxLength: 3000
          description: Notas opcionais.
          example: Enviar a proposta até sexta.
        type:
          type: string
          description: >-
            `id` (UUID) ou `key` do tipo de tarefa. A API resolve internamente
            para o ID do tipo. Use `GET /v1/task-types` para listar os tipos
            disponíveis.
          example: ligacao
        person_id:
          type: string
          format: uuid
          description: UUID da pessoa a associar à tarefa.
        company_id:
          type: string
          format: uuid
          description: UUID da empresa a associar à tarefa.
        deal_id:
          type: string
          format: uuid
          description: UUID do deal a associar à tarefa.
        owner_email:
          type: string
          format: email
          description: >-
            E-mail do membro do workspace a definir como responsável. A API
            resolve internamente para o ID do usuário.
          example: joao@empresa.com.br
        priority:
          type: string
          enum:
            - high
            - medium
            - low
          description: Nível de prioridade.
          example: high
    TaskResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/TaskWithEmbedded'
    TaskWithEmbedded:
      type: object
      description: >-
        Tarefa retornada pelo POST e PATCH. Inclui os objetos completos de
        person, company e deal no lugar dos IDs planos.
      properties:
        id:
          type: string
          format: uuid
        title:
          type: string
          maxLength: 200
          example: Ligar para o prospect
        notes:
          type: string
          nullable: true
          maxLength: 3000
        due_date:
          type: string
          format: date-time
        type:
          $ref: '#/components/schemas/TaskType'
        person:
          $ref: '#/components/schemas/PersonEmbedded'
        company:
          $ref: '#/components/schemas/CompanyEmbedded'
        deal:
          $ref: '#/components/schemas/DealEmbedded'
        owner:
          $ref: '#/components/schemas/Owner'
        priority:
          type: string
          nullable: true
          enum:
            - high
            - medium
            - low
        completed:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
              format: uuid
    ValidationErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: validation_error
            message:
              type: string
              example: Validation failed.
            fields:
              type: object
              additionalProperties:
                type: string
            request_id:
              type: string
              format: uuid
    TaskType:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Identificador único do tipo de tarefa.
        title:
          type: string
          maxLength: 40
          example: Ligação
          description: Nome de exibição do tipo de tarefa.
        color:
          type: string
          pattern: ^#[0-9a-fA-F]{6}$
          description: Cor de exibição em formato hex RGB.
          example: '#463dfb'
        key:
          type: string
          nullable: true
          maxLength: 40
          description: >-
            Chave identificadora do tipo de tarefa. Única no workspace. Usada no
            campo `type` ao criar ou atualizar tarefas.
          example: ligacao
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    PersonEmbedded:
      type: object
      nullable: true
      description: Pessoa associada à tarefa. `null` quando nenhuma pessoa está atribuída.
      properties:
        id:
          type: string
          format: uuid
        full_name:
          type: string
          example: Maria Silva
        emails:
          type: array
          nullable: true
          items:
            type: object
            properties:
              email:
                type: string
              type:
                type: string
        phones:
          type: array
          nullable: true
          items:
            type: object
            properties:
              phone:
                type: string
              type:
                type: string
        ranking:
          type: number
        position:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    CompanyEmbedded:
      type: object
      nullable: true
      description: >-
        Empresa associada à tarefa. `null` quando nenhuma empresa está
        atribuída.
      properties:
        id:
          type: string
          format: uuid
        full_name:
          type: string
          example: Empresa Exemplo S.A.
        emails:
          type: array
          nullable: true
          items:
            type: object
            properties:
              email:
                type: string
              type:
                type: string
        phones:
          type: array
          nullable: true
          items:
            type: object
            properties:
              phone:
                type: string
              type:
                type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    DealEmbedded:
      type: object
      nullable: true
      description: >-
        Deal associado à tarefa. `null` quando nenhum deal está atribuído. Os
        campos de valor seguem o mesmo formato de `GET /v1/deals`.
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          example: Plano Enterprise Q3
        amount:
          type: integer
          description: Valor do deal em centavos.
          example: 250000
        currency:
          type: string
          description: Código ISO 4217 da moeda.
          example: BRL
        formatted_amount:
          type: string
          nullable: true
          description: Valor formatado com símbolo e separadores da moeda.
          example: R$ 2.500,00
        pipeline:
          type: object
          nullable: true
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
        stage:
          type: object
          nullable: true
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            type:
              type: string
              enum:
                - open
                - win
                - lost
        source:
          type: string
        forecast_date:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Owner:
      type: object
      nullable: true
      description: >-
        Membro do workspace responsável pela tarefa. `null` quando nenhum
        responsável está atribuído.
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          example: João Silva
        email:
          type: string
          format: email
          example: joao@empresa.com.br
  responses:
    BadRequest:
      description: 'Body malformado ou PATCH sem campos. Código de erro: `bad_request`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: bad_request
              message: Request body must be valid JSON.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    Unauthorized:
      description: >-
        Token ausente, inválido ou expirado. Códigos possíveis: `unauthorized`,
        `token_expired`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: unauthorized
              message: Missing or invalid Authorization header.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    InsufficientScope:
      description: 'Token sem o escopo necessário. Código de erro: `insufficient_scope`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: insufficient_scope
              message: This endpoint requires the 'webhooks:read' scope.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    ValidationError:
      description: >-
        Validação de entrada falhou. Código: `validation_error`. O objeto
        `fields` mapeia cada campo inválido para uma descrição do problema.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
          example:
            error:
              code: validation_error
              message: Validation failed.
              fields:
                url: url must use HTTPS.
                events: At least one event is required.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    RateLimitExceeded:
      description: 'Rate limit excedido. Código: `rate_limit_exceeded`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: rate_limit_exceeded
              message: Rate limit exceeded. Try again in 60 seconds.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    InternalError:
      description: 'Erro interno inesperado. Código: `internal_error`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: internal_error
              message: An unexpected error occurred.
              request_id: 550e8400-e29b-41d4-a716-446655440000
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Access token OAuth 2.1.

````