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

# Change a scheduled run

> Keeps the status. On an active scheduled run, `next_run_at` is computed again. A scheduled run that belongs to a play cannot be changed here: `409 scheduled_run_belongs_to_play`; change it on the play, in the app.



## OpenAPI

````yaml /openapi.yaml patch /v1/scheduled-runs/{id}
openapi: 3.1.0
info:
  title: Retriever Public API
  version: 1.0.0
  description: >
    Retriever public API: start the prospecting agent (runs), read and export

    tables, import data, sync exclusion lists, run structured research (Go),

    and call atomic services.


    **Model Context Protocol (MCP)**: the same account and credits are available

    through the hosted MCP server (`POST /mcp`, Streamable HTTP). See the MCP

    guide in this documentation (Model Context Protocol navigation). Primary

    tools: `service_discover`, `service_execute`, `service_batch_execute` and

    `service_batch_get` (the slow services), `retriever_build_list_*`,

    `retriever_research_*`, `workspace_list`, `table_*`, `exclusion_*`,

    `credits`, `sequence_*`, `sender_*`, `inbox_*`.


    **Authentication**: `Authorization: Bearer ret_live_…`. Create the key in
    the

    app: Settings → **API keys** → **Create API key**. The key grants access to

    resources in the key owner's organization.


    **Errors**: every HTTP error has the shape

    `{ "error": { "code": "…", "message": "…", "details": … } }`.

    Branch your code on `error.code` (stable), never on `message`.


    **Rate limits**: key-authenticated responses include

    `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset` (seconds).

    A `429` response also includes `Retry-After` (seconds).

    Any key-authenticated operation can also answer `503` with code

    `key_check_busy` (see `components.responses.KeyCheckBusy`): the key could

    not be checked right now, often a key created a moment ago during a flood

    of unknown keys. Retry after `Retry-After` seconds.


    **Request size**: a request body can be at most 10 MiB (10,485,760

    bytes), and 25 MiB (26,214,400 bytes) on a table import. A larger body

    gets `413 body_too_large`.


    API error messages are in English.
  contact:
    name: Retriever
servers:
  - url: https://api.retriever.run
    description: Production
  - url: http://localhost:4320
    description: Local app-server
security:
  - bearerAuth: []
tags:
  - name: Runs
    description: Prospecting agent « prompt in, table out ». Asynchronous.
  - name: Tables
    description: Read live tables in a workspace.
  - name: Workspaces
    description: Create workspaces and import tables.
  - name: Exclusions
    description: Company and people lists to never source.
  - name: Scheduled runs
    description: Repeat a list-building mission on a cadence.
  - name: Plays
    description: Find, qualify and contact leads on a cadence, and sort them.
  - name: Go
    description: >-
      One question, one structured answer: the Go agent searches the web and can
      call every Retriever service.
  - name: Services
    description: Atomic services (search, scraping, email…).
  - name: Credits
    description: Credit balance.
paths:
  /v1/scheduled-runs/{id}:
    patch:
      tags:
        - Scheduled runs
      summary: Change a scheduled run
      description: >-
        Keeps the status. On an active scheduled run, `next_run_at` is computed
        again. A scheduled run that belongs to a play cannot be changed here:
        `409 scheduled_run_belongs_to_play`; change it on the play, in the app.
      operationId: updateScheduledRun
      parameters:
        - $ref: '#/components/parameters/ScheduleId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateScheduledRunRequest'
      responses:
        '200':
          description: The scheduled run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduledRun'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ScheduledRunNotFound'
        '409':
          $ref: '#/components/responses/ScheduledRunConflict'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  parameters:
    ScheduleId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Id of the scheduled run.
  schemas:
    UpdateScheduledRunRequest:
      type: object
      minProperties: 1
      additionalProperties: false
      properties:
        title:
          type: string
        prompt:
          type: string
        cadence:
          $ref: '#/components/schemas/ScheduledRunCadence'
        timezone:
          type: string
    ScheduledRun:
      type: object
      required:
        - id
        - workspace_id
        - title
        - summary
        - prompt
        - cadence
        - timezone
        - status
        - next_run_at
        - created_at
        - updated_at
        - links
      properties:
        id:
          type: string
        workspace_id:
          type: string
        title:
          type: string
        summary:
          type:
            - string
            - 'null'
          description: Short description written when the app's agent created it.
        prompt:
          type: string
        cadence:
          $ref: '#/components/schemas/ScheduledRunCadence'
        timezone:
          type: string
        status:
          type: string
          enum:
            - draft
            - active
            - paused
            - archived
          description: '`archived` means deleted.'
        next_run_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Set only while `active`.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        links:
          type: object
          required:
            - self
            - runs
            - tables
            - app
          properties:
            self:
              type: string
            runs:
              type: string
            tables:
              type: string
              description: The workspace's tables, where executions add rows.
            app:
              type: string
              description: Opens the workspace in Retriever.
    ScheduledRunCadence:
      oneOf:
        - type: object
          required:
            - frequency
            - time
          additionalProperties: false
          properties:
            frequency:
              type: string
              enum:
                - daily
            time:
              type: string
              description: HH:mm in `timezone`.
        - type: object
          required:
            - frequency
            - weekday
            - time
          additionalProperties: false
          properties:
            frequency:
              type: string
              enum:
                - weekly
            weekday:
              type: integer
              minimum: 1
              maximum: 7
              description: 1 is Monday, 7 is Sunday.
            time:
              type: string
              description: HH:mm in `timezone`.
        - type: object
          required:
            - frequency
            - every_days
            - time
          additionalProperties: false
          properties:
            frequency:
              type: string
              enum:
                - interval
            every_days:
              type: integer
              minimum: 1
              maximum: 30
            time:
              type: string
              description: HH:mm in `timezone`.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable code; use in your application.
            message:
              type: string
              description: Human-readable explanation. May change.
            details:
              description: Optional details (e.g. list of invalid fields).
  responses:
    BadRequest:
      description: >-
        `invalid_request`: unreadable JSON, unknown field or query parameter,
        wrong type, `limit` out of range, empty `Idempotency-Key`, invalid
        `output` contract. `message` names each invalid field; `details` lists
        them as `{ path, message }`. On `POST /v1/runs`, `workspace_mismatch`:
        the conversation does not belong to the provided workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_request
              message: 'prompt: prompt must not be blank'
              details:
                - path: prompt
                  message: prompt must not be blank
    Unauthorized:
      description: >-
        `not_authenticated`: missing header, malformed (expected `Bearer
        <key>`), revoked or unknown key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: not_authenticated
              message: A valid API key is required.
    ScheduledRunNotFound:
      description: >-
        `scheduled_run_not_found`: unknown id or another organization's
        scheduled run. `workspace_not_found`: unknown `workspace_id` on create.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: scheduled_run_not_found
              message: Scheduled run not found.
    ScheduledRunConflict:
      description: >-
        `scheduled_run_archived`: the scheduled run was deleted.
        `scheduled_run_belongs_to_play`: the scheduled run belongs to a play;
        change or delete it on the play, in the app. `play_paused`,
        `play_archived`, `play_not_launched`, `play_run_busy`: the play this
        scheduled run belongs to cannot run now; `message` says why.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: scheduled_run_archived
              message: This scheduled run was deleted.
    UnsupportedMediaType:
      description: '`invalid_request`: add `Content-Type: application/json`.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_request
              message: Content-Type must be application/json.
    TooManyRequests:
      description: '`rate_limited`: wait `Retry-After` seconds, then retry.'
      headers:
        Retry-After:
          schema:
            type: integer
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: rate_limited
              message: Rate limit exceeded. Retry in 12 s.
  headers:
    RateLimit-Limit:
      schema:
        type: integer
      description: Window budget.
    RateLimit-Remaining:
      schema:
        type: integer
      description: Remaining requests.
    RateLimit-Reset:
      schema:
        type: integer
      description: Seconds until reset.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key `ret_live_…` created in Settings → API keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.