Developers
Krevaya API quickstart
Authenticate with the Krevaya API, read your draft queue, and create your first reviewable social post with curl, JavaScript, or Python.
Updated
Choose an integration
Use REST for HTTP workflows, MCP for an AI assistant that needs tools, or the GraphQL beta for querying posts and creating drafts. All three use the same account permissions and request budget. API, MCP, and webhook access starts with the Essentials plan. Generating with Krevaya AI through them needs Plus or higher.
| Need | Use | Endpoint |
|---|---|---|
| Create drafts, read and schedule posts, import media, repurpose a source | REST | https://api.krevaya.com/v1 |
| Approve or edit existing posts, edit creations, poll jobs | MCP tools | https://api.krevaya.com/mcp |
| Select post fields in a typed query | GraphQL beta | https://api.krevaya.com/graphql |
| Receive publication outcomes | REST event feed polled with a key, or signed webhooks set up through Krevaya support | https://api.krevaya.com/v1/automation/events, or your public HTTPS endpoint |
Create a key and check the connection
Sign in to Krevaya, verify your email, then open Settings → API keys & MCP. Create a read-only key for your first request. Copy the secret when it appears; the key list shows its prefix afterward. Store it in your local secret manager or environment, never in a browser bundle or repository.
# Set KREVAYA_API_KEY in your shell or secret manager first.
curl --fail-with-body https://api.krevaya.com/v1/me \
-H "Authorization: Bearer $KREVAYA_API_KEY"A successful response contains email, plan, and scopes. A 401 means the credential is missing, invalid, revoked, or expired. A 403 means the credential is valid but the plan or requested scope does not allow the operation.
Read the draft queue
curl --fail-with-body --get https://api.krevaya.com/v1/posts \
-H "Authorization: Bearer $KREVAYA_API_KEY" \
--data-urlencode 'status_filter=draft' \
--data-urlencode 'limit=25'This returns an array of posts for the dashboard's selected brand. For a production integration, resolve the intended brand with GET /v1/brands (or the MCP list_brands tool) and pass its id as brand_id. The list limit is clamped to 1–100. This endpoint has no cursor parameter.
Create a draft with JavaScript
Use a key with the publish scope. Set KREVAYA_BRAND_ID to the brand's numeric ID string, obtained from GET /v1/brands. This example creates one LinkedIn draft. It omits schedule_at, so it does not schedule the post.
// Node.js 20+, saved as create-draft.mjs
const key = process.env.KREVAYA_API_KEY;
const brandId = process.env.KREVAYA_BRAND_ID;
if (!key || !brandId) throw new Error('Set KREVAYA_API_KEY and KREVAYA_BRAND_ID');
const response = await fetch('https://api.krevaya.com/v1/posts', {
method: 'POST',
headers: { Authorization: `Bearer ${key}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
platform: 'linkedin',
body: 'Our workshop now has a repair intake checklist. It helps us agree on the problem before ordering parts.',
brand_id: brandId,
}),
});
const result = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${JSON.stringify(result)}`);
console.log(result); // id, platform, kind, status, media_count, scheduled_atRead drafts with Python
import json
import os
import urllib.request
request = urllib.request.Request(
'https://api.krevaya.com/v1/posts?status_filter=draft&limit=10',
headers={'Authorization': 'Bearer ' + os.environ['KREVAYA_API_KEY']},
)
with urllib.request.urlopen(request, timeout=30) as response:
posts = json.load(response)
for post in posts:
print(post['id'], post['platform'], post['status'])Review the draft in Krevaya before scheduling it. An external integration should record the returned post ID and its own source record ID together, so a later retry can find the existing draft.
Frequently asked questions
Which plan includes Krevaya’s API?
API and MCP access starts with Essentials. Krevaya checks entitlement on every request, including requests made with an existing key. On Essentials, which has no Krevaya AI, the operations that generate with it are refused, and MCP does not list those tools.
Does creating a post publish it immediately?
POST /v1/posts creates a draft when schedule_at is omitted. Supplying a future schedule_at creates a scheduled post, which can publish at that time. Pinterest, TikTok, Tumblr and YouTube posts are the exception: they are always created as drafts, and a person approves each one in Krevaya. If the brand's Publish mode is Auto, Krevaya can later approve a draft created this way on its own; drafts from POST /v1/automation/drafts always wait for a person.