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

# Create a task

> Creates a follow-up. It shows up in the assignee's work queue in the Cockpit.

`assigneeId` defaults to the workspace member the API key belongs to — an unassigned task is invisible work. When `leadId` is given it must be a lead in your workspace.



## OpenAPI

````yaml /openapi.json post /tasks
openapi: 3.1.0
info:
  title: Leadey API
  version: 1.4.0
  description: >-
    The Leadey API gives you programmatic access to your workspace: leads,
    companies, contacts, campaigns, meetings, opportunities and calls, plus the
    reporting metrics behind the Cockpit.


    Every request is authenticated with an organization-scoped API key, and
    every response is JSON. Reads work with any key. Writes — creating leads,
    adding notes, logging calls, managing tasks — need a key with write access,
    and are attributed to the workspace member that key belongs to. See [Writing
    data](/guides/writing-data).
servers:
  - url: https://backend.leadey.ai/v1
    description: Production
  - url: http://localhost:3001/v1
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Account
    description: The organization behind the API key.
  - name: Leads
    description: People enrolled in your campaigns.
  - name: Notes
    description: >-
      Free-text notes on a lead. Notes appear in the lead's timeline and in the
      Cockpit.
  - name: Tasks
    description: Follow-ups and reminders, each assigned to a workspace member.
  - name: Campaigns
    description: Outreach sequences and their performance.
  - name: Companies
    description: Companies in your workspace.
  - name: Contacts
    description: The canonical person record behind your leads.
  - name: Meetings
    description: Bookings merged across Calendly, Leadey and connected calendars.
  - name: Opportunities
    description: Deals, their value, and the pipelines they sit in.
  - name: Pipelines
    description: Deal pipelines and the stages inside them.
  - name: Calls
    description: Dial history, recordings and transcripts.
  - name: Metrics
    description: >-
      Aggregated reporting — meetings booked, sit rate, dial activity and
      pipeline value.
  - name: Reference
    description: The vocabularies other endpoints return values from.
paths:
  /tasks:
    post:
      tags:
        - Tasks
      summary: Create a task
      description: >-
        Creates a follow-up. It shows up in the assignee's work queue in the
        Cockpit.


        `assigneeId` defaults to the workspace member the API key belongs to —
        an unassigned task is invisible work. When `leadId` is given it must be
        a lead in your workspace.
      operationId: createTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                label:
                  type: string
                  description: What needs doing.
                dueAt:
                  type: string
                  description: >-
                    When it is due, as an ISO 8601 timestamp. Omit for no
                    deadline.
                  format: date-time
                leadId:
                  type: string
                  description: The lead this task is about.
                campaignId:
                  type: string
                  description: The campaign it belongs to.
                assigneeId:
                  type: string
                  description: Workspace member responsible. Defaults to the key's member.
                category:
                  type: string
                  description: Task type. Defaults to `follow_up`.
              required:
                - label
            example:
              label: Send the revised pricing sheet
              dueAt: '2026-08-21T09:00:00.000Z'
              leadId: lead_8Kq2mXvR
              category: follow_up
      responses:
        '201':
          description: The task was created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Task'
                required:
                  - data
              example:
                data:
                  id: task_2Vh7cNsP
                  label: Send the revised pricing sheet
                  category: follow_up
                  done: false
                  dueAt: '2026-08-21T09:00:00.000Z'
                  leadId: lead_8Kq2mXvR
                  campaignId: fnl_Q3OutboundUK
                  assigneeId: user_2pXn4Rk
                  assigneeName: Sam
                  createdBy: user_2pXn4Rk
                  createdAt: '2026-08-03T11:12:00.000Z'
                  updatedAt: '2026-08-03T11:12:00.000Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    Task:
      type: object
      properties:
        id:
          type: string
          description: Unique task id.
        label:
          type: string
          description: What needs doing.
        category:
          type: string
          description: Task type, for example `follow_up`, `call` or `email`.
        done:
          type: boolean
          description: Whether the task has been completed.
        dueAt:
          type:
            - string
            - 'null'
          description: >-
            When it is due. Null means no deadline — undated tasks sort last,
            not first.
          format: date-time
        leadId:
          type:
            - string
            - 'null'
          description: The lead this task is about, if any.
        campaignId:
          type:
            - string
            - 'null'
          description: The campaign this task belongs to, if any.
        assigneeId:
          type:
            - string
            - 'null'
          description: >-
            Workspace member responsible. Defaults to the member the API key
            belongs to.
        assigneeName:
          type:
            - string
            - 'null'
          description: The assignee's first name. Only populated on list responses.
        createdBy:
          type:
            - string
            - 'null'
          description: Who created the task.
        createdAt:
          type: string
          description: When the task was created.
          format: date-time
        updatedAt:
          type: string
          description: When the task last changed.
          format: date-time
      required:
        - id
        - label
        - category
        - done
        - createdAt
        - updatedAt
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable error message.
            details:
              type:
                - object
                - array
                - string
                - 'null'
              description: Optional structured detail.
          required:
            - message
  responses:
    BadRequest:
      description: The request was malformed, or a required field was missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: One of email, phone or linkedinUrl is required
              details: null
    Unauthorized:
      description: The API key is missing, invalid, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Invalid or revoked API key.
              details: null
    Forbidden:
      description: >-
        The key is read-only, or the workspace is not currently allowed to write
        (payment method missing, trial expired, payment overdue, or subscription
        cancelled).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                This API key is read-only. Create a key with write access in
                Settings → API Keys.
              details: null
    NotFound:
      description: The resource does not exist or is not in your workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Lead not found
              details: null
    RateLimited:
      description: Too many requests. Retry after the period in the `Retry-After` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Rate limit exceeded. Retry in 42s.
              details: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API key, created in the Leadey dashboard under Settings → API Keys.
        Send it as `Authorization: Bearer leadey_sk_live_…`.

````