Skip to content
Reading with an AI assistant?View as MarkdownOpen in ClaudeOpen in ChatGPT

Get started

Social media API quickstart

Updated

The social media API quickstart takes five minutes: create an API key in Settings → Developer, call GET /v1/agency to prove it works, then send one POST /v1/posts to schedule a post. The REST API uses the API key; the MCP server uses OAuth.

Browse docs

What it does#

Three calls take a new key to a scheduled post: GET /v1/agency proves the key, POST /v1/posts schedules, GET /v1/post-targets/{id} reads the result.

Social media API quickstart steps#

Social media API quickstart steps
StepWhat you doWhat you get
1. Create a keySettings → DeveloperA sked_live_ secret
2. First requestGET /v1/agencyYour workspace profile
3. ComposePOST /v1/postsA scheduled post
4. ConfirmGET /v1/post-targets/:idStatus and permalink

What you need#

  • A workspace on a plan with API access, and the Owner or Manager role.
  • At least one connected social account, and curl or any HTTP client.

Base URLs#

Base URLs
SurfaceURL
REST APIhttps://api.skedcast.com/v1
MCP serverhttps://api.skedcast.com/mcp
OpenAPI spechttps://skedcast.com/openapi.json

1. Create an API key#

In Settings → Developer, create a key with the scopes agency.read, clients.read, accounts.read, posts.compose and posts.read, and copy the secret: it is shown once. Keep it on your server. The scopes reference lists every scope.

Keys start with sked_live_ or sked_test_. Both act on your real workspace.

2. Make your first request#

bash
curl https://api.skedcast.com/v1/agency \
  -H "Authorization: Bearer sked_live_YOUR_KEY"
Fetch your workspace profile.
json
{
  "data": {
    "object": "agency",
    "id": "<workspaceId>",
    "name": "Acme Social",
    "plan": "studio",
    "role": "owner"
  },
  "meta": { "correlationId": "c-74fb602e-…" }
}
Response (abridged): the single-resource envelope.

3. Find the ids#

bash
curl "https://api.skedcast.com/v1/clients?limit=10" -H "Authorization: Bearer sked_live_YOUR_KEY"
curl "https://api.skedcast.com/v1/accounts" -H "Authorization: Bearer sked_live_YOUR_KEY"
A post needs a client id and the connected account ids. Lists answer in the `{ data, page, meta }` envelope; see [pagination](/developers/guides/api-pagination-guide).

4. Schedule a post#

bash
curl -X POST https://api.skedcast.com/v1/posts \
  -H "Authorization: Bearer sked_live_YOUR_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "clientId": "<clientId>", "content": "Hello world", "targets": { "mode": "selection", "accountIds": ["<accountId>"] }, "schedule": { "type": "at", "scheduledAt": "2030-01-15T15:00:00Z" } }'
Every POST, PATCH and DELETE takes an Idempotency-Key, except `POST /posts/preview`.
  • Send the same body to POST /v1/posts/preview first: it validates per platform and writes nothing.
  • Times are UTC ending in Z, or scheduledLocal with a timezone.
  • Attach media by id: see media uploads. Every body field is in the API reference.

5. Confirm the post#

json
{
  "data": {
    "postId": "<postId>",
    "status": "scheduled",
    "targets": [ { "...": "one row per destination" } ],
    "replayed": false
  },
  "meta": { "correlationId": "c-…" }
}
Response (abridged): `201` with one row per destination in `targets`. Read each with `GET /v1/post-targets/{id}`.

Post target statuses#

Post target statuses
StatusWhat it means
draftSaved, not scheduled
scheduledWaiting for its time
native_scheduledHanded to the platform's own scheduler (Facebook and YouTube, only when you ask for native scheduling)
publishedLive; externalId and permalink are filled in once the platform reports them
failedThe attempt failed; requiredAction says whether to retry
canceledCancelled before it published
on_holdWaiting for a reason named in holdReason, such as a platform limit or media still preparing
missedIts time passed without a publish; reschedule it

The same calls in TypeScript#

ts
const API = "https://api.skedcast.com/v1";
const headers = { Authorization: `Bearer ${process.env.SKEDCAST_API_KEY}`, "Content-Type": "application/json" };

// 1. Prove the key works.
const agency = await fetch(`${API}/agency`, { headers }).then((r) => r.json());
console.log(agency.data.name);

// 2. Schedule a post. A new Idempotency-Key per new post.
const res = await fetch(`${API}/posts`, {
  method: "POST",
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID() },
  body: JSON.stringify({
    clientId: "<clientId>",
    content: "Hello world",
    targets: { mode: "selection", accountIds: ["<accountId>"] },
    schedule: { type: "at", scheduledAt: "2030-01-15T15:00:00Z" },
  }),
});
if (!res.ok) throw new Error(JSON.stringify(await res.json())); // an RFC 9457 problem document

// 3. Read it back.
const { data } = await res.json();
const post = await fetch(`${API}/posts/${data.postId}`, { headers }).then((r) => r.json());
console.log(post.data);
Run it on a server, with the key in an environment variable.

Verify#

  • GET /v1/agency returns your workspace, and the post answers 201 with status scheduled.
  • Each post target reaches published, or you get target.published and target.failed webhooks.
  • Before going live, the key holds only the scopes it uses and is stored as a server secret.

Troubleshoot#

Troubleshoot
AnswerMeaningFix
400 idempotency_key_requiredA write had no Idempotency-KeyAdd one and send again
401The credentials are missing or invalidCheck the Authorization header and the key
403 insufficient_scopeThe key lacks the scopeCreate a key with it
409Destination already publishedDo not resend
422The body is invalid; errors names each fieldFix the fields and use a new key
429, 502, 503, 504A budget ran out or a temporary server problemRetry a 429, 502, 503 or 504, or a request that got no response, with the same Idempotency-Key: SkedCast runs it once or returns the first result. Every other answer, including a 500, is kept for 24 hours and returned again for that key, so send a new key to try again.

Errors are RFC 9457 `application/problem+json` documents with a stable `code`. See the [conventions](/developers/conventions) and the [error catalogue](/developers/data/api-error-catalogue).

Sources