---
title: "Schedule Uploaded Contacts"
method: POST
path: "/api/v1/schedule-uploaded-contacts"
tags: ["scheduling"]
---

# Schedule Uploaded Contacts

`POST /api/v1/schedule-uploaded-contacts`

Trigger OTTR scheduling for all contacts in awaiting_scheduling status.

This endpoint processes all contacts across all campaigns that are in
'awaiting_scheduling' status. It uses Thompson sampling to assign optimal
next_follow_up_date_time values and transitions contacts to 'awaiting_contact'.

The scheduling process:
1. Fetches contacts in batches of 1000
2. Groups by campaign_id and timezone
3. Gets optimal hour distribution via Thompson sampling
4. Samples a specific time for each contact
5. Updates contacts to awaiting_contact status with scheduled time

Returns:
    ScheduleUploadResponse with counts and processing time

## Response `200`

Successful Response

- ScheduleUploadResponse — Response model for schedule upload endpoint.
  - `total_scheduled` integer, required
  - `total_failed` integer, required
  - `processing_time_seconds` number, required
  - `error` string, nullable

---

[API](https://skmtc.net/outrival/apis/fastapi.md) · [All operations](https://skmtc.net/outrival/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/outrival/fastapi/revisions/7bcf41dff3cb/schema)
