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

# Update one of the project's schedules

> Every field is optional and unset fields keep their value. Enabling a schedule while another of the project's schedules is on needs a plan with multiple schedules. Answers with every schedule of the project.



## OpenAPI

````yaml /api-reference/openapi.json patch /projects/{id}/schedules/{scheduleId}
openapi: 3.1.0
info:
  title: OpenLens API
  version: 1.4.0
  description: >-
    Public REST API for OpenLens. Onboard clients, run scans across the major AI
    platforms, read visibility metrics, and download client-ready reports. Beta
    — endpoints may evolve before GA.
  contact:
    name: OpenLens support
    email: contact@aibread.com
servers:
  - url: https://openlens.com/api
security:
  - bearerAuth: []
tags:
  - name: Onboarding
  - name: Runs
  - name: Metrics
  - name: Citations
  - name: Deliverables
  - name: Resources
  - name: Account
paths:
  /projects/{id}/schedules/{scheduleId}:
    patch:
      tags:
        - Resources
      summary: Update one of the project's schedules
      description: >-
        Every field is optional and unset fields keep their value. Enabling a
        schedule while another of the project's schedules is on needs a plan
        with multiple schedules. Answers with every schedule of the project.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: scheduleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduleChange'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectSchedules'
        '400':
          description: >-
            Invalid schedule: a malformed field, an unknown time zone, a start
            more than a year out, an empty scope, prompts that aren't active in
            the project, platforms outside your plan, or a sixth schedule in the
            project (code `SCHEDULE_LIMIT_REACHED`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, malformed, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            The change needs an upgrade: a cadence outside the plan (code
            `PLAN_CADENCE_NOT_ALLOWED`), several countries without multi-country
            support, more monthly credits than the pool has left (code
            `PROMPT_ALLOWANCE_RESERVATION`), or a second active schedule in the
            project on a plan without multiple schedules (code
            `MULTIPLE_SCHEDULES_NOT_ALLOWED`). Also returned when the tier's
            included API calls are used up (code `USAGE_LIMIT`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource not found or not owned by your account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limit, project cap, or daily quota hit. Body includes a `code`
            field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error. Retry; if persistent, contact support.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            A requested platform is unavailable, or an inherited scope has no
            available platforms (code PLATFORM_UNAVAILABLE; platforms lists
            affected ids). Update the requested scope before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformUnavailableError'
components:
  schemas:
    ScheduleChange:
      type: object
      properties:
        name:
          type:
            - string
            - 'null'
          description: Optional label (up to 80 characters); null clears it.
        enabled:
          type: boolean
        frequency:
          type: string
          enum:
            - daily
            - weekly
            - monthly
        hour:
          type: integer
          minimum: 0
          maximum: 23
          deprecated: true
          description: >-
            Legacy: a UTC hour. Moves the schedule to the next occurrence of
            that hour and repeats it in UTC. Ignored when `startsAt` is set;
            prefer `startsAt` + `timezone`.
        startsAt:
          type: string
          format: date-time
          description: >-
            The first run, as ISO 8601 with its UTC offset (e.g.
            `2026-11-02T09:00:00-05:00`). Within the next year.
        timezone:
          type: string
          description: >-
            IANA time zone the schedule repeats in (e.g. `America/New_York`), so
            runs keep their wall-clock time across daylight saving changes. Send
            it with `startsAt`: changing an existing schedule's zone without a
            start time is a 400. Defaults to the current zone, or UTC for a new
            schedule.
        scope:
          type: object
          description: What the schedule runs. Each field is optional.
          properties:
            promptIds:
              type:
                - array
                - 'null'
              items:
                type: string
                format: uuid
              minItems: 1
              description: >-
                Prompts the schedule runs, or null for every active prompt,
                including ones added later.
            platforms:
              type: array
              items:
                type: string
                enum:
                  - chatgpt
                  - chatgpt_app
                  - claude
                  - gemini
                  - gemini_app
                  - grok_app
                  - grok_api
                  - perplexity
                  - perplexity_app
                  - google_app
                  - deepseek
                description: >-
                  LLM platform identifier. Newer scraper-backed ids end in
                  `_app`; `chatgpt`, `perplexity`, and `gemini` are legacy and
                  not returned by current runs.
              minItems: 1
            countryCodes:
              type: array
              items:
                type: string
              minItems: 1
              description: >-
                ISO 3166-1 alpha-2 country codes. More than one needs a plan
                with multi-country reporting.
    ProjectSchedules:
      type: object
      properties:
        schedules:
          type: array
          items:
            $ref: '#/components/schemas/ProjectSchedule'
          description: The project's schedules, oldest first.
        draft:
          $ref: '#/components/schemas/ProjectSchedule'
          description: The defaults a new schedule starts from.
        multipleSchedulesEnabled:
          type: boolean
          description: Whether the plan allows more than one active schedule per project.
      required:
        - schedules
        - draft
        - multipleSchedulesEnabled
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine code for programmatic handling, when applicable.
      required:
        - error
    PlatformUnavailableError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          const: PLATFORM_UNAVAILABLE
        platforms:
          type: array
          items:
            $ref: '#/components/schemas/PlatformId'
      required:
        - error
        - code
        - platforms
    ProjectSchedule:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: The schedule's ID; null until it is saved.
        name:
          type:
            - string
            - 'null'
          description: Optional label for telling a project's schedules apart.
        configured:
          type: boolean
          description: False until a schedule is saved for the project.
        enabled:
          type: boolean
        frequency:
          type: string
          enum:
            - daily
            - weekly
            - monthly
        hour:
          type: integer
          minimum: 0
          maximum: 23
          deprecated: true
          description: >-
            UTC hour of `startsAt` (9 until configured). Prefer `startsAt` +
            `timezone`.
        startsAt:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            The first run; later runs repeat from it in `timezone`. Null until
            configured.
        timezone:
          type:
            - string
            - 'null'
          description: IANA time zone the schedule repeats in. Null until configured.
        nextScheduledRunAt:
          type:
            - string
            - 'null'
          format: date-time
          description: The next run while the schedule is on; null while it is off.
        upcomingRunAt:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the schedule would run next, on or off: its next run, or the
            next occurrence of its start. Null until configured.
        pauseReason:
          type:
            - string
            - 'null'
        allowedCadences:
          type: array
          items:
            type: string
            enum:
              - daily
              - weekly
              - monthly
        plan:
          type: string
        multiCountryEnabled:
          type: boolean
          description: Whether the plan can schedule more than one country.
        scope:
          type: object
          properties:
            promptIds:
              type:
                - array
                - 'null'
              items:
                type: string
                format: uuid
              minItems: 1
              description: >-
                Prompts the schedule runs, or null for every active prompt,
                including ones added later.
            platforms:
              type: array
              items:
                type: string
                enum:
                  - chatgpt
                  - chatgpt_app
                  - claude
                  - gemini
                  - gemini_app
                  - grok_app
                  - grok_api
                  - perplexity
                  - perplexity_app
                  - google_app
                  - deepseek
                description: >-
                  LLM platform identifier. Newer scraper-backed ids end in
                  `_app`; `chatgpt`, `perplexity`, and `gemini` are legacy and
                  not returned by current runs.
              minItems: 1
            countryCodes:
              type: array
              items:
                type: string
              minItems: 1
              description: >-
                ISO 3166-1 alpha-2 country codes. More than one needs a plan
                with multi-country reporting.
          required:
            - promptIds
            - platforms
            - countryCodes
        estimate:
          type: object
          description: Inputs for the schedule's monthly credit estimate.
          properties:
            activePrompts:
              type: integer
              description: Active prompts the scope covers today.
            platforms:
              type: array
              items:
                type: string
                enum:
                  - chatgpt
                  - chatgpt_app
                  - claude
                  - gemini
                  - gemini_app
                  - grok_app
                  - grok_api
                  - perplexity
                  - perplexity_app
                  - google_app
                  - deepseek
                description: >-
                  LLM platform identifier. Newer scraper-backed ids end in
                  `_app`; `chatgpt`, `perplexity`, and `gemini` are legacy and
                  not returned by current runs.
            countries:
              type: integer
            pool:
              type: number
              description: The organization's monthly credit pool.
          required:
            - activePrompts
            - platforms
            - countries
            - pool
      required:
        - id
        - name
        - configured
        - enabled
        - frequency
        - hour
        - startsAt
        - timezone
        - nextScheduledRunAt
        - upcomingRunAt
        - pauseReason
        - allowedCadences
        - plan
        - multiCountryEnabled
        - scope
        - estimate
    PlatformId:
      type: string
      enum:
        - chatgpt
        - chatgpt_app
        - claude
        - gemini
        - gemini_app
        - grok_app
        - grok_api
        - perplexity
        - perplexity_app
        - google_app
        - deepseek
      description: >-
        LLM platform identifier. Newer scraper-backed ids end in `_app`;
        `chatgpt`, `perplexity`, and `gemini` are legacy and not returned by
        current runs.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Clerk API key. Create one from your account settings under API Keys.

````

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