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

# Search tasks

> Query tasks for the authenticated company. All body fields are optional filters.
Date-range filters (`dueAt`, `checkedAt`, `updatedAt`) take an object of
`{ startDate, endDate }` — either bound may be supplied independently. Set
`useCount: true` to return `{ count }` instead of `{ tasks }`.




## OpenAPI

````yaml /openapi.yaml post /api/tasks/search
openapi: 3.0.3
info:
  title: Aptly API
  version: '1.0'
  description: >
    The Aptly API lets you read and write cards on any Aptly board from external
    systems.


    All requests require an API key passed as the `x-token` header.

    API keys are scoped to your company and work across all boards.
servers:
  - url: https://core-api.getaptly.com
    description: Production
security:
  - ApiKeyHeader: []
paths:
  /api/tasks/search:
    post:
      tags:
        - Tasks
      summary: Search tasks
      description: >
        Query tasks for the authenticated company. All body fields are optional
        filters.

        Date-range filters (`dueAt`, `checkedAt`, `updatedAt`) take an object of

        `{ startDate, endDate }` — either bound may be supplied independently.
        Set

        `useCount: true` to return `{ count }` instead of `{ tasks }`.
      operationId: searchTasks
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                userIds:
                  type: array
                  items:
                    type: string
                  description: Restrict to tasks assigned to these user ids.
                isChecked:
                  type: boolean
                  description: Filter by completion state.
                isPinned:
                  type: boolean
                archived:
                  type: boolean
                  default: false
                taskPriority:
                  type: string
                  description: One of asap|high|medium|low.
                streamId:
                  type: string
                channelId:
                  type: string
                aptletUuid:
                  type: string
                  description: Board UUID.
                aptletInstanceId:
                  type: string
                leaderboard:
                  type: boolean
                onlyAssigned:
                  type: boolean
                unAssigned:
                  type: boolean
                useCount:
                  type: boolean
                  description: Return a count instead of the task list.
                limit:
                  type: integer
                  default: 1000
                dueAt:
                  $ref: '#/components/schemas/TaskDateRange'
                checkedAt:
                  $ref: '#/components/schemas/TaskDateRange'
                updatedAt:
                  $ref: '#/components/schemas/TaskDateRange'
            example:
              isChecked: false
              archived: false
              taskPriority: high
              dueAt:
                startDate: '2026-06-01T00:00:00.000Z'
                endDate: '2026-06-30T00:00:00.000Z'
              limit: 100
      responses:
        '200':
          description: Matching tasks (or a count).
          content:
            application/json:
              schema:
                type: object
                properties:
                  tasks:
                    type: array
                    items:
                      $ref: '#/components/schemas/Task'
                  count:
                    type: integer
                    description: Present instead of `tasks` when `useCount` is true.
        '400':
          description: Invalid filter value.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid or missing credential.
      security:
        - ApiKeyHeader: []
        - DelegateToken: []
components:
  schemas:
    TaskDateRange:
      type: object
      description: >-
        Date-range filter. Either bound may be supplied independently —
        `startDate` maps to `$gte`, `endDate` to `$lte`.
      properties:
        startDate:
          type: string
          format: date-time
        endDate:
          type: string
          format: date-time
    Task:
      type: object
      properties:
        _id:
          type: string
        companyId:
          type: string
        title:
          type: string
        mergedTitle:
          type: string
          description: >-
            Title with `{{ }}` merge tags resolved against the task's
            representative contact, the company, and the acting user.
        description:
          type: string
        mergedDescription:
          type: string
          description: Description with `{{ }}` merge tags resolved (HTML output).
        userId:
          type: string
          description: Assigned user id.
        checked:
          type: boolean
        archived:
          type: boolean
        status:
          type: string
        priority:
          type: string
        dueAt:
          type: string
          format: date-time
        aptletInstanceId:
          type: string
        aptletUuid:
          type: string
        attachments:
          type: array
          items:
            type: object
            properties:
              _id:
                type: string
              name:
                type: string
              type:
                type: string
        priorityLabel:
          type: string
          description: Present only when includeMetadata=true.
        statusLabel:
          type: string
          description: Present only when includeMetadata=true.
        assignee:
          type: object
          description: Present only when includeMetadata=true.
          properties:
            _id:
              type: string
            fullName:
              type: string
      additionalProperties: true
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-token
    DelegateToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Delegate token issued by the platform. Format: `DelegateToken <token>`'

````