Queue System
The queue system allows you to automatically schedule posts to predefined time slots. Instead of specifying an exact date/time with scheduled_date, you can use add_to_queue=true to have the system automatically assign your post to the next available slot.
How It Works
The queue is always active with default time slots (9am, 12pm, 5pm Eastern Time). You can customize these slots, timezone, and active days through the Queue Settings endpoints.
When you upload content with add_to_queue=true:
- The system finds the next available slot based on your queue configuration
- Your post is automatically scheduled to that slot
- You receive a
job_idto track the scheduled post
Using the Queue in Uploads
Add the add_to_queue parameter to any upload endpoint:
| Name | Type | Required | Description |
|---|---|---|---|
| add_to_queue | Boolean | No | If true, automatically schedules the post to your next available queue slot. Cannot be used together with scheduled_date. |
Example Request
curl -X POST "https://api.upload-post.com/api/upload" \
-H "Authorization: Apikey YOUR_API_KEY" \
-F "user=my_profile" \
-F "platform[]=instagram" \
-F "platform[]=tiktok" \
-F "video=@my_video.mp4" \
-F "title=My awesome video" \
-F "add_to_queue=true"
Success Response 202 Accepted
{
"success": true,
"job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"scheduled_date": "2025-01-30T14:00:00+00:00",
"queue_slot": "2025-01-30T14:00:00+00:00",
"message": "Post added to queue"
}
Get Queue Settings
Retrieve the current queue configuration for a profile.
| Endpoint | GET /api/uploadposts/queue/settings |
| Authentication | Required. Authorization: Apikey <token> |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| profile_username | String | Yes | The profile to get settings for |
Success Response 200 OK
{
"success": true,
"queue_settings": {
"timezone": "America/New_York",
"slots": [
{ "hour": 9, "minute": 0 },
{ "hour": 12, "minute": 0 },
{ "hour": 17, "minute": 0 }
],
"days_of_week": [0, 1, 2, 3, 4, 5, 6]
}
}
| Field | Type | Description |
|---|---|---|
| timezone | String | IANA timezone for the queue slots (e.g., "America/New_York", "Europe/Madrid") |
| slots | Array | Array of time slots with hour (0-23) and minute (0-59) |
| days_of_week | Array | Active days: 0=Monday, 1=Tuesday, ..., 6=Sunday |
Update Queue Settings
Update the queue configuration for a profile.
| Endpoint | POST /api/uploadposts/queue/settings |
| Authentication | Required. Authorization: Apikey <token> |
Body Parameters (JSON)
| Name | Type | Required | Description |
|---|---|---|---|
| profile_username | String | Yes | The profile to update settings for |
| timezone | String | No | IANA timezone (e.g., "Europe/London"). See valid timezones. |
| slots | Array | No | Array of slot objects: [{ "hour": 9, "minute": 0 }, ...]. Max 24 slots. |
| days_of_week | Array | No | Array of active days (0-6). Example: [0, 1, 2, 3, 4] for Monday-Friday. |
Example Request
curl -X POST "https://api.upload-post.com/api/uploadposts/queue/settings" \
-H "Authorization: Apikey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"profile_username": "my_profile",
"timezone": "Europe/Madrid",
"slots": [
{ "hour": 8, "minute": 30 },
{ "hour": 13, "minute": 0 },
{ "hour": 19, "minute": 30 }
],
"days_of_week": [0, 1, 2, 3, 4]
}'
Success Response 200 OK
{
"success": true,
"queue_settings": {
"timezone": "Europe/Madrid",
"slots": [
{ "hour": 8, "minute": 30 },
{ "hour": 13, "minute": 0 },
{ "hour": 19, "minute": 30 }
],
"days_of_week": [0, 1, 2, 3, 4]
}
}
Get Queue Preview
Preview the next upcoming queue slots and their availability.
| Endpoint | GET /api/uploadposts/queue/preview |
| Authentication | Required. Authorization: Apikey <token> |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| profile_username | String | Yes | The profile to preview |
| count | Integer | No | Number of slots to return (default: 10, max: 50) |
Success Response 200 OK
{
"success": true,
"timezone": "America/New_York",
"slots": [
{
"datetime_utc": "2025-01-30T14:00:00+00:00",
"datetime_local": "2025-01-30T09:00:00-05:00",
"available": true
},
{
"datetime_utc": "2025-01-30T17:00:00+00:00",
"datetime_local": "2025-01-30T12:00:00-05:00",
"available": false,
"scheduled_post": {
"job_id": "abc123",
"title": "My scheduled post",
"platforms": ["instagram", "tiktok"]
}
}
],
"next_available": "2025-01-30T14:00:00+00:00"
}
Get Next Available Slot
Get the next available queue slot for a profile.
| Endpoint | GET /api/uploadposts/queue/next-slot |
| Authentication | Required. Authorization: Apikey <token> |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| profile_username | String | Yes | The profile to check |
Success Response 200 OK
{
"success": true,
"next_slot": {
"datetime_utc": "2025-01-30T14:00:00+00:00",
"datetime_local": "2025-01-30T09:00:00-05:00",
"timezone": "America/New_York"
}
}
If no slots are available within the next 30 days:
{
"success": true,
"next_slot": null,
"message": "No available slots found"
}
Default Configuration
If you haven't customized your queue settings, these defaults apply:
| Setting | Default Value |
|---|---|
| Timezone | America/New_York (Eastern Time) |
| Slots | 9:00 AM, 12:00 PM, 5:00 PM |
| Days of week | All days (Monday-Sunday) |
See Also
- Upload Video - Video upload endpoint
- Upload Photos - Photo upload endpoint
- Upload Text - Text post endpoint
- Schedule Posts - Manage scheduled posts
- Upload Status - Check upload/job status