Skip to main content
Hedra Up

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.

  1. Sign in to Hedra Up and open Settings → Developers (/app/settings/developers).
  2. Click Create key and give it a recognizable name (for example Production Server).
  3. Pick scopes. By default only read scopes are selected (channels:read, posts:read). Turn on posts:write and media:write only if your system creates posts or uploads files.
  4. Pick an expiry (30, 90 or 365 days; 90 by default). Keys that never expire are still available but not recommended.
  5. 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) on POST /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 conflict with Retry-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.

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): PUT the whole file to uploadUrl with the same Content-Type you declared.
  • mode: "multipart" (files over 100 MB): split the file into chunks of partSize bytes, PUT each chunk to the matching parts[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 returns 400 bad_request.
  • mode and scheduled_at must agree, otherwise you get 422 validation_failed (errors[].path = "scheduled_at"):
modescheduled_atResult
draftomitSaved as draft
schedulerequiredScheduled
publish_nowomitPublished within the request
omittedsetScheduled
omittedomitSaved as draft
  • scheduled_at: ISO-8601 with offset, for example 2026-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 in scheduled_at.
  • external_id: your reconciliation id (1–191 characters). It must not match a post that is draft, scheduled, publishing or published. A match returns 409 duplicate_post with existing_post_id. Failed or cancelled posts can be resent.
  • callback_url: a public HTTPS URL. Hedra Up sends a POST once when the final result is known and does not retry. Always reconcile with GET /v1/posts/{id}.
  • metadata: JSON object up to 8 KiB (UTF-8 bytes). Larger returns 422.
  • media: array of files. Each item has type (image or video) and exactly one source: url, path or drive_file_id.
  • targets: per-channel options. Required for every TikTok channel when scheduling or publishing now.
  • targets[].options for TikTok: mode (direct or inbox), title (up to 2200 characters for video, 90 for photos), description (up to 4000), privacy_level (required for direct: 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 be 2026-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.statusMeaning
queuedWaiting for its turn
publishingPublishing on at least one channel
publishedEvery channel published
partialSome channels published, some failed. See targets[]. Do not recreate the whole post, or it will be duplicated on the channels that succeeded
failedEvery channel failed
cancelledNo 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 or Z.
  • limit: 1–100, default 20.
  • cursor: pass next_cursor from the previous page unchanged. It is opaque; do not build it yourself. An invalid cursor returns 422.
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_ids or drive_file_id returns 422 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 get 409 edit_window_closed or post_publishing.
  • Pause: a payload of only { "scheduled_paused": true } is allowed even inside the 10-minute window, as long as publishing has not started. Send false to 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 become skipped.
  • Cancelling again returns 200 with idempotent: 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 /v1 endpoint.

Going over returns 429 rate_limited with Retry-After. Responses include RateLimit-Limit and RateLimit-Policy.

File size

PlanChannelsMax per fileAPI keys
Free350 MB—
Creator5500 MB—
Pro151 GB—
Business402 GB3
Agency 1001002 GB3

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"
}
HTTPcodeMeaning and what to do
400bad_requestMalformed input, or a channel that is not yours (see errors).
401unauthorizedKey missing, invalid, expired or revoked.
403forbiddenThe key lacks the scope this endpoint needs.
403plan_requiredYour account is no longer on a plan with API access. Upgrade to continue.
404not_foundPost or resource not found.
405method_not_allowedWrong HTTP method.
409conflictState conflict, a request with the same Idempotency-Key is still running, or multipart assembly failed.
409idempotency_conflictIdempotency-Key reused with a different payload.
409duplicate_postAn active post already has this external_id, or the same media and channel. See existing_post_id.
409edit_window_closedWithin 10 minutes of the publish time.
409post_publishingThe post or a channel is publishing.
409drive_file_unavailableThe Drive file is gone, in the trash, or no longer accessible.
409drive_file_mismatchThe Drive file does not match expected_*.
409media_too_largeThe Drive file exceeds your plan's size limit.
413quota_exceededThe upload exceeds your plan's size limit (see max_mb).
422validation_failedInvalid input. Details in errors[].path and errors[].message.
422media_immutablePATCH included media or channels.
429rate_limitedToo many requests. Wait for Retry-After.
500internalServer 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