> ## 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 tipo de tarefa

> Cria um novo tipo de tarefa no workspace.

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



## OpenAPI

````yaml /pt/api-reference/openapi.json post /v1/task-types
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: Tarefas
  - name: Tipos de Tarefas
  - name: Tags
  - name: Listas
paths:
  /v1/task-types:
    post:
      tags:
        - Tipos de Tarefas
      summary: Criar tipo de tarefa
      description: |-
        Cria um novo tipo de tarefa no workspace.

        <Accordion title="Escopo necessário">
        `tasks:write`
        </Accordion>
      operationId: createTaskType
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTaskTypeRequest'
      responses:
        '201':
          description: Tipo de tarefa criado com sucesso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskTypeResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/InsufficientScope'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    CreateTaskTypeRequest:
      type: object
      required:
        - title
        - color
        - key
      properties:
        title:
          type: string
          minLength: 1
          maxLength: 40
          description: Nome de exibição do tipo de tarefa.
          example: Ligação
        color:
          type: string
          pattern: ^#[0-9a-fA-F]{6}$
          description: Cor de exibição em formato hex RGB.
          example: '#463dfb'
        key:
          type: string
          minLength: 1
          maxLength: 40
          pattern: ^[a-z0-9]+(_[a-z0-9]+)*$
          description: >-
            Chave identificadora do tipo de tarefa. Única no workspace. Apenas
            letras minúsculas, dígitos e underscores. Usada no campo `type` ao
            criar ou atualizar tarefas.
          example: ligacao
    TaskTypeResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/TaskType'
    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
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: not_found
            message:
              type: string
              example: List not found.
            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
  responses:
    BadRequest:
      description: >-
        Body malformado ou nenhum campo enviado para atualização. Código:
        `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: `insufficient_scope`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: insufficient_scope
              message: This endpoint requires the 'people:write' scope.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    Conflict:
      description: 'Já existe uma tag com a mesma `key` neste workspace. Código: `conflict`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: conflict
              message: A record with this value already exists.
              fields:
                key: Value already in use.
              request_id: 550e8400-e29b-41d4-a716-446655440000
    ValidationError:
      description: 'Validação dos campos falhou. Código: `validation_error`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
          example:
            error:
              code: validation_error
              message: Validation failed.
              fields:
                name: String must contain at most 50 character(s).
              request_id: 550e8400-e29b-41d4-a716-446655440000
    RateLimitExceeded:
      description: 'Limite de requisições 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.

````