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

# Get Campaign Schedule

> Get the schedule configuration for a campaign.

Retrieve the current schedule configuration for a campaign.

### Path Parameters

* `campaign_id` (integer, required): The unique identifier of the campaign

### Response

```json Response (Immediate) theme={null}
{
  "schedule_type": "immediate",
  "scheduled_at": null,
  "recurring_config": null
}
```

```json Response (Scheduled) theme={null}
{
  "schedule_type": "scheduled",
  "scheduled_at": "2024-02-15T09:00:00Z",
  "recurring_config": null
}
```

```json Response (Recurring) theme={null}
{
  "schedule_type": "recurring",
  "scheduled_at": "2024-02-15T09:00:00Z",
  "recurring_config": {
    "frequency": "weekly",
    "interval": 1,
    "days_of_week": [1, 2, 3, 4, 5],
    "time": "09:00",
    "time_zone": "America/New_York",
    "end_date": "2024-12-31"
  }
}
```

### Response Fields

| Field              | Description                                             |
| ------------------ | ------------------------------------------------------- |
| `schedule_type`    | Schedule type: `immediate`, `scheduled`, or `recurring` |
| `scheduled_at`     | Scheduled execution time (ISO 8601 UTC)                 |
| `recurring_config` | Recurring schedule configuration (if applicable)        |

### Recurring Config Fields

| Field          | Description                                    |
| -------------- | ---------------------------------------------- |
| `frequency`    | `daily`, `weekly`, or `monthly`                |
| `interval`     | Every N days/weeks/months                      |
| `days_of_week` | Days for weekly schedules (1=Monday, 7=Sunday) |
| `time`         | Execution time (24-hour format)                |
| `time_zone`    | Timezone for scheduling                        |
| `end_date`     | When to stop recurring                         |

### Example Code

```bash cURL theme={null}
curl -X GET "https://api.burki.dev/api/v1/campaigns/42/schedule" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```python Python theme={null}
import requests
from datetime import datetime

response = requests.get(
    "https://api.burki.dev/api/v1/campaigns/42/schedule",
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)

schedule = response.json()

if schedule["schedule_type"] == "immediate":
    print("Campaign set for immediate execution")
elif schedule["schedule_type"] == "scheduled":
    scheduled_at = datetime.fromisoformat(schedule["scheduled_at"].replace("Z", "+00:00"))
    print(f"Campaign scheduled for: {scheduled_at}")
elif schedule["schedule_type"] == "recurring":
    config = schedule["recurring_config"]
    print(f"Recurring {config['frequency']} at {config['time']} {config['time_zone']}")
```

```javascript JavaScript theme={null}
const response = await fetch("https://api.burki.dev/api/v1/campaigns/42/schedule", {
  headers: {
    "Authorization": "Bearer YOUR_API_KEY"
  }
});

const schedule = await response.json();

switch (schedule.schedule_type) {
  case "immediate":
    console.log("Campaign set for immediate execution");
    break;
  case "scheduled":
    console.log(`Campaign scheduled for: ${schedule.scheduled_at}`);
    break;
  case "recurring":
    const config = schedule.recurring_config;
    console.log(`Recurring ${config.frequency} at ${config.time} ${config.time_zone}`);
    break;
}
```

### Error Responses

| Status Code | Description        |
| ----------- | ------------------ |
| 404         | Campaign not found |
| 401         | Unauthorized       |


## OpenAPI

````yaml GET /api/v1/campaigns/{campaign_id}/schedule
openapi: 3.1.0
info:
  title: Burki
  description: A system that uses AI to answer customer Calls.
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/campaigns/{campaign_id}/schedule:
    get:
      tags:
        - campaigns
      summary: Get Campaign Schedule
      description: Get the schedule configuration for a campaign.
      operationId: get_campaign_schedule_api_v1_campaigns__campaign_id__schedule_get
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: integer
            title: Campaign Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````