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

# Set Campaign Schedule

> Set or clear when a campaign starts and the hours it may dial in.

The calling window can be changed at any point in a campaign's life -
narrowing it on a campaign that is mid-run simply stops the next batch
until the window opens. A start time only means anything while the
campaign is still waiting to start.



## OpenAPI

````yaml /api-reference/openapi.en.json post /api/v1/campaigns/{campaign_id}/schedule
openapi: 3.1.0
info:
  title: Brosbots API
  description: >
    The public Brosbots REST API. Build and manage voice agents, run outbound

    campaigns, read calls and usage, and manage phone numbers, tools,

    knowledge bases and integrations.


    ## Authentication


    Every request must include your organization's API key in the

    `X-API-Key` header:


    ```

    X-API-Key: bb_live_...

    ```


    You create and revoke keys in the dashboard:

    click your account in the bottom-left corner of the sidebar, then **Brosbots
    API**.


    ## Base URL


    ```

    https://app.brosbots.com/api/v1

    ```


    ## Conventions


    - Request and response bodies are JSON (`Content-Type: application/json`).

    - Timestamps are ISO 8601 with a timezone.

    - Lists are paginated with `page` / `limit` parameters; responses include
      `total_count` / `total_pages`.
    - Errors use standard HTTP status codes with a JSON body:
      `{"detail": "a human-readable reason"}`.
    - `{agent_id}` accepts the agent's public ID (`agent_...`) or its number.


    ## Limits


    There is no fixed per-key request-rate limit today. `429` comes from the

    calling endpoints (`POST /agents/{agent_id}/calls` and

    `POST /triggers/{trigger_id}/calls`) when every outbound channel is busy;
    its `Retry-After` header says how many seconds to wait. Handle `429`

    generally: wait as long as `Retry-After` says, or back off exponentially
    when

    it is absent. A request-rate limit may be introduced.
  version: 1.0.0
servers: []
security:
  - ApiKeyAuth: []
paths:
  /api/v1/campaigns/{campaign_id}/schedule:
    post:
      tags:
        - Campaigns
      summary: Set Campaign Schedule
      description: |-
        Set or clear when a campaign starts and the hours it may dial in.

        The calling window can be changed at any point in a campaign's life -
        narrowing it on a campaign that is mid-run simply stops the next batch
        until the window opens. A start time only means anything while the
        campaign is still waiting to start.
      operationId: post_campaigns_campaign_id_schedule
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: integer
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduleRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ScheduleRequest:
      properties:
        scheduled_start_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        calling_window:
          anyOf:
            - $ref: '#/components/schemas/CallingWindowRequest'
            - type: 'null'
      type: object
      title: ScheduleRequest
      description: |-
        Set or clear a campaign's schedule.

        Both fields are sent every time: omitting one clears it, because "no
        start time" and "no calling window" are real settings a customer picks.
    CampaignResponse:
      properties:
        id:
          type: integer
        name:
          type: string
        goal:
          anyOf:
            - type: string
            - type: 'null'
        workflow_id:
          type: integer
        workflow_name:
          type: string
        state:
          type: string
        source_type:
          type: string
        source_id:
          type: string
        source_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
        source_refresh_minutes:
          anyOf:
            - type: integer
            - type: 'null'
        source_last_synced_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        source_sync_error:
          anyOf:
            - type: string
            - type: 'null'
        scheduled_start_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        calling_window:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
        total_rows:
          anyOf:
            - type: integer
            - type: 'null'
        processed_rows:
          type: integer
        failed_rows:
          type: integer
        created_at:
          type: string
          format: date-time
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
      type: object
      required:
        - id
        - name
        - workflow_id
        - workflow_name
        - state
        - source_type
        - source_id
        - total_rows
        - processed_rows
        - failed_rows
        - created_at
        - started_at
        - completed_at
      title: CampaignResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
      title: HTTPValidationError
    CallingWindowRequest:
      properties:
        timezone:
          type: string
          default: Europe/Warsaw
        days:
          items:
            type: integer
          type: array
          default:
            - 1
            - 2
            - 3
            - 4
            - 5
        start:
          type: string
          default: '09:00'
        end:
          type: string
          default: '17:00'
      type: object
      title: CallingWindowRequest
      description: Hours a campaign may dial in, in the customer's own timezone.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your organization's API key (account in the bottom-left of the dashboard
        → Brosbots API).

````

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