DocumentationAPI reference

API reference

v1

One predictable contract for accounts, posts, comments, and delivery events.

Base URL
https://castrook.com/api/v1

Requests and responses use JSON with snake_case fields. Every response includes x-request-id. Dates use ISO 8601 with an explicit timezone.

Endpoints

GET/accountsList accounts
POST/accountsCreate a test account
DELETE/accounts/{id}Disconnect account
GET/accounts/{id}/publishing-optionsGet TikTok creator settings
GET/postsList posts
POST/postsCreate or schedule a post
GET/posts/{id}Get post and targets
DELETE/posts/{id}Cancel a pending post
GET/commentsList comments
POST/commentsReply to a comment
GET/webhooksList endpoints
POST/webhooksCreate an endpoint
DELETE/webhooks/{id}Disable endpoint
GET/deliveriesList webhook deliveries
GET/logsList request logs

Download the complete OpenAPI specification for all schemas, response codes, and query parameters.

Create a post

POST /posts requires an Idempotency-Key header. A new post returns HTTP 202; an identical replay returns HTTP 200 and Idempotency-Replayed: true.

FieldTypeDescription
textstringPost caption. Maximum 5,000 characters; platform limits also apply.
account_idsstring[]One or more account IDs in the same workspace and mode.
mediaobject · optional{ url, type }. HTTPS URL and video or image. Required for video-first platforms.
scheduled_atstring · optionalISO 8601 timestamp at least 5 seconds in the future, up to 1 year ahead.
platform_optionsobject · optionalPlatform-specific visibility, consent, and publishing choices
JSON
{
  "text": "Made to be shared.",
  "account_ids": ["acc_instagram", "acc_youtube"],
  "media": {
    "url": "https://your-cdn.com/launch.mp4",
    "type": "video"
  },
  "platform_options": {
    "youtube": {
      "privacy_status": "private",
      "made_for_kids": false
    }
  }
}

The post response

JSON
{
  "data": {
    "id": "pst_example",
    "text": "Made to be shared.",
    "status": "queued",
    "mode": "test",
    "scheduled_at": null,
    "created_at": "2026-09-26T12:00:00.000Z",
    "updated_at": "2026-09-26T12:00:00.000Z",
    "targets": [
      {
        "account_id": "acc_instagram",
        "platform": "instagram",
        "status": "queued",
        "attempts": 0
      }
    ]
  }
}

Targets can include provider_post_id, url, or an error object when the platform provides them. A successful private post may have no public URL.

Pagination and filtering

List responses return data plus meta.next_cursor and meta.has_more. Pass the next cursor unchanged. Posts support status, platform, q, cursor, and limit filters.

JSON
{
  "data": [],
  "meta": { "next_cursor": null, "has_more": false }
}