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

# Search tasks

> Search and filter tasks with pagination and sorting.

**Filters**: `keywords` (full-text search on task content), `task_types` (array of enum values), `related_to` + `related_record_type` (entity association), `is_completed` (boolean), `owner_ids` (assigned team members), `due_date_start` / `due_date_end` (date range — tasks with no due date are excluded).

**Sorting**: `sort_by` — one of `created_at` (default), `updated_at`, `due_date`. `sort_order` — `asc` or `desc` (default).

**Pagination**: `offset` and `limit` (max 100).



## OpenAPI

````yaml /api-reference/openapi-v1.json post /v1/tasks/search
openapi: 3.1.0
info:
  title: Stardex API (v1)
  version: 1.0.0
  description: >-
    Stardex ATS API — manage candidates, jobs, companies, and recruiting
    workflows.
servers:
  - url: https://api.stardex.ai
    description: Production API server
security:
  - bearerAuth: []
tags:
  - name: Persons
    description: Manage person records — contacts, work history, and custom fields.
  - name: Jobs
    description: Manage job postings — pipeline stages, team members, and custom fields.
  - name: Candidates
    description: Manage candidate records and pipeline stage transitions.
  - name: Companies
    description: Browse and retrieve company records.
  - name: Lists
    description: Create, search, and retrieve saved person and company lists.
  - name: Person Activities
    description: Create and manage activity records (notes, emails, meetings) for persons.
  - name: Team Members
    description: List team members for use in search filters and assignments.
  - name: Custom Fields
    description: Retrieve custom field definitions and tag options for search filters.
paths:
  /v1/tasks/search:
    post:
      tags:
        - Tasks
      summary: Search tasks
      description: >-
        Search and filter tasks with pagination and sorting.


        **Filters**: `keywords` (full-text search on task content), `task_types`
        (array of enum values), `related_to` + `related_record_type` (entity
        association), `is_completed` (boolean), `owner_ids` (assigned team
        members), `due_date_start` / `due_date_end` (date range — tasks with no
        due date are excluded).


        **Sorting**: `sort_by` — one of `created_at` (default), `updated_at`,
        `due_date`. `sort_order` — `asc` or `desc` (default).


        **Pagination**: `offset` and `limit` (max 100).
      operationId: searchTasks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TasksSearchBody'
      responses:
        '200':
          description: Tasks found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TasksSearchResponse'
              example:
                success: true
                data:
                  - id: aaa11111-bbbb-cccc-dddd-eeeeeeee1111
                    content_text: Follow up with candidate about interview availability
                    task_type: text
                    due_date: '2024-02-15T17:00:00Z'
                    is_completed: false
                    person_id: 123e4567-e89b-12d3-a456-426614174000
                    deal_id: 234e5678-e90a-12b3-c456-789012345678
                    client_id: 345e6789-e01b-23c4-d567-890123456789
                    job_id: 456e7890-e12b-34d5-a678-901234567890
                    created_at: '2024-02-01T10:00:00Z'
                    updated_at: '2024-02-01T10:00:00Z'
                    owners:
                      - id: 567e8901-e23c-45d6-e789-012345678901
                        first_name: Jane
                        last_name: Smith
                meta:
                  total: 42
                  offset: 0
                  limit: 100
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Always false for error responses.
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          Machine-readable error code (e.g. "VALIDATION_ERROR",
                          "NOT_FOUND").
                      message:
                        type: string
                        description: Human-readable error description.
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
components:
  schemas:
    TasksSearchBody:
      type: object
      properties:
        offset:
          type:
            - integer
            - 'null'
          minimum: 0
          default: 0
          description: Records to skip for pagination. Defaults to 0.
        limit:
          type: integer
          minimum: 1
          maximum: 100
          default: 100
          description: Max records per page (1–100). Defaults to 100.
        keywords:
          type: array
          items:
            type: string
          description: >-
            Full-text search on task content. Uses PostgreSQL tsvector index for
            efficient matching.
        task_types:
          type: array
          items:
            type: string
            enum:
              - text
              - linkedin_message
              - linkedin_connection
              - call
              - other
          description: Filter by one or more task types.
        related_to:
          type: string
          format: uuid
          description: >-
            UUID of the related entity (person, deal, client, or job). Must be
            paired with related_record_type.
        related_record_type:
          type: string
          enum:
            - person
            - deal
            - client
            - job
          description: Type of the related entity. Must be paired with related_to.
        is_completed:
          type: boolean
          description: Filter by completion status.
        owner_ids:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Filter by assigned team member UUIDs. Returns tasks owned by any of
            these members. Get IDs from GET /v1/team-members.
        due_date_start:
          type: string
          description: >-
            ISO 8601 date — only include tasks due on or after this date. Tasks
            with no due date are excluded.
        due_date_end:
          type: string
          description: >-
            ISO 8601 date — only include tasks due on or before this date. Tasks
            with no due date are excluded.
        sort_by:
          type: string
          enum:
            - created_at
            - updated_at
            - due_date
          default: created_at
          description: >-
            Column to sort by. One of: created_at (default), updated_at,
            due_date.
        sort_order:
          type: string
          enum:
            - asc
            - desc
          default: desc
          description: Sort direction. Defaults to desc.
    TasksSearchResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          type: array
          items:
            $ref: '#/components/schemas/Task'
        meta:
          type: object
          properties:
            total:
              type: number
              description: Total matching records across all pages.
            offset:
              type: number
              description: Current pagination offset.
            limit:
              type: number
              description: Page size used for this request.
          required:
            - total
            - offset
            - limit
      required:
        - success
        - data
        - meta
    Task:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Task UUID.
        content_text:
          type:
            - string
            - 'null'
          description: Plain text content of the task.
        task_type:
          type: string
          description: 'Task type: text, linkedin_message, linkedin_connection, call, other.'
        due_date:
          type:
            - string
            - 'null'
          description: ISO 8601 due date.
        is_completed:
          type: boolean
          description: Whether the task is completed.
        person_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Related person UUID.
        deal_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Related deal UUID.
        client_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Related client (organization_companies) UUID.
        job_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Related job UUID.
        created_at:
          type: string
          description: ISO 8601 creation timestamp.
        updated_at:
          type: string
          description: ISO 8601 last-updated timestamp.
        owners:
          type: array
          items:
            $ref: '#/components/schemas/TaskOwner'
          description: Team members assigned to this task.
      required:
        - id
        - content_text
        - task_type
        - due_date
        - is_completed
        - person_id
        - deal_id
        - client_id
        - job_id
        - created_at
        - updated_at
        - owners
    TaskOwner:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Team member UUID.
        first_name:
          type:
            - string
            - 'null'
          description: First name.
        last_name:
          type:
            - string
            - 'null'
          description: Last name.
      required:
        - id
        - first_name
        - last_name
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Authenticate with a Bearer token: API key, OAuth token, or session
        token.

````