Skip to content

Idempotency

Networks time out and scripts retry. Send an Idempotency-Key on POST /workspaces/{id}/posts and a retry can never create a second post.

Terminal window
curl -X POST https://www.socialpublishai.com/social-publish/api/public/v1/workspaces/42/posts \
-H "Authorization: Bearer agp_…" \
-H "Idempotency-Key: 6f1c2a9e-week45-monday" \
-H "Content-Type: application/json" \
-d '{ "body": "Fresh bread!", "targets": [{ "socialAccountId": 7 }, { "socialAccountId": 9 }] }'
You send You get
Same key + same body The same post again (no duplicate)
Same key + a different body 422
A new key A new post

Keys are remembered for 24 hours. Use a random UUID, or a stable id from your own system.