Write captions

Write captions with the Wavegrain Posting API: POST /api/v1/captions. Request body, responses and an example request.

POST /api/v1/captions is part of the Posting API. Every call needs an access key: see Authentication.

Needs the generate permission.

One caption per network you name, from a topic, your own text, or both, in your brand's voice (brandId, or your active brand). Each caption fits that network's length limit, and Instagram's hashtag limit.

Costs 1 credit per request, counted against the access key's daily credit limit, at most 200 requests in any 24 hours per account; a request that fails is refunded. Nothing is posted: use the captions in POST /api/v1/posts.

Request body

FieldTypeRequiredNotes
topicstringnoWhat the post is about.
textstringnoYour own text to turn into captions, such as a draft or the words on your images.
networks"tiktok" | "instagram" | "facebook" | "threads" | "youtube" | "linkedin" | "pinterest"[]yesThe networks to write a caption for.
brandIdstringnoWrite in this brand's voice; one of your brands from GET /api/v1/accounts.
emoji"none" | "auto" | "expressive"nonone, auto or expressive.

Example request

curl -X POST https://wavegrain.com/api/v1/captions \
  -H "Authorization: Bearer $WAVEGRAIN_KEY" -H "Content-Type: application/json" \
  -d '{"topic":"Three ways to keep rice fluffy","networks":["instagram","threads"],"emoji":"auto"}'

Responses

StatusMeaning
200One caption per network.
400The body is not valid; details names the field.
401No access key, or an unknown, revoked or expired one
402Not enough credits.
403The key lacks the permission or was revoked during the request, the account has no active plan, or its credits are on hold (credits_on_hold).
404No such brand of yours.
429Too many requests for the key or the account, the key's or the account's daily credit limit, or 200 captions in 24 hours.
500Something went wrong on Wavegrain's side; try again, and send the request id if it keeps failing.
503The captions could not be written; nothing was charged.

A successful answer:

{
  "captions": {
    "instagram": "Three ways to keep rice fluffy, every time. Which one do you use? #ricetips #cooking",
    "threads": "Three ways to keep rice fluffy. Number two changed my week."
  },
  "creditsCharged": 1
}

More in the Posting API

Something wrong or missing? Write to support@wavegrain.com.