REST API (/v1) quickstart
Create an API key, check it with /v1/me, find your brand ID, and create your first draft with curl
Written by the Krevaya team · Updated
Krevaya's REST API lives at https://api.krevaya.com/v1. It uses the same review queue, safety screening, and plan limits as the app. This quickstart takes you from a new key to your first draft; the endpoint reference lists every route.
Before you start
- API access is included with Plus and up. Krevaya checks your plan on every request.
- Verify your email address. You need a verified account to create a key.
- You can have up to 10 active keys.
1. Create a key
- Open Settings → API keys & MCP.
- Under Name your key, enter a name such as "My script".
- Under Choose what it can do, pick AI assistant, or open Adjust individual permissions and select View content and Create & publish posts.
- Select Create API key, then Copy API key. The key starts with
krv_and is shown only once.
Store the key in a secret manager or environment variable, never in a browser app or a repository.
| Scope | Label in Krevaya | Allows |
|---|---|---|
read | View content | Read posts, brands, Lineups, media, brand memory |
publish | Create & publish posts | Create, edit, approve, and schedule posts |
generate | Generate content | Turn a link or text into drafts; uses AI credits |
media | Manage media | Import, upload, and delete library media |
engage | Reply to comments & DMs | Send replies and DMs as you |
draft | Create review drafts | Only automation drafts (see the n8n and Make article) |
Creating posts with POST /v1/posts needs publish, which can also schedule. If your integration should only ever create drafts, use a Drafts for review key with the automation drafts endpoint instead.
2. Check the key
curl https://api.krevaya.com/v1/me \
-H "Authorization: Bearer YOUR_API_KEY"
A working key returns your email, plan, and scopes. A 401 means the key is missing, wrong, or revoked. A 403 means the key is valid but your plan or its permissions don't allow the call. X-API-Key: YOUR_API_KEY also works as the header.
3. Find your brand ID
curl https://api.krevaya.com/v1/brands \
-H "Authorization: Bearer YOUR_API_KEY"
Copy the id of the brand you want. Keep IDs as strings: they can exceed the safe integer range in JavaScript and spreadsheets. If you leave brand_id out, requests use the brand selected in the app. Brands another account shared with you aren't listed.
4. Create a draft
curl -X POST https://api.krevaya.com/v1/posts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"platform": "linkedin", "body": "Three questions we ask before every repair estimate.", "brand_id": "YOUR_BRAND_ID"}'
A 201 response returns id, platform, kind, status (draft), media_count, and scheduled_at (null).
Useful fields:
platformorlineup: send exactly one.lineuptakes a saved Lineup's name or id (GET /v1/lineups) and creates one post per connected channel in it.kind:text,image,carousel,reel, orstory. Left out, Krevaya infers it fromasset_ids. A Story is never inferred.asset_ids: library media in display order. Upload it first with/v1/assets.schedule_at: a future ISO-8601 time withZor an offset schedules the post instead of drafting it. Leave it out to get a draft. Pinterest and Tumblr posts are always drafts that you approve in Krevaya.hashtags, andfirst_comment(Facebook, Instagram, Threads, LinkedIn).- An
Idempotency-Keyheader (withbrand_id) makes retries safe: repeating the same request returns the original post instead of a duplicate.
5. Find it in Krevaya
Your bell shows "Your AI added drafts", and the draft waits in Posts for review. If the brand's Publish mode (Settings → Publishing) is Auto, Krevaya can approve API drafts on its own. Choose Review to keep every post waiting for you.
If something fails
- 422 with a sentence such as "X takes at most 280 characters, and this text has 312. Shorten it to post on X." Krevaya refuses text over the channel's limit instead of cutting it: X 280, Bluesky 300, Threads 500, LinkedIn 3,000. Any post's text is capped at 4,000 characters.
- 409: another post from the same account on that platform already holds that minute. Pick another time.
- 403: a missing permission, your plan, or a Pinterest or Tumblr approval, which only a person in Krevaya can give.