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

# Update schedule



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml put /agents/{agentId}/schedules/{scheduleId}
openapi: 3.1.0
info:
  description: API-key accessible routes for Cerca agents.
  title: Cerca API
  version: 0.0.0
servers:
  - url: https://api.cerca.dev
security:
  - bearerAuth: []
paths:
  /agents/{agentId}/schedules/{scheduleId}:
    put:
      tags:
        - Schedules
      summary: Update schedule
      parameters:
        - schema:
            type: string
            minLength: 1
            example: agent_abc123
          required: true
          in: path
          name: agentId
        - schema:
            type: string
            minLength: 1
            example: schedule_abc123
          required: true
          in: path
          name: scheduleId
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateScheduleRequest'
      responses:
        '200':
          description: Schedule updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Schedule'
        '400':
          description: Invalid runtime request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Access denied or non-transient quota exceeded. Limit errors include
            a stable code field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Runtime resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Transient capacity limit exceeded. Limit errors include a stable
            code field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Required runtime dependency unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          description: Runtime error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Cerca from '@cerca-dev/sdk';


            const client = new Cerca({
              apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
            });


            const schedule = await client.schedules.update('agent_abc123',
            'schedule_abc123');


            console.log(schedule.id);
        - lang: Python
          source: |-
            import os
            from cerca import Cerca

            client = Cerca(
                api_key=os.environ.get("CERCA_API_KEY"),  # This is the default and can be omitted
            )
            schedule = client.schedules.update(
                agent_id="agent_abc123",
                schedule_id="schedule_abc123",
            )
            print(schedule.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/matrices/cerca-go\"\n\t\"github.com/matrices/cerca-go/option\"\n)\n\nfunc main() {\n\tclient := cercago.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tschedule, err := client.Schedules.Update(\n\t\tcontext.TODO(),\n\t\t\"agent_abc123\",\n\t\t\"schedule_abc123\",\n\t\tcercago.ScheduleUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", schedule.ID)\n}\n"
        - lang: Ruby
          source: |-
            require "cerca"

            cerca = Cerca::Client.new(api_key: "My API Key")

            schedule = cerca.schedules.update("agent_abc123", "schedule_abc123")

            puts(schedule)
        - lang: CLI
          source: |-
            cerca schedules update \
              --api-key 'My API Key' \
              --agent-id agent_abc123 \
              --schedule-id schedule_abc123
components:
  schemas:
    UpdateScheduleRequest:
      type: object
      properties:
        cron:
          type: string
        enabled:
          type: boolean
        instructions:
          type: string
        message:
          type: string
        model:
          type: string
        name:
          type: string
        runAt:
          type: string
          format: date-time
        timezone:
          type: string
        tools:
          type: array
          items:
            $ref: '#/components/schemas/RuntimeToolSpec'
          description: >-
            Per-schedule tool subset. When updated, these tools can only narrow
            the agent's effective tools for future scheduled threads.
      additionalProperties: false
    Schedule:
      type: object
      properties:
        createdAt:
          type: string
        cron:
          type: string
        enabled:
          type: boolean
        id:
          type: string
        instructions:
          type: string
        model:
          type: string
        name:
          type: string
        nextAt:
          type:
            - string
            - 'null'
        message:
          type: string
        runAt:
          type: string
          format: date-time
        timezone:
          type: string
        tools:
          type: array
          items:
            $ref: '#/components/schemas/RuntimeToolSpec'
          description: >-
            Per-schedule tool subset. Scheduled threads inherit the agent's
            effective tools when omitted and can only narrow them when provided.
        updatedAt:
          type: string
      required:
        - createdAt
        - enabled
        - id
        - name
        - nextAt
        - message
        - timezone
        - updatedAt
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine-readable error code when the API can provide one.
          example: MONTHLY_TOKEN_BUDGET_EXCEEDED
      required:
        - error
    RuntimeToolSpec:
      type: string
      minLength: 1
      description: >-
        Configurable runtime tool name, configurable namespace wildcard such as
        sandbox.*, or external namespace wildcard such as google.*. At thread
        and turn scope, entries can only narrow the agent's effective tools.
      examples:
        - sandbox.*
        - memory.read
        - google.*
  securitySchemes:
    bearerAuth:
      bearerFormat: Cerca API key
      scheme: bearer
      type: http

````