Assignments
An assignment is a publishing job that sends content to a connected social media channel. Each assignment moves through a lifecycle from pending to published (or failed).
Before creating an assignment you need a connectionId — get one from Connections. The payload structure depends on the target platform; see Platform Capabilities for the full schema per platform.
Base URL: https://pharlo.io
Auth: Authorization: Bearer ds_live_...
Endpoints
| Method | Path | Description | Status |
|---|---|---|---|
| POST | /api/v1/assignments | Create a publishing assignment | 201 |
| GET | /api/v1/assignments | Paginated list | 200 |
| GET | /api/v1/assignments/{id} | Assignment detail | 200 |
| PATCH | /api/v1/assignments/{id} | Update payload or schedule | 200 |
| POST | /api/v1/assignments/{id}/retry | Retry a failed assignment | 200 |
| DELETE | /api/v1/assignments/{id} | Cancel assignment | 204 |
POST /api/v1/assignments
Create a new publishing job.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
connectionId | UUID | Yes | ID of the channel connection to publish to. See Connections. |
type | string | Yes | Content type: video, image, link, text, reel, short, story, carousel. Available types depend on the platform — see Platform Capabilities. |
payload | object | Yes | Platform-specific fields (title, description, privacy, tags, etc.). The accepted fields and their constraints vary by platform and type. |
mediaUrl | string | No | Publicly accessible media URL. Required for video and image types. The API downloads from this URL at publish time. |
mediaContentType | string | No | MIME type of the media file (e.g. video/mp4, image/jpeg). |
mediaSizeBytes | int | No | Media file size in bytes. Used for upload progress tracking. |
scheduledAt | ISO 8601 | No | Scheduled publish time. Must include an explicit timezone offset (e.g. +03:00). Omit for immediate publishing. |
callbackUrl | string | No | Webhook URL called on every status change. See Webhook guide and Webhook deliveries. |
idempotencyKey | string | No | Unique string to prevent duplicate submissions on retry. |
externalId | string | No | Your own identifier for this assignment — useful for correlating with your internal system. |
Idempotency — if you retry a failed HTTP request, include the same idempotencyKey. The API will return the original assignment instead of creating a duplicate. Keys expire after 24 hours.
Scheduled time timezone — always pass scheduledAt with an explicit offset such as 2026-04-25T18:00:00+03:00. Bare UTC strings (Z) are accepted but ambiguous for users in other timezones. The response always returns scheduledAt normalized to UTC.
Example request
curl -X POST https://pharlo.io/api/v1/assignments \
-H "Authorization: Bearer $DELIVERY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"connectionId": "7f3e1a2b-4c5d-6e7f-8a9b-0c1d2e3f4a5b",
"type": "video",
"payload": {
"title": "Product Demo",
"description": "See what is new in v2",
"privacy": "public"
},
"mediaUrl": "https://cdn.example.com/demo.mp4",
"scheduledAt": "2026-04-25T18:00:00+03:00",
"callbackUrl": "https://your-server.com/webhook"
}'Response 201 Created
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "pending",
"connectionId": "7f3e1a2b-4c5d-6e7f-8a9b-0c1d2e3f4a5b",
"platform": "youtube",
"type": "video",
"scheduledAt": "2026-04-25T15:00:00Z",
"createdAt": "2026-04-23T10:00:00Z"
}GET /api/v1/assignments
Paginated list of assignments. Use filters to narrow results by status, platform, or date range.
Query parameters
| Parameter | Type | Description |
|---|---|---|
page | int | Page number (default: 1) |
limit | int | Items per page (default: 20, max: 50) |
status | string | pending, uploading, uploaded, processing, published, failed, cancelled |
platform | string | youtube, facebook |
connectionId | UUID | Filter by a specific channel connection |
externalId | string | Exact match on your custom identifier |
dateFrom | ISO 8601 | Return assignments created after this date |
dateTo | ISO 8601 | Return assignments created before this date |
Example request
curl "https://pharlo.io/api/v1/assignments?status=published&limit=10" \
-H "Authorization: Bearer $DELIVERY_API_KEY"Response 200 OK
{
"items": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "published",
"platform": "youtube",
"type": "video",
"platformUrl": "https://youtu.be/dQw4w9WgXcQ",
"publishedAt": "2026-04-25T15:02:35Z",
"createdAt": "2026-04-23T10:00:00Z"
}
],
"total": 1,
"page": 1,
"limit": 10
}GET /api/v1/assignments/{id}
Full assignment detail including status, errors, platform URL, and payload.
Assignment lifecycle
Assignments progress through the following statuses in order. Once published, the platformUrl field is populated with the live URL.
| Status | Meaning |
|---|---|
pending | Queued, not yet started |
uploading | Media is being transferred to the platform |
uploaded | Media uploaded; platform is applying metadata |
processing | Platform is processing the content (e.g. transcoding) |
published | Live on the platform — platformUrl is set |
failed | Processing failed — check the errors array for details |
cancelled | Manually cancelled via DELETE — cannot be restarted |
If an assignment reaches failed, inspect errors for the root cause, fix the underlying issue (e.g. update payload via PATCH), and then call the retry endpoint. cancelled assignments cannot be retried — create a new one instead.
Example request
curl https://pharlo.io/api/v1/assignments/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer $DELIVERY_API_KEY"Response 200 OK — published
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "published",
"platform": "youtube",
"type": "video",
"platformPostId": "dQw4w9WgXcQ",
"platformUrl": "https://youtu.be/dQw4w9WgXcQ",
"publishedAt": "2026-04-25T15:02:35Z",
"payload": {
"title": "Product Demo",
"privacy": "public"
}
}Response 200 OK — failed
When status is failed, the errors array contains one or more platform error codes with human-readable messages. Use these to diagnose the issue before retrying.
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "failed",
"platform": "youtube",
"type": "video",
"errors": [
{
"code": "QUOTA_EXCEEDED",
"message": "YouTube daily upload quota exceeded for this channel."
}
],
"payload": {
"title": "Product Demo",
"privacy": "public"
},
"createdAt": "2026-04-23T10:00:00Z"
}PATCH /api/v1/assignments/{id}
Update a pending or uploaded assignment before it is processed. You can change the payload (title, description, privacy, etc.) or reschedule with a new scheduledAt.
To update metadata of an already published YouTube video (e.g. change the title or description), include "updatePublished": true. This sends the updated payload to the platform directly without changing the assignment status.
PATCH is only allowed on pending and uploaded assignments (or any status when using updatePublished: true for published YouTube videos). Attempting to update a processing, failed, or cancelled assignment returns 409 Conflict.
Example — reschedule and update title
curl -X PATCH https://pharlo.io/api/v1/assignments/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer $DELIVERY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"scheduledAt": "2026-04-26T18:00:00+03:00",
"payload": {
"title": "Updated Title",
"privacy": "public"
}
}'Example — update an already-published YouTube video
curl -X PATCH https://pharlo.io/api/v1/assignments/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer $DELIVERY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"updatePublished": true,
"payload": {
"title": "Product Demo — Final Cut",
"description": "Updated description with corrected links.",
"privacy": "public"
}
}'Response 200 OK
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "pending",
"scheduledAt": "2026-04-26T15:00:00Z",
"payload": {
"title": "Updated Title",
"privacy": "public"
}
}POST /api/v1/assignments/{id}/retry
Re-queue a failed assignment without creating a new one. The assignment status resets to pending and it re-enters the processing queue.
Before retrying, consider updating the payload via PATCH if the failure was caused by invalid metadata (e.g. a title that exceeds the platform character limit). See the errors array on the detail response for the failure reason.
Example request
curl -X POST https://pharlo.io/api/v1/assignments/a1b2c3d4-e5f6-7890-abcd-ef1234567890/retry \
-H "Authorization: Bearer $DELIVERY_API_KEY"Response 200 OK
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "pending"
}DELETE /api/v1/assignments/{id}
Cancel a pending or scheduled assignment. Cancellation is permanent — cancelled assignments cannot be restarted. To publish the same content again, create a new assignment.
Example request
curl -X DELETE https://pharlo.io/api/v1/assignments/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer $DELIVERY_API_KEY"Returns 204 No Content on success. No response body.
Error responses
| Status | Code | Reason |
|---|---|---|
400 | VALIDATION_ERROR | Missing required field or invalid value |
401 | UNAUTHORIZED | Missing or invalid API key |
403 | FORBIDDEN | Key does not have access to this resource |
404 | NOT_FOUND | Assignment ID does not exist |
409 | CONFLICT | Operation not allowed in current assignment status |
{
"error": "Validation failed",
"details": {
"connectionId": ["This value should not be blank."],
"type": ["The value 'clip' is not a valid content type."]
}
}For a full guide on handling errors and retries, see Error Handling.
See also
- Publishing guide — end-to-end walkthrough of the assignment lifecycle
- Connections — list your channel connections and get
connectionIdvalues - Platform Capabilities — accepted
payloadfields per platform and content type - Webhooks guide — how to receive and verify status-change callbacks
- Webhook deliveries — inspect delivery history for your
callbackUrl