# Set campaign Schedules (deprecated)

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /campaign/set/schedules:
    post:
      summary: Set campaign Schedules (deprecated)
      deprecated: false
      description: Please use "Update campaign" endpoint to set the schedule
      operationId: Campaign_campaign/set-campaign-schedules
      tags:
        - Campaign
        - Campaign
      parameters:
        - name: x-api-key
          in: header
          description: Your PlusVibe.ai account's API Key
          required: true
          example: ''
          schema:
            type: string
            description: Your PlusVibe.ai account's API Key
            default: ''
            examples:
              - your-api-key
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                campaign_id:
                  type: string
                  description: The unique identifier of the campaign.
                  examples:
                    - 66b447598f6dd99f7f7b5c0a
                workspace_id:
                  type: string
                  description: Workspace ID
                  examples:
                    - 65f3c92d3dbe5dbb35374a9a
                start_date:
                  type: string
                  description: >-
                    The date when the schedule should start. Optional. Do not
                    pass this in requst body if you do not want to set a start
                    date.
                  format: date
                  examples:
                    - '2024-01-01'
                end_date:
                  type: string
                  description: >-
                    The date when the schedule should end. Optional. Do not pass
                    this in requst body if you do not want to set an end date.
                  format: date
                schedules:
                  type: array
                  description: >-
                    An array of schedule objects defining the days, timezone,
                    and timing for the campaign.
                  items:
                    type: object
                    properties:
                      days:
                        type: object
                        description: >-
                          An object defining which days the schedule is active.
                          Keys are day numbers (1 for Monday, 2 for Tuesday,
                          etc.), and values are booleans indicating whether the
                          day is active.
                        properties:
                          '1':
                            type: boolean
                            description: ''
                            examples:
                              - true
                          '2':
                            type: boolean
                            description: ''
                            examples:
                              - true
                          '3':
                            type: boolean
                            description: ''
                            examples:
                              - true
                          '4':
                            type: boolean
                            description: ''
                            examples:
                              - true
                          '5':
                            type: boolean
                            description: ''
                            examples:
                              - true
                        x-apidog-orders:
                          - '1'
                          - '2'
                          - '3'
                          - '4'
                          - '5'
                      timezone:
                        type: string
                        description: >-
                          The timezone in which the schedule should be applied.
                          For a list of supported timezone, visit:
                          https://help.plusvibe.ai/en/articles/9734335-time-zone-supported-in-campaign-set-schedules-endpoint
                        examples:
                          - Asia/Hong_Kong
                      timing:
                        type: object
                        description: >-
                          The time range during which the campaign should be
                          active on the specified days.
                        properties:
                          from:
                            type: string
                            description: The start time of the schedule in 24-hour format.
                            format: time
                            examples:
                              - '09:00'
                          to:
                            type: string
                            description: The end time of the schedule in 24-hour format.
                            format: time
                            examples:
                              - '18:00'
                        required:
                          - from
                          - to
                        x-apidog-orders:
                          - from
                          - to
                    required:
                      - days
                      - timezone
                      - timing
                    x-apidog-orders:
                      - days
                      - timezone
                      - timing
              required:
                - campaign_id
                - workspace_id
                - schedules
                - start_date
              x-apidog-orders:
                - campaign_id
                - workspace_id
                - start_date
                - end_date
                - schedules
            examples: {}
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: ''
                    examples:
                      - success
                x-apidog-orders:
                  - status
          headers: {}
          x-apidog-name: OK
        '400':
          description: Validation or other error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: ''
                    examples:
                      - Validation error
                  error:
                    type: string
                    description: ''
                    examples:
                      - Validation error
                  errors:
                    type: array
                    description: ''
                    items:
                      type: string
                      description: ''
                      examples:
                        - 'start_date: Date must not be in the past'
                x-apidog-orders:
                  - message
                  - error
                  - errors
          headers: {}
          x-apidog-name: Bad Request
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
          headers: {}
          x-apidog-name: Server Error
      security:
        - ApiKeyAuth: []
          x-apidog:
            schemeGroups:
              - id: uS5KiuC4wfZHK42AzOfA_
                schemeIds:
                  - ApiKeyAuth
            required: true
            use:
              id: uS5KiuC4wfZHK42AzOfA_
            scopes:
              uS5KiuC4wfZHK42AzOfA_:
                ApiKeyAuth: []
      x-apidog-folder: Campaign
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/929054/apis/api-17238004-run
components:
  schemas: {}
  securitySchemes:
    ApiKeyAuth:
      type: apikey
      in: header
      name: x-api-key
      description: |
        API key issued in the PlusVibe dashboard. The server reads it
        from the `x-api-key` header and injects it into the request as
        the `api_key` query parameter, which is why you will see
        `api_key` referenced in validation errors.
    apiKey:
      type: apikey
      in: body
      name: api_key
      description: API key passed in request body
servers:
  - url: https://api.plusvibe.ai/api/v1
    description: Prod Env
security:
  - ApiKeyAuth: []
    x-apidog:
      schemeGroups:
        - id: uS5KiuC4wfZHK42AzOfA_
          schemeIds:
            - ApiKeyAuth
      required: true
      use:
        id: uS5KiuC4wfZHK42AzOfA_
      scopes:
        uS5KiuC4wfZHK42AzOfA_:
          ApiKeyAuth: []

```
