API REFERENCE
Create post
On this page
/api/postsPublish a video with its copy to one connected social account, now or at a set time. Send one request per target account; to post the same video to several platforms, call this once per platform.
Without publish_at the post starts publishing immediately and is returned as publishing. With publish_at (a time in the future) it is returned as scheduled, starts publishing at that time, and can be cancelled until then with Cancel Post. Either way this returns 202 right away: poll Get Post until status is posted, failed or cancelled.
The platform must already be connected for the artist in artist_account_id, or for the account itself when it is omitted (see Authorize Connector). Copy uses one shape for every platform. Which fields each platform uses, and their limits:
| Platform | title | description | cover_url | privacy, tags |
|---|---|---|---|---|
youtube | required, video title, max 100 characters | video description, max 5,000 characters | not used (YouTube picks the frame) | used |
instagram | not used | required, Reel caption, max 2,200 characters | Reel cover image | not used |
x | not used | required, post text, max 280 weighted characters (URLs count as 23) | not used | not used |
linkedin | video title shown on the post | required, post commentary, max 3,000 characters | video thumbnail | not used |
Limits are checked here, so an over-length body fails with 400 instead of at publish time.
Recoup applies no rate limit of its own to this endpoint. Each platform enforces its own caps, and a post over one ends failed with the platform's message in error_message:
| Platform | Cap |
|---|---|
instagram | 100 API-published posts per account per 24 hours |
x | the X API's per-app and per-user posting limits |
youtube | the daily YouTube Data API upload quota of the connected Google project |
linkedin | LinkedIn's daily per-member and per-organization API limits |
Each post costs $0.01, charged to the account the post is made in (account_id, or the calling account when omitted), never to the artist. The balance is checked here, so an account without enough credits gets 402 and no post is created. The charge is made only when the post reaches posted: a post that ends failed or cancelled is never charged. A scheduled post is checked against the balance when it is created and charged when it goes live.
Authentication
x-api-key in header
bearerAuth bearer
Request
curl --request POST \
--url 'https://api.recoupable.dev/api/posts' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"platform": "instagram",
"video_url": "string"
}'Try it
Fill in the fields, send the request from your browser, and read the live response. The curl below updates as you type.
Kept in this browser tab only and cleared when it closes.
curl --request POST \
--url 'https://api.recoupable.dev/api/posts' \
--header 'Content-Type: application/json' \
--data '{
"platform": "instagram",
"video_url": "string"
}'Request body required
application/json
account_idstringOptional. The account the post is made in and charged to. Defaults to the calling account; org admins can pass another account in their organization. Must not be an artist: pass the artist as artist_account_id.
format: uuid
artist_account_idstringOptional. The artist, within the account, whose connected social account posts. The account must have access to the artist. Defaults to the account's own connection. The artist is never charged.
format: uuid
platformstring · enumrequiredTarget platform. The account must have this platform connected.
Values: "instagram", "x", "linkedin", "youtube"
sub_account_idstringOptional, LinkedIn only. Organization URN to post as a Page (e.g. urn:li:organization:101127186) instead of as the connected member. The connected member must be an admin of that Page.
video_urlstringrequiredPublicly reachable URL of the video file (MP4). It is fetched at publish time, so it must still resolve then.
format: uri
cover_urlstringOptional. Publicly reachable image URL used as the cover or thumbnail where the platform supports one (see the table in the description).
format: uri
titlestringTitle. Required for youtube; see the table in the description.
descriptionstringBody text: caption, post text or description, depending on the platform. Required for instagram, x and linkedin.
privacystring · enumOptional, YouTube only. Visibility after upload.
Values: "public", "unlisted", "private"
Default: "public"
tagsarray<string>Optional, YouTube only. Video tags.
Item properties for tags
string
publish_atstringOptional. ISO 8601 time to publish, with a timezone (Z or an offset), in the future. Omit to publish now.
format: date-time
Responses
202Post accepted: publishing now, or scheduled for publish_at.+
Locationresponse headerURL of the created post.
application/json
statusstring · enumrequiredLifecycle phase. scheduled until publish_at, publishing while the platform upload runs, then posted or failed. cancelled only from scheduled.
Values: "scheduled", "publishing", "posted", "failed", "cancelled"
400Validation failed: a missing or unknown field, a field the platform requires (YouTube title; Instagram, X and LinkedIn description), a body over the platform's limit, a publish_at that is not a date-time with a timezone or is not in the future, or an account_id that is an artist (pass it as artist_account_id). missing_fields names the first offending field.+
application/json
statusstring · enumrequiredAlways error
Values: "error"
missing_fieldsarray<one of>JSON path segments to the first field that failed validation, e.g. ["description"]
Item properties for missing_fields
oneOf · string 1
string
oneOf · integer 2
integer
errorstringrequiredHuman-readable error message
401Unauthorized. Provide exactly one of x-api-key or Authorization: Bearer.+
application/json
statusstring · enumrequiredAlways error
Values: "error"
missing_fieldsarray<one of>JSON path segments to the first field that failed validation, e.g. ["description"]
Item properties for missing_fields
oneOf · string 1
string
oneOf · integer 2
integer
errorstringrequiredHuman-readable error message
402Insufficient credits: the account has less than the $0.01 a post costs. No post is created and nothing is sent to the platform.+
application/json
errorstring · enumrequiredValues: "insufficient_credits"
remaining_creditsintegerrequiredExample: 0
required_creditsintegerrequiredExample: 250000
billingUrlstringrequiredStatic link to the Recoup app, where a human can save a card and buy credits. It is a constant, not a freshly minted Stripe Checkout Session, so a credit-gated endpoint that keeps returning 402 creates nothing. To buy credits programmatically, call POST /api/credits/sessions.
Example: "https://app.recoupable.dev"
403Access denied to the specified account_id, or the account has no access to the artist_account_id.+
application/json
statusstring · enumrequiredAlways error
Values: "error"
missing_fieldsarray<one of>JSON path segments to the first field that failed validation, e.g. ["description"]
Item properties for missing_fields
oneOf · string 1
string
oneOf · integer 2
integer
errorstringrequiredHuman-readable error message
409The platform is not connected for the artist in artist_account_id (or for the account when it is omitted). Authorize it via Authorize Connector before retrying.+
application/json
statusstring · enumrequiredAlways error
Values: "error"
missing_fieldsarray<one of>JSON path segments to the first field that failed validation, e.g. ["description"]
Item properties for missing_fields
oneOf · string 1
string
oneOf · integer 2
integer
errorstringrequiredHuman-readable error message
500Internal server error.+
application/json
statusstring · enumrequiredAlways error
Values: "error"
missing_fieldsarray<one of>JSON path segments to the first field that failed validation, e.g. ["description"]
Item properties for missing_fields
oneOf · string 1
string
oneOf · integer 2
integer
errorstringrequiredHuman-readable error message
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download social.jsonView operation source
{
"operationId": "postPosts",
"summary": "Create post",
"description": "Publish a video with its copy to **one** connected social account, now or at a set time. Send one request per target account; to post the same video to several platforms, call this once per platform.\n\nWithout `publish_at` the post starts publishing immediately and is returned as `publishing`. With `publish_at` (a time in the future) it is returned as `scheduled`, starts publishing at that time, and can be cancelled until then with [Cancel Post](/api-reference/publishing/cancel). Either way this returns **202** right away: poll [Get Post](/api-reference/publishing/get) until `status` is `posted`, `failed` or `cancelled`.\n\nThe platform must already be connected for the artist in `artist_account_id`, or for the account itself when it is omitted (see [Authorize Connector](/api-reference/connectors/authorize)). Copy uses one shape for every platform. Which fields each platform uses, and their limits:\n\n| Platform | `title` | `description` | `cover_url` | `privacy`, `tags` |\n|---|---|---|---|---|\n| `youtube` | **required**, video title, max 100 characters | video description, max 5,000 characters | not used (YouTube picks the frame) | used |\n| `instagram` | not used | **required**, Reel caption, max 2,200 characters | Reel cover image | not used |\n| `x` | not used | **required**, post text, max 280 weighted characters (URLs count as 23) | not used | not used |\n| `linkedin` | video title shown on the post | **required**, post commentary, max 3,000 characters | video thumbnail | not used |\n\nLimits are checked here, so an over-length body fails with 400 instead of at publish time.\n\nRecoup applies no rate limit of its own to this endpoint. Each platform enforces its own caps, and a post over one ends `failed` with the platform's message in `error_message`:\n\n| Platform | Cap |\n|---|---|\n| `instagram` | 100 API-published posts per account per 24 hours |\n| `x` | the X API's per-app and per-user posting limits |\n| `youtube` | the daily YouTube Data API upload quota of the connected Google project |\n| `linkedin` | LinkedIn's daily per-member and per-organization API limits |\n\nEach post costs **$0.01**, charged to the account the post is made in (`account_id`, or the calling account when omitted), never to the artist. The balance is checked here, so an account without enough credits gets **402** and no post is created. The charge is made only when the post reaches `posted`: a post that ends `failed` or `cancelled` is never charged. A scheduled post is checked against the balance when it is created and charged when it goes live.",
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreatePostRequest"
}
}
}
},
"responses": {
"202": {
"description": "Post accepted: publishing now, or scheduled for `publish_at`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreatePostResponse"
}
}
},
"headers": {
"Location": {
"schema": {
"type": "string"
},
"description": "URL of the created post."
}
}
},
"400": {
"description": "Validation failed: a missing or unknown field, a field the platform requires (YouTube `title`; Instagram, X and LinkedIn `description`), a body over the platform's limit, a `publish_at` that is not a date-time with a timezone or is not in the future, or an `account_id` that is an artist (pass it as `artist_account_id`). `missing_fields` names the first offending field.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PostErrorResponse"
}
}
}
},
"401": {
"description": "Unauthorized. Provide exactly one of `x-api-key` or `Authorization: Bearer`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PostErrorResponse"
}
}
}
},
"402": {
"description": "Insufficient credits: the account has less than the $0.01 a post costs. No post is created and nothing is sent to the platform.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SocialInsufficientCreditsResponse"
}
}
}
},
"403": {
"description": "Access denied to the specified `account_id`, or the account has no access to the `artist_account_id`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PostErrorResponse"
}
}
}
},
"409": {
"description": "The `platform` is not connected for the artist in `artist_account_id` (or for the account when it is omitted). Authorize it via [Authorize Connector](/api-reference/connectors/authorize) before retrying.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PostErrorResponse"
}
}
}
},
"500": {
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PostErrorResponse"
}
}
}
}
}
}