Skip to content
KrevayadocsGet help Open Krevaya

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 Plus plan.

NeedUseEndpoint
Create drafts, import media, repurpose a sourceRESThttps://api.krevaya.com/v1
Review and schedule existing posts, edit designs, poll jobsMCP toolshttps://api.krevaya.com/mcp
Select post fields in a typed queryGraphQL betahttps://api.krevaya.com/graphql
Receive publication outcomesSigned webhooksYour public HTTPS endpoint

Create a key and check the connection

Sign in to Krevaya, verify your email, then open Settings → API keys. 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.

bash
# 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

bash
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 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 list_brands. This example creates one LinkedIn draft. It omits schedule_at, so it does not schedule the post.

javascript
// 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_at

Read drafts with Python

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

Can I use Krevaya's API on the Free plan?

API and MCP access starts with Plus. Krevaya checks entitlement on every request, including requests made with an existing key.

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.