Customer API Integration
API keys, media upload, creating and tracking posts, limits and error codes for REST API v1.
The Hedra Up Public API v1 lets your systems, internal bots or scripts create posts, schedule them and track results on your connected channels. Platforms you can publish to through the API today: TikTok and YouTube.
1. Get an API key
The API is available on Business and Agency 100.
- Sign in to Hedra Up and open Settings → Developers (
/app/settings/developers). - Click Create key and give it a recognizable name (for example
Production Server). - Pick scopes. By default only read scopes are selected (
channels:read,posts:read). Turn onposts:writeandmedia:writeonly if your system creates posts or uploads files. - Pick an expiry (30, 90 or 365 days; 90 by default). Keys that never expire are still available but not recommended.
- Copy the key starting with
hu_live_right away.
The key is shown only once. Hedra Up stores only its hash, never the key itself. If your account has two-step verification on, you need to complete the second step before you can create, rotate or revoke keys.
Rotating a key: click Rotate to create a new key with the same name and scopes. The old key keeps working for 24 more hours and then expires, so you can swap keys on your servers without downtime. Expired or revoked keys do not count toward your plan's key limit.
When your plan changes: if your account is no longer on a plan with API access (expired or downgraded), every request returns 403 plan_required. Your keys are kept and start working again when you upgrade.
2. Authentication and headers
Authorization: Bearer <YOUR_API_KEY>
Base URL: https://api.hedraup.com/v1.
X-Request-Id: returned on every response. Include it when you contact support.Idempotency-Key(8–255 characters, kept for 24 hours) onPOST /v1/posts:- Same key and same payload: you get the original response back with
Idempotent-Replay: true, and no new post is created. - Same key with a different payload:
409 idempotency_conflict. - First request still running:
409 conflictwithRetry-After: 5. Wait and retry. - Only successful (2xx) responses are stored. If the first attempt failed (for example 422), fix the request and retry with the same key.
- Same key and same payload: you get the original response back with
3. Endpoints
List channels
curl https://api.hedraup.com/v1/channels \
-H "Authorization: Bearer <YOUR_API_KEY>"
Upload media
Every attachment must be your own account's file: a file uploaded through POST /v1/media/upload, a Google Drive file (drive_file_id), or a URL on your own R2 bucket connected in Hedra Up. Any other URL is rejected with 422 validation_failed (errors[].path is media[i].url or media[i].path).
Step 1. Request an upload ticket (scope media:write):
curl -X POST https://api.hedraup.com/v1/media/upload \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{ "size": 10485760, "type": "video/mp4", "ext": "mp4" }'
Files above your plan's size limit return 413 quota_exceeded with max_mb.
Step 2. Upload according to mode in the response:
mode: "single"(files up to 100 MB):PUTthe whole file touploadUrlwith the sameContent-Typeyou declared.mode: "multipart"(files over 100 MB): split the file into chunks ofpartSizebytes,PUTeach chunk to the matchingparts[n].uploadUrl, then assemble it:
curl -X POST https://api.hedraup.com/v1/media/upload/complete \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{ "key": "<key>", "upload_id": "<uploadId>", "size": 314572800 }'
Missing parts or a size mismatch return 409 conflict and the ticket is aborted; request a new ticket and upload again.
Step 3. Use publicUrl as media[].url when you create the post.
Create a post
POST /v1/posts (scope posts:write). Main fields:
body: text, up to 10,000 characters.target_channel_ids: array of your channel UUIDs (no duplicates). A channel that is not yours returns400 bad_request.modeandscheduled_atmust agree, otherwise you get422 validation_failed(errors[].path = "scheduled_at"):
mode | scheduled_at | Result |
|---|---|---|
draft | omit | Saved as draft |
schedule | required | Scheduled |
publish_now | omit | Published within the request |
| omitted | set | Scheduled |
| omitted | omit | Saved as draft |
scheduled_at: ISO-8601 with offset, for example2026-11-10T09:00:00+07:00.timezone: IANA time zone stored with the post (defaults to your account setting). The actual publish time always follows the offset inscheduled_at.external_id: your reconciliation id (1–191 characters). It must not match a post that is draft, scheduled, publishing or published. A match returns409 duplicate_postwithexisting_post_id. Failed or cancelled posts can be resent.callback_url: a public HTTPS URL. Hedra Up sends aPOSTonce when the final result is known and does not retry. Always reconcile withGET /v1/posts/{id}.metadata: JSON object up to 8 KiB (UTF-8 bytes). Larger returns422.media: array of files. Each item hastype(imageorvideo) and exactly one source:url,pathordrive_file_id.targets: per-channel options. Required for every TikTok channel when scheduling or publishing now.targets[].optionsfor TikTok:mode(directorinbox),title(up to 2200 characters for video, 90 for photos),description(up to 4000),privacy_level(required fordirect:PUBLIC_TO_EVERYONE,MUTUAL_FOLLOW_FRIENDS,FOLLOWER_OF_CREATOR,SELF_ONLY),allow_comment,allow_duet,allow_stitch,is_aigc,commercial{ enabled, your_brand, branded_content },consent_at(ISO-8601),consent_text_version(must be2026-10-11).
For Google Drive you can add expected_sha256 (64 hex characters), expected_size (bytes) and expected_modified_time (ISO-8601). Hedra Up checks them before publishing; a mismatch returns 409 drive_file_mismatch.
Check without creating: add ?validate_only=true. Hedra Up checks channels, media, options and the TikTok account, then returns 200 { "valid": true } or the matching error. Accepts true/false/1/0; validate_only=false creates the post as usual.
Example: schedule with an uploaded file:
curl -X POST https://api.hedraup.com/v1/posts \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Idempotency-Key: post-20261109-001" \
-H "Content-Type: application/json" \
-d '{
"body": "Our new product launch video!",
"target_channel_ids": ["c0a80123-7b89-4def-0123-456789abcdef"],
"mode": "schedule",
"scheduled_at": "2026-11-10T09:00:00+07:00",
"external_id": "CAMPAIGN-8921",
"metadata": { "campaign": "q4_launch" },
"media": [{ "type": "video", "url": "<publicUrl from the upload step>" }],
"targets": [{
"channel_id": "c0a80123-7b89-4def-0123-456789abcdef",
"options": {
"mode": "direct",
"title": "Our new product launch video!",
"privacy_level": "PUBLIC_TO_EVERYONE",
"allow_comment": true, "allow_duet": true, "allow_stitch": true,
"commercial": { "enabled": false, "your_brand": false, "branded_content": false },
"is_aigc": false,
"consent_at": "2026-11-10T01:30:00.000Z",
"consent_text_version": "2026-10-11"
}
}]
}'
Publish result
GET /v1/posts/{id} returns the post, each channel's status in targets[], and the overall result in data.result:
result.status | Meaning |
|---|---|
queued | Waiting for its turn |
publishing | Publishing on at least one channel |
published | Every channel published |
partial | Some channels published, some failed. See targets[]. Do not recreate the whole post, or it will be duplicated on the channels that succeeded |
failed | Every channel failed |
cancelled | No channel left to publish (cancelled) |
result.counts gives the number of channels total, published and failed. result.external_post_id is the platform post id of the first channel that published (tiktok_post_id is the old name, kept for compatibility).
With mode=publish_now the create response already includes result. If it is still queued or publishing, poll GET /v1/posts/{id} until it reaches a final state.
List posts
GET /v1/posts (scope posts:read), newest first:
status:draft,scheduled,publishing,published,failed,cancelled.external_id,channel_id.scheduled_from/scheduled_to,created_from/created_to: ISO-8601 with an offset orZ.limit: 1–100, default 20.cursor: passnext_cursorfrom the previous page unchanged. It is opaque; do not build it yourself. An invalid cursor returns422.
curl "https://api.hedraup.com/v1/posts?external_id=CAMPAIGN-8921&limit=10" \
-H "Authorization: Bearer <YOUR_API_KEY>"
Edit a scheduled post
PATCH /v1/posts/{id} only changes body, scheduled_at, metadata and scheduled_paused.
- Media and channels cannot change. Sending
media,target_channel_ids,channel_idsordrive_file_idreturns422 media_immutable. Cancel the post and create a new one instead. - 10-minute lock: within 10 minutes of
scheduled_at(or past it), or while the post is publishing, you get409 edit_window_closedorpost_publishing. - Pause: a payload of only
{ "scheduled_paused": true }is allowed even inside the 10-minute window, as long as publishing has not started. Sendfalseto resume.
curl -X PATCH https://api.hedraup.com/v1/posts/<id> \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{ "scheduled_at": "2026-11-10T15:30:00+07:00" }'
Cancel a post
DELETE /v1/posts/{id} or POST /v1/posts/{id}/cancel.
- A draft that was never scheduled is deleted.
- A scheduled post becomes
cancelled, and waiting channels becomeskipped. - Cancelling again returns
200withidempotent: true. - Inside the 10-minute window, while publishing, or once published:
409.
Result callback
When the post reaches a final result, Hedra Up sends one POST to callback_url (5-second timeout, redirects are not followed):
{ "post_id": "3f7a1e20-...", "status": "published", "targets": [{ "channel_id": "...", "status": "published", "external_post_id": "..." }] }
The callback is not signed and is not retried, so treat it as a hint to check; always confirm with GET /v1/posts/{id}.
4. Limits
Request rate
Fixed one-minute windows:
- Per key on Business: 60 requests/minute. On Agency 100: 120 requests/minute.
- Per IP address: 300 requests/minute across every
/v1endpoint.
Going over returns 429 rate_limited with Retry-After. Responses include RateLimit-Limit and RateLimit-Policy.
File size
| Plan | Channels | Max per file | API keys |
|---|---|---|---|
| Free | 3 | 50 MB | — |
| Creator | 5 | 500 MB | — |
| Pro | 15 | 1 GB | — |
| Business | 40 | 2 GB | 3 |
| Agency 100 | 100 | 2 GB | 3 |
A Google Drive file larger than your plan allows returns 409 media_too_large, and Hedra Up does not download it.
5. Error codes
Every error follows RFC 9457 with Content-Type: application/problem+json:
{
"type": "urn:problem:edit_window_closed",
"title": "Edit window closed",
"status": 409,
"detail": "Cannot edit or cancel post within 10 minutes of scheduled publish time.",
"instance": "req_123456",
"code": "edit_window_closed"
}
| HTTP | code | Meaning and what to do |
|---|---|---|
| 400 | bad_request | Malformed input, or a channel that is not yours (see errors). |
| 401 | unauthorized | Key missing, invalid, expired or revoked. |
| 403 | forbidden | The key lacks the scope this endpoint needs. |
| 403 | plan_required | Your account is no longer on a plan with API access. Upgrade to continue. |
| 404 | not_found | Post or resource not found. |
| 405 | method_not_allowed | Wrong HTTP method. |
| 409 | conflict | State conflict, a request with the same Idempotency-Key is still running, or multipart assembly failed. |
| 409 | idempotency_conflict | Idempotency-Key reused with a different payload. |
| 409 | duplicate_post | An active post already has this external_id, or the same media and channel. See existing_post_id. |
| 409 | edit_window_closed | Within 10 minutes of the publish time. |
| 409 | post_publishing | The post or a channel is publishing. |
| 409 | drive_file_unavailable | The Drive file is gone, in the trash, or no longer accessible. |
| 409 | drive_file_mismatch | The Drive file does not match expected_*. |
| 409 | media_too_large | The Drive file exceeds your plan's size limit. |
| 413 | quota_exceeded | The upload exceeds your plan's size limit (see max_mb). |
| 422 | validation_failed | Invalid input. Details in errors[].path and errors[].message. |
| 422 | media_immutable | PATCH included media or channels. |
| 429 | rate_limited | Too many requests. Wait for Retry-After. |
| 500 | internal | Server error. Include instance when contacting support. |
6. Interactive reference
- Try the API:
https://api.hedraup.com/v1/docs - OpenAPI 3.1 spec:
https://api.hedraup.com/v1/openapi.json