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

# List Agent Attachments

> List the schedules and webhooks attached to an agent.

Returns the agent's cron schedules and its webhooks in one response, scoped to your API key. Use it to see everything that can run an agent automatically.


## OpenAPI

````yaml openapi/scheduler.yaml GET /schedules/by-agent/{agent_id}
openapi: 3.0.3
info:
  title: Lyzr Scheduler and Webhooks API
  version: 1.1.0
  description: >-
    Scheduler service for running Lyzr agents on cron schedules, triggering
    agents from external systems through signed webhooks, and calling arbitrary
    HTTP endpoints on a cron schedule.
servers:
  - url: https://scheduler.studio.lyzr.ai
security:
  - ApiKeyAuth: []
tags:
  - name: Schedules
    description: Run an agent on a cron schedule.
  - name: Agent Webhooks
    description: Create and manage webhook URLs that trigger an agent.
  - name: Webhook Trigger
    description: Public endpoint external services call to trigger an agent.
  - name: HTTP Schedules
    description: Call any HTTP endpoint on a cron schedule.
paths:
  /schedules/by-agent/{agent_id}:
    get:
      tags:
        - Schedules
      summary: List agent attachments
      description: List the schedules and webhooks attached to an agent.
      parameters:
        - name: agent_id
          in: path
          required: true
          description: ID of the agent.
          schema:
            type: string
      responses:
        '200':
          description: Schedules and webhooks attached to the agent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentAttachmentsResponse'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    AgentAttachmentsResponse:
      type: object
      required:
        - agent_id
        - schedules
        - webhooks
      properties:
        agent_id:
          type: string
        schedules:
          type: array
          description: Cron schedules attached to the agent.
          items:
            $ref: '#/components/schemas/ScheduleResponse'
        webhooks:
          type: array
          description: Webhook triggers attached to the agent.
          items:
            $ref: '#/components/schemas/WebhookSummary'
    ScheduleResponse:
      type: object
      required:
        - id
        - user_id
        - agent_id
        - message
        - cron_expression
        - timezone
        - created_at
      properties:
        id:
          type: string
          description: Unique schedule ID.
          example: 66f1c2a9e4b0a1b2c3d4e5f6
        user_id:
          type: string
          example: user@example.com
        agent_id:
          type: string
          example: 66e9b0f2a1c3d4e5f6a7b8c9
        message:
          type: string
          example: Summarize yesterday's support tickets and flag anything urgent.
        cron_expression:
          type: string
          example: 0 9 * * 1-5
        timezone:
          type: string
          example: Asia/Kolkata
        max_retries:
          type: integer
          default: 3
        retry_delay:
          type: integer
          default: 60
        is_active:
          type: boolean
          default: true
          description: '`false` when the schedule is paused.'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          nullable: true
        next_run_time:
          type: string
          format: date-time
          nullable: true
          description: When the schedule will next fire. `null` while paused.
        last_run_at:
          type: string
          format: date-time
          nullable: true
        last_run_success:
          type: boolean
          nullable: true
          description: >-
            Outcome of the most recent run. `null` if the schedule has never
            run.
    WebhookSummary:
      type: object
      required:
        - id
        - agent_id
        - user_id
        - webhook_url
        - created_at
      description: Webhook details without the secret key.
      properties:
        id:
          type: string
        agent_id:
          type: string
        user_id:
          type: string
        description:
          type: string
          nullable: true
        webhook_url:
          type: string
        is_active:
          type: boolean
          default: true
        created_at:
          type: string
          format: date-time
        last_triggered_at:
          type: string
          format: date-time
          nullable: true
        last_trigger_success:
          type: boolean
          nullable: true
        trigger_count:
          type: integer
          default: 0
    Error:
      type: object
      properties:
        detail:
          type: string
          example: Schedule not found
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            type: object
            properties:
              loc:
                type: array
                description: Path to the invalid field.
                items:
                  oneOf:
                    - type: string
                    - type: integer
              msg:
                type: string
                description: Human-readable error message.
              type:
                type: string
                description: Error type identifier.
  responses:
    Forbidden:
      description: The `x-api-key` header is missing or the key is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing:
              summary: Missing API key
              value:
                detail: API key missing
            invalid:
              summary: Invalid API key
              value:
                detail: Invalid Permission
    ValidationError:
      description: The request failed validation. The body lists each invalid field.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HTTPValidationError'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Lyzr API key. Required on every endpoint except Trigger Webhook.

````