Post to TikTok now or on schedule. API‑first; minimal UI.
Authorization: Bearer <key>.Create a posting job.
| Field | Type | Required | Description |
|---|---|---|---|
| mode | "now" | "schedule" | yes | Immediate or scheduled publish. |
| schedule_at | ISO 8601 | if mode="schedule" | UTC timestamp within plan limits (Free: 3 days; Paid: 30 days). |
| title | string | no | Optional title. |
| video.source | "pm3k_storage" | "url" | yes | Storage key (PM3K) or pull‑from‑URL. |
| video.storage_key | string | if source="pm3k_storage" | Key returned by PM3K upload (e.g., pm3k/123.mp4). |
| video.url | string | if source="url" | Must be under a Verified‑URL you own (paid plans). |
Plan constraints:
video.source = "pm3k_storage". Using "url" returns 400 SOURCE_NOT_ALLOWED_FOR_PLAN."pm3k_storage" or "url" (after your domain is verified).curl -i -X POST 'https://api.pm3k.dev/v1/creators/123/jobs' -H 'Authorization: Bearer FREE_KEY' -H 'Content-Type: application/json' -d '{ "mode": "now", "video": { "source": "pm3k_storage", "storage_key": "pm3k/123.mp4" } }'
curl -i -X POST 'https://api.pm3k.dev/v1/creators/123/jobs' -H 'Authorization: Bearer FREE_KEY' -H 'Content-Type: application/json' -d '{ "mode": "now", "video": { "source": "url", "url": "https://media.client.com/v.mp4" } }'
# → 400 SOURCE_NOT_ALLOWED_FOR_PLAN
curl -i -X POST 'https://api.pm3k.dev/v1/creators/123/jobs' -H 'Authorization: Bearer PAID_KEY' -H 'Content-Type: application/json' -d '{ "mode": "schedule", "schedule_at": "2025-11-20T10:00:00Z",
"video": { "source": "url", "url": "https://media.client.com/v.mp4" } }'
# Missing video.source
curl -i -X POST 'https://api.pm3k.dev/v1/creators/123/jobs' -H 'Authorization: Bearer FREE_KEY' -H 'Content-Type: application/json' -d '{"mode":"now","video":{}}' # → 400 INVALID_REQUEST
# Missing storage_key for pm3k_storage
curl -i -X POST 'https://api.pm3k.dev/v1/creators/123/jobs' -H 'Authorization: Bearer FREE_KEY' -H 'Content-Type: application/json' -d '{"mode":"now","video":{"source":"pm3k_storage"}}' # → 400 MISSING_STORAGE_KEY
# Missing url for source=url (paid)
curl -i -X POST 'https://api.pm3k.dev/v1/creators/123/jobs' -H 'Authorization: BearER PAID_KEY' -H 'Content-Type: application/json' -d '{"mode":"now","video":{"source":"url"}}' # → 400 MISSING_URL
Fetch job status. Returns { id, status, error? }. Status flow: INIT → VALIDATING → SCHEDULED → PUBLISHING → COMPLETE | FAILED.
curl -s 'https://api.pm3k.dev/v1/jobs/abcd-1234' -H 'Authorization: Bearer <KEY>'
Register your webhook to receive final job events. We forward TikTok outcomes to your endpoint.
curl -i -X POST 'https://api.pm3k.dev/v1/webhooks' -H 'Authorization: Bearer <KEY>' -H 'Content-Type: application/json' -d '{"url":"https://example.com/pm3k/webhook"}'
Security: verify our signature header (to be documented).
| Code | HTTP | Description |
|---|---|---|
| INVALID_REQUEST | 400 | Missing/invalid fields. |
| SOURCE_NOT_ALLOWED_FOR_PLAN | 400 | Free plan tried to use video.source="url". |
| MISSING_STORAGE_KEY | 400 | storage_key required for pm3k_storage. |
| MISSING_URL | 400 | url required for source=url. |