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

# List Self-Schedules

> List an agent's self-scheduled future runs.

Self-schedules are **one-shot future runs an agent books for itself at runtime** (when self-scheduling
is enabled). This endpoint lists them — it does not create them. Optionally filter by status.

## Query Parameters

<ParamField query="status" type="string">
  Filter by status: `scheduled`, `completed`, or `failed`.
</ParamField>

## Response

<ResponseField name="[]" type="array">
  Array of self-schedules.

  <Expandable title="Self-Schedule">
    <ResponseField name="id" type="string">Self-schedule id — pass it to cancel the run.</ResponseField>
    <ResponseField name="agent_id" type="string">Owning agent id.</ResponseField>
    <ResponseField name="task_id" type="string | null">Execution thread the run continues, if any.</ResponseField>
    <ResponseField name="prompt" type="string | null">Instruction for the scheduled run.</ResponseField>
    <ResponseField name="run_at" type="string">When the run fires (ISO-8601 UTC).</ResponseField>
    <ResponseField name="status" type="string">`scheduled`, `completed`, or `failed`.</ResponseField>
    <ResponseField name="created_at" type="string | null">Creation timestamp.</ResponseField>
    <ResponseField name="updated_at" type="string | null">Last update timestamp.</ResponseField>
  </Expandable>
</ResponseField>

## Example Request

```bash theme={"dark"}
curl -X GET -H "x-api-key: <your-api-key>" \
  "https://api.xpander.ai/v1/agents/<agent-id>/self-schedules?status=scheduled"
```

## Example Response

```json theme={"dark"}
[
  {
    "id": "<schedule-id>",
    "agent_id": "<agent-id>",
    "task_id": "<task-id>",
    "prompt": "Follow up on the open incident.",
    "run_at": "2026-07-01T09:00:00Z",
    "status": "scheduled",
    "created_at": "2026-06-30T09:00:00Z",
    "updated_at": "2026-06-30T09:00:00Z"
  }
]
```


## OpenAPI

````yaml GET /v1/agents/{agent_id}/self-schedules
openapi: 3.1.0
info:
  title: xpander.ai API Service
  description: |2-

        The xpander.ai API Service provides a unified REST API for managing AI agents,
        executing tasks, managing knowledge bases, and integrating with external systems.
        
        Features:
        - Agent Management: Create, update, deploy, and delete AI agents
        - Task Execution: Invoke agents with support for sync, async, and streaming modes
        - Knowledge Bases: Manage knowledge bases and documents for RAG workflows
        - Tools: Discover, connect, and attach tools (connectors, custom functions, MCP servers, sub-agents, workflows) to agents and workflows
        - MCP Integration: Model Context Protocol support for standardized AI interactions
        
        Authentication: All endpoints require authentication via either an API key (`x-api-key`) or an OAuth2 JWT (`Authorization: Bearer <jwt>`).
        
  version: '0.001'
servers:
  - url: https://api.xpander.ai
security: []
paths:
  /v1/agents/{agent_id}/self-schedules:
    get:
      tags:
        - API v1
        - Agents
        - Self Schedules
      summary: List Self-Schedules
      description: List the agent's self-scheduled future runs.
      operationId: List_self_schedules_v1_agents__agent_id__self_schedules_get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'Filter by status: scheduled, completed, or failed.'
            title: Status
          description: 'Filter by status: scheduled, completed, or failed.'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SelfScheduleView'
                title: >-
                  Response List Self Schedules V1 Agents  Agent Id  Self
                  Schedules Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    SelfScheduleView:
      properties:
        id:
          type: string
          title: Id
          description: Self-schedule id. Pass it to DELETE to cancel.
        agent_id:
          type: string
          title: Agent Id
          description: Owning agent id.
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
          description: Execution thread the run continues, if any.
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt
          description: Instruction for the scheduled run.
        run_at:
          type: string
          format: date-time
          title: Run At
          description: When the run fires (UTC).
        status:
          type: string
          title: Status
          description: scheduled, completed, or failed.
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: Creation timestamp.
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: Last update timestamp.
      type: object
      required:
        - id
        - agent_id
        - run_at
        - status
      title: SelfScheduleView
      description: A one-shot self-schedule row created by the agent at runtime.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: API Key for authentication
      in: header
      name: x-api-key

````