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

# Create task

> Creates a new task in the specified project.

If `statusId` is omitted, the task is placed in the first status of the `todo` category. Use `GET /{projectSlug}/statuses` to retrieve available status IDs.

Requires the `task:create` scope.



## OpenAPI

````yaml /api-reference/api.json post /{projectSlug}/tasks
openapi: 3.1.0
info:
  title: Elean Public API
  description: >-
    The Elean Public API allows external clients — scripts, AI agents, and
    integrations — to read and write tasks programmatically.


    > **Early Access:** This API is currently in beta. Endpoints,
    request/response shapes, and scopes may change before the stable release. We
    will communicate breaking changes in advance.
  version: 0.0.1
  contact:
    name: Elean Support
    url: https://elean.app
servers:
  - url: https://api.elean.app/v1/public
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Statuses
    description: List the custom task statuses configured for a project.
  - name: Labels
    description: List labels available in a project.
  - name: Members
    description: List members of a project.
  - name: Tasks
    description: Read and write tasks within a project.
  - name: Comments
    description: Read and write comments on tasks.
paths:
  /{projectSlug}/tasks:
    post:
      tags:
        - Tasks
      summary: Create task
      description: >-
        Creates a new task in the specified project.


        If `statusId` is omitted, the task is placed in the first status of the
        `todo` category. Use `GET /{projectSlug}/statuses` to retrieve available
        status IDs.


        Requires the `task:create` scope.
      operationId: createTask
      parameters:
        - name: projectSlug
          in: path
          required: true
          description: The slug of the project to create the task in.
          schema:
            type: string
            example: my-project
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTaskBody'
            example:
              title: Fix login bug
              description: Users cannot log in with SSO on Safari.
              priority: high
              dueDate: '2026-03-15T00:00:00.000Z'
              statusId: 018e1b2c-aaaa-0000-0000-000000000002
      responses:
        '200':
          description: Task created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    CreateTaskBody:
      type: object
      required:
        - title
      properties:
        title:
          type: string
          minLength: 1
          maxLength: 500
          description: Task title.
          example: Fix login bug
        description:
          type: string
          description: Task description as plain text. Newlines are supported.
          example: |-
            Users cannot log in with SSO on Safari.

            Reproducible on Safari 17+.
        priority:
          type: string
          enum:
            - none
            - low
            - medium
            - high
            - urgent
          description: Task priority. Defaults to `none` if omitted.
          example: high
        dueDate:
          type: string
          format: date-time
          description: Due date in ISO 8601 format.
          example: '2026-03-15T00:00:00.000Z'
        statusId:
          type: string
          format: uuid
          description: >-
            UUID of the custom status to assign. If omitted, the task is placed
            in the first status of the `todo` category. Use `GET
            /{projectSlug}/statuses` to retrieve available IDs.
          example: 018e1b2c-aaaa-0000-0000-000000000002
        assigneeIds:
          type: array
          description: >-
            List of user UUIDs to assign to the task. Maximum 5. Use `GET
            /{projectSlug}/members` to retrieve available IDs.
          items:
            type: string
            format: uuid
          example:
            - 018e1b2c-0000-0000-0000-000000000099
        labelIds:
          type: array
          description: >-
            List of label UUIDs to attach to the task. Use `GET
            /{projectSlug}/labels` to retrieve available IDs.
          items:
            type: string
            format: uuid
          example:
            - 018e1b2c-aaaa-0000-0000-000000000010
    Task:
      type: object
      description: A task object returned by the API.
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the task.
          example: 018e1b2c-3d4e-5f6a-7b8c-9d0e1f2a3b4c
        externalId:
          type: string
          description: >-
            Human-readable task identifier, unique within the project (e.g.
            `PROJ-42`).
          example: PROJ-42
        title:
          type: string
          description: Task title.
          example: Fix login bug
        description:
          type:
            - string
            - 'null'
          description: Task description as plain text. Newlines are preserved.
          example: Users cannot log in with SSO on Safari.
        category:
          type: string
          enum:
            - todo
            - in_progress
            - done
          description: >-
            Status category of the task. For the specific named status, see
            `status`.
          example: in_progress
        status:
          oneOf:
            - $ref: '#/components/schemas/TaskStatusInline'
            - type: 'null'
          description: >-
            The specific custom status assigned to this task, or `null` if none
            is set.
        priority:
          type: string
          enum:
            - none
            - low
            - medium
            - high
            - urgent
          description: Priority level of the task.
          example: high
        dueDate:
          type:
            - string
            - 'null'
          format: date-time
          description: Due date in ISO 8601 format, or `null` if not set.
          example: '2026-03-15T00:00:00.000Z'
        assignees:
          type: array
          description: List of users assigned to the task.
          items:
            $ref: '#/components/schemas/AssigneeSummary'
        labels:
          type: array
          description: Labels attached to the task.
          items:
            $ref: '#/components/schemas/LabelSummary'
        attachments:
          type: array
          description: >-
            Files attached to this task. Each entry contains only the attachment
            ID and filename. Use `GET
            /{projectSlug}/tasks/{taskId}/attachments/{attachmentId}` to
            retrieve the full attachment details including the download URL.
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                description: Unique identifier of the attachment.
                example: 018e1b2c-aaaa-bbbb-cccc-000000000001
              filename:
                type: string
                description: Original filename of the uploaded file.
                example: screenshot.png
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the task was created.
          example: '2026-03-01T12:00:00.000Z'
        updatedAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp of the last update.
          example: '2026-03-02T09:30:00.000Z'
    TaskStatusInline:
      type: object
      description: A compact representation of a custom status embedded in a task.
      properties:
        id:
          type: string
          format: uuid
          example: 018e1b2c-aaaa-0000-0000-000000000002
        name:
          type: string
          example: In Review
        color:
          type:
            - string
            - 'null'
          example: '#f59e0b'
        category:
          type: string
          enum:
            - todo
            - in_progress
            - done
          example: in_progress
    AssigneeSummary:
      type: object
      description: A minimal representation of a user assigned to a task.
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the user.
          example: 018e1b2c-0000-0000-0000-000000000099
        name:
          type:
            - string
            - 'null'
          description: Display name of the user.
          example: Jane Smith
    LabelSummary:
      type: object
      description: A label that can be attached to tasks.
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the label.
          example: 018e1b2c-aaaa-0000-0000-000000000010
        name:
          type: string
          description: Display name of the label.
          example: bug
        color:
          type: string
          description: Hex color code of the label.
          example: '#EF4444'
    ApiError:
      type: object
      properties:
        statusCode:
          type: integer
          example: 401
        message:
          type: string
          example: Invalid API key
  responses:
    BadRequest:
      description: The request body is missing required fields or contains invalid values.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            statusCode: 400
            message: title must be longer than or equal to 1 characters
    Unauthorized:
      description: The API key is missing, invalid, or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            statusCode: 401
            message: Invalid API key
    Forbidden:
      description: >-
        The API key does not have the required scope, or the project is outside
        the key's allowed scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            statusCode: 403
            message: 'Missing required scope: task:create'
    NotFound:
      description: The project or task was not found within the key's workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            statusCode: 404
            message: Task not found
    TooManyRequests:
      description: >-
        The rate limit for this API key has been exceeded. Retry after the
        indicated delay.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            statusCode: 429
            message: Too many requests
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: el_<token>
      description: >-
        API key created in **Workspace Settings → API Keys**. Pass it in the
        `Authorization` header as a Bearer token, or in the `X-API-Key` header.


        Format: `el_` followed by 40 hex characters.

````