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

Get started

API conventions: REST API pagination errors, retries and rate limits

Updated

Every /v1 endpoint answers in one shape: a { data, meta } envelope, keyset cursors, an Idempotency-Key on every write and RFC 9457 problem+json errors. REST API pagination errors, retries and rate limits follow the same rules.

Browse docs

Request headers#

Request headers
HeaderDirectionPurpose
AuthorizationrequestBearer sked_… (API key) or Bearer <token> (OAuth)
Content-Typerequestapplication/json on every request with a body
Idempotency-KeyrequestRequired on POST, PATCH and DELETE, except POST /posts/preview; dedupes retries
X-Correlation-IdbothTrace id, echoed in meta.correlationId. You can send your own: 1 to 128 letters, digits, dot, underscore or hyphen. Any other value is replaced, never refused
RateLimit-*responseYour budget, what is left, and seconds to reset (on a 429: Retry-After)

Request body#

Request body
RuleBehaviour
Unknown fieldsRefused with 422 validation_failed and an errors entry, not ignored, so a misspelled field fails loudly
IdsUUIDs; a path or body id that is not a valid UUID is refused as a validation error before any lookup
Validation errorsEach errors entry names the path of the field and says what is wrong

Timestamps and time zones#

scheduledAt is a UTC instant (ISO 8601). scheduledLocal is a clock time read in timezone, else the client's zone, the workspace's, then UTC. When you send both, scheduledLocal wins.

Use scheduledAt when you already hold an instant, and scheduledLocal with timezone when a person picked a clock time. Store instants; convert to local only for display.

Schedule fields#

Schedule fields
FieldTakesNotes
typenow, at or rangenow publishes immediately; at needs a time; range needs from and to
scheduledAtUTC instantFor example 2030-01-15T15:00:00Z
scheduledLocalYYYY-MM-DDTHH:mmNo zone in the value; the zone comes from timezone or the defaults
timezoneA zone nameRead with scheduledLocal
spreadMinutes0 to 720, default 0Spreads the posts across that many minutes after the chosen time, never earlier

The same schedule object is used on every route that creates a post.

Response envelope#

A single resource returns { data, meta }; a collection returns { data, page, meta }.

json
{
  "data": [ { "object": "client", "id": "…" }, … ],
  "page": { "cursor": null, "nextCursor": "eyJ…", "hasMore": true },
  "meta": { "correlationId": "c-…" }
}
List envelope.
Table
FieldWhereWhat it holds
dataEvery successThe resource, or an array of resources on a list
page.cursorListsThe cursor this page was read from; null on the first page
page.nextCursorListsPass this as cursor for the next page; null when there is none
page.hasMoreListstrue while another page exists
meta.correlationIdEvery successThe trace id of this request; send it to support
correlationIdEvery errorThe same trace id on the problem document

Pagination#

Lists use keyset pagination: stable under inserts and fast at any depth. Send limit (1 to 100) and the previous nextCursor as cursor until hasMore is false.

A cursor is opaque: pass back exactly the nextCursor you received, with the same filters, and never build, edit or store one for later.

bash
curl "https://api.skedcast.com/v1/posts?limit=50&cursor=eyJ…" \
  -H "Authorization: Bearer sked_live_YOUR_KEY"

REST API pagination errors#

Loop on hasMore, not on page length, and keep the last nextCursor outside the loop so a failure resumes there. The loop is in the API pagination guide.

Table
AnswerCauseFix
400 invalid_cursorThe cursor is malformed, was edited, or is not a cursor this list issuedStart again from the first page and use the nextCursor as returned
400 cursor_sort_mismatchThe cursor is well formed but was issued for a different sort orderStart from the first page. Retrying cannot work, because the cursor no longer applies
422 validation_failed, errors path limitlimit is not a whole number from 1 to 100Send a limit between 1 and 100
422 validation_failed, errors path cursorThe cursor is longer than a list accepts (512 characters on the posts list)Send the nextCursor unchanged, never joined to other text
429 rate_limitedThe request budget for your key, app or workspace ran outWait for Retry-After, then continue from the same cursor
401 or 403The credential expired or lacks the scope partway through a long loopFix the credential, then resume from the last nextCursor you kept

The default `limit` differs by list (25 on the posts list, for example), so send it explicitly when you need a fixed page size.

ts
type Page = { data: unknown[]; page: { nextCursor: string | null; hasMore: boolean } };

export async function* allPosts(apiKey: string, resumeFrom?: string): AsyncGenerator<unknown[]> {
  let cursor = resumeFrom;
  while (true) {
    const url = new URL("https://api.skedcast.com/v1/posts");
    url.searchParams.set("limit", "100");
    if (cursor) url.searchParams.set("cursor", cursor);

    const res = await fetch(url, { headers: { Authorization: "Bearer " + apiKey } });
    if (res.status === 429) {
      const wait = Number(res.headers.get("Retry-After")) || 5; // seconds
      await new Promise((resolve) => setTimeout(resolve, wait * 1000));
      continue; // same cursor, same page
    }
    if (!res.ok) {
      const problem = await res.json(); // application/problem+json
      // invalid_cursor and cursor_sort_mismatch: restart from the first page, do not retry.
      throw new Error(problem.code + " (correlationId " + problem.correlationId + ")");
    }

    const body = (await res.json()) as Page;
    yield body.data;
    if (!body.page.hasMore) return;
    cursor = body.page.nextCursor ?? undefined;
  }
}
A pagination loop that resumes from the last cursor and stops on a pagination error.

Errors#

Errors are RFC 9457 application/problem+json. Branch on the stable code, show detail to a person and never parse it: extension members are less error-prone (IETF RFC 9457, July 2023, read 22 November 2026).

json
{
  "type": "https://skedcast.com/errors/validation_failed",
  "title": "Validation failed",
  "status": 422,
  "category": "bad-body",
  "code": "validation_failed",
  "detail": "One or more fields are invalid.",
  "correlationId": "c-…",
  "errors": [ { "path": "content", "message": "Required" } ]
}
Error shape.

Error fields#

Error fields
FieldTypeUse it to
codeStable stringDecide what to do. Safe to switch on
statusHTTP statusChoose retry or fix, as in the status table below
titleShort textShow in a log line
detailSentenceShow to a person. Do not parse it
correlationIdTrace idQuote to support
errorsArray on 422Mark each invalid field by its path
limit / featureObject on 403Offer the right upgrade or removal

Every code is listed with its meaning and fix in the API error catalogue.

Refusals that add a member#

Refusals that add a member
AnswerAddsNotes
403 limit_reachedlimit: quota (such as maxAccounts or storageBytes), limit, current, requested, and renewsOn for a quota that renewsA plan limit
403 feature_unavailablefeature: key, and availableOn, the lowest plan that includes itA plan feature you don't have
409 targets_not_publishablechannels: for each channel the request named that cannot publish, accountId, platform, state, stateReason ({ code, label, explanation }) and action (reconnect, upgrade or contact-support)A new post, schedule or validation names a channel that cannot publish right now. Also on 400 targets_out_of_scope (a channel that needs reconnecting) and 400 no_targets_resolved (a group selection with nothing to publish to)
403 platform_limit_reachedNothing extraA hard maximum no plan lifts (20 webhook endpoints, 50 link-in-bio pages): remove one instead of upgrading
json
{
  "type": "https://skedcast.com/errors/limit_reached",
  "title": "Plan limit reached",
  "status": 403,
  "category": "forbidden",
  "code": "limit_reached",
  "detail": "Your plan includes 10 connected accounts — upgrade to add more",
  "correlationId": "c-…",
  "action": "upgrade",
  "limit": { "quota": "maxAccounts", "limit": 10, "current": 10, "requested": 1 }
}
A plan limit refusal.

Status codes#

Status codes
StatusMeaning
400 / 422Malformed request / validation failed
401Missing or invalid credentials
403Authenticated but lacking the scope/role
404Resource not found
409Conflict: a state conflict, or a request with the same Idempotency-Key still running
429Rate limited — back off per Retry-After
5xxServer error. 502, 503 and 504: retry with backoff and the same Idempotency-Key. 500: the answer is kept for that key, so retry with a new key

Idempotency and retries#

Every POST, PATCH and DELETE (except POST /posts/preview) needs an Idempotency-Key: a unique string up to 255 characters, a UUID ideally. Replaying a key returns the original result, never a duplicate.

Send a new key for a new operation, and never reuse a key with a different body. The IETF Idempotency-Key draft is not a final standard yet (read 22 November 2026).

Diagram: a client sends a write with an Idempotency-Key, the connection drops before the answer arrives, the client retries with the same key, and SkedCast returns the original result instead of creating a duplicate.
A retry with the same key returns the first result.

Idempotency errors#

Idempotency errors
Status and codeMeaning and what to do
400 idempotency_key_requiredThe header is missing. Send one.
400 idempotency_key_invalidThe key is empty or longer than 255 characters.
409 idempotency_in_progressThe first request with this key is still running. Wait for Retry-After, then retry with the same key.
422 idempotency_key_reuseThe key was already used with a different request body. Use a new key for a new request.

A replayed response carries the header Idempotency-Replayed: true (and the older Idempotent-Replayed: true). Keys are kept for 24 hours, per workspace and member.

Retry decision#

Retry decision
OutcomeRetry?Which key
No response, or the connection droppedYesThe same key
429Yes, after Retry-AfterThe same key
502, 503, 504Yes, with backoffThe same key
409 idempotency_in_progressYes, after Retry-AfterThe same key: the first request is still running
500Only if you mean to try againA new key: the answer is kept for the old one
400, 401, 403, 404, 422No: change the request or the credential firstA new key once the request is different

A replayed answer carries `Idempotency-Replayed: true`, so you can tell a first result from a repeat.

ts
export async function postWithRetry(path: string, body: unknown, apiKey: string): Promise<Response> {
  const key = crypto.randomUUID(); // one key per logical write, reused on every retry
  for (let attempt = 0; attempt < 5; attempt++) {
    const res = await fetch("https://api.skedcast.com/v1" + path, {
      method: "POST",
      headers: {
        Authorization: "Bearer " + apiKey,
        "Idempotency-Key": key,
        "Content-Type": "application/json",
      },
      body: JSON.stringify(body),
    });
    // 429, 502, 503 and 504 release the key, so the same key runs the request again.
    if (![429, 502, 503, 504].includes(res.status)) return res;
    const wait = Number(res.headers.get("Retry-After")) || 2 ** attempt; // seconds
    await new Promise((resolve) => setTimeout(resolve, wait * 1000));
  }
  throw new Error("Gave up after 5 attempts");
}
Retry a write with one Idempotency-Key, honouring Retry-After.

Rate limits#

Your plan sets a request budget per minute, applied to each API key or OAuth app and again to the whole workspace. Read the RateLimit-* headers and back off on a 429 using Retry-After; do not hard-code delays.

Table
PlanAPI requests / minMCP requests / minMCP destructive / min
SoloNot included6010
Studio1206020
Agency30012040
Agency+60024080
Enterprise1200480160

Per API key or OAuth app, per minute. Every response sends RateLimit-Limit / RateLimit-Remaining / RateLimit-Reset; a 429 adds Retry-After.

Rate limit headers#

Rate limit headers
HeaderValue
RateLimit-LimitYour budget a minute
RateLimit-RemainingWhat is left
RateLimit-ResetSeconds until the budget refills
Retry-AfterOn a 429, a number of seconds here. HTTP also allows a date, so a generic client should accept both (IETF RFC 9110, section 10.2.3)

RFC 6585 defines 429 as too many requests in a given amount of time (read 22 November 2026).

Rate limit rules#

Rate limit rules
RuleDetail
Batch costOne unit per item: a call that creates 50 posts uses 50. A bulk action counts the destinations it touches, so one call that cancels 500 posts uses 500
MCPOne budget per connected client, and a smaller one for tools that delete or cancel (a client, campaign or webhook, a post, or a batch that can cancel many). Scheduling and publishing are ordinary writes
Write limitSet in Settings → Developer on a key, or on a connected app for the workspace. Reads keep the plan budget; writes (anything but a GET on the REST API, and any MCP tool that changes something) draw on the write limit, which can only lower the plan budget
Refused requestsA refused request still counts toward the plan budget, so back off before you retry
429 detailNames the budget that ran out: connection (this key or app), workspace (every key and app together) or writes (a write limit)
UsageIn Settings → Developer, each API key has a Usage view: its requests and refused requests per day and over the last 24 hours
Platform limitsWhatever your request rate, publishing respects each platform's own limits and your plan's post caps

The backoff strategy is in the rate limits guide.

These are the three header names SkedCast sends today. The IETF draft defines a combined RateLimit and a RateLimit-Policy field instead (draft-ietf-httpapi-ratelimit-headers-12, read 22 November 2026); it is not a standard, so check a real response.

Batch calls#

A batch call (POST /posts/bulk) answers 200 with one result per item, so a 200 does not mean every item worked. Items are created in order, each in its own transaction; a failing item never undoes earlier ones.

The request's Idempotency-Key covers the whole call, and each item gets a key derived from it or supplied in itemKeys, so resending a batch creates nothing twice.

Table
RuleSingle writeBatch (POST /posts/bulk)
Items per callOne1 to 50, each exactly a POST /posts body
ResultThe resource, or an error status200 with one result per item
A failing itemThe whole request failsOnly that item fails; the rest stand
Rate-limit costOne unitOne unit per item
IdempotencyThe request's keyThe request's key, plus a key per item derived from it
Dry runPOST /posts/previewvalidateOnly: true

A batch counts one request unit per item against the plan budget. Quota and per-account pacing are checked in order, so item 7 sees the items already created.

Request tracing#

Every request gets a correlation id: the X-Correlation-Id response header, meta.correlationId on a success and correlationId on an error. Quote it to support.

Versioning and deprecation#

The version is in the path: every route is under /v1. Fields and routes are added without changing the meaning of existing ones, so ignore fields you do not know.

A retired route signals it with the Deprecation header (IETF RFC 9745, March 2025) and the Sunset header (IETF RFC 8594), both read 22 November 2026. Every change is dated in the SkedCast API changelog, newest first.

These conventions apply to every route in the SkedCast developer documentation.

Sources