Your first post
v1From API key to delivery state. Start in test mode, where accounts and publishing are safely simulated.
Test-mode publishing never creates a real social post. The public interactive demo is a separate, browser-local workspace.
Create a test key
Create a workspace, leave it in test mode, and open Developers → Create API key. Enable accounts:read, accounts:write, posts:read, and posts:write. Store the key in your server environment.
export CASTROOK_API_KEY="cr_test_your_key"Add a test account
Test accounts simulate the platform’s publishing lifecycle. Save the returned account ID.
curl -X POST https://castrook.com/api/v1/accounts \
-H "Authorization: Bearer $CASTROOK_API_KEY" \
-H "Content-Type: application/json" \
-d '{"platform":"instagram","name":"My test account"}'Using TypeScript? Install the SDK first. For real accounts, switch to live mode and connect through the dashboard.
Create your first post
Replace the account ID below. Keep the same idempotency key when retrying this exact request.
curl -X POST https://castrook.com/api/v1/posts \
-H "Authorization: Bearer $CASTROOK_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: my-first-post-v1" \
-d '{
"text": "Hello from Castrook.",
"account_ids": ["acc_replace_with_your_account_id"],
"media": {
"type": "video",
"url": "https://your-cdn.com/hello.mp4"
}
}'The API returns 202 Accepted with a post ID and queued status. Acceptance means the post was stored for processing.
Check delivery
curl https://castrook.com/api/v1/posts/pst_your_post_id \
-H "Authorization: Bearer $CASTROOK_API_KEY"Read targets[] for individual platform results. Your post becomes published, partially_failed, or failed after delivery. Subscribe to webhooks to avoid polling.