> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mymarky.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Error codes

> Every error code, what it means, and how to resolve it.

When the API returns an error, the response body always has the same shape. The
`code` field is a stable, machine-readable identifier — match on it instead of the
human `message`, which can change. Each error's `doc_url` links straight to its
entry on this page.

```json theme={null}
{
  "error": {
    "type": "invalid_request_error",
    "code": "INSUFFICIENT_CREDITS",
    "message": "You need 5 more credits to generate this post.",
    "doc_url": "https://docs.mymarky.ai/errors#insufficient_credits",
    "param": "content"
  }
}
```

<Note>
  New to handling our errors? Start with the [Error handling guide](/error-handling)
  for the response shape, how to catch errors, and how to respond to each error type.
</Note>

## Authentication and access

### authentication\_required

**401** — Your `Authorization` header is missing or invalid. Send your API key as a
Bearer token: `Authorization: Bearer mk_live_…`. See [Authentication](/authentication).

### SOCIAL\_TOKEN\_EXPIRED

**401** — The connected social account needs to be reconnected (its token expired or
was revoked). Reconnect the account in **Social Connections**, then retry.

### SOCIAL\_CONNECT\_FAILED

**400** — We couldn't finish connecting a social account. Usually the OAuth
authorization code expired (the user took too long on the platform's consent screen)
or was already used. Start the connection again.

### permission\_denied

**403** — Your key is valid but can't access this resource. Usually the business
doesn't belong to your organization, or your plan doesn't include API access. Check
the business ID and your org's plan.

### INVALID\_API\_KEY

**422** — A third-party key you supplied (for example an OpenRouter or Gemini key)
isn't valid. Check the key and save it again.

## Invalid requests

### validation\_error

**422** — The request body failed validation. The `param` field names the first
offending field; if several fields failed, read `error.details` for the full list.

### missing\_field

**400** — A required field is missing. The `param` field tells you which one.

### invalid\_value

**400** — A field has a value that isn't allowed. Check `param` and `message` for
the specifics.

### invalid\_request

**400** — The request couldn't be processed and no more specific code applies. Read
`message` for the reason.

### resource\_not\_found

**404** — The ID doesn't exist, was deleted, or doesn't belong to your organization.
Check the ID and try again.

### already\_exists

**409** — A resource with that name or ID already exists. Use a different value.

## Plans, billing, and credits

### PAYMENT\_REQUIRED

**402** — This feature needs a paid plan. Upgrade to use it.

### INSUFFICIENT\_CREDITS

**402** — Your organization is out of credits. The response includes
`required_credits` so you can show how many more are needed. Add credits or upgrade,
then retry.

### BUSINESS\_CREDIT\_LIMIT\_EXCEEDED

**402** — The workspace hit a monthly credit cap set by the org admin (different from
running out of credits). The admin needs to raise the cap. A sub-account can't
self-serve here.

### CHECKOUT\_BLOCKED

**400** — Recent payment attempts were flagged by our payment processor, so checkout
is blocked. Contact support to continue.

### SUBSCRIPTION\_ALREADY\_ACTIVE

**409** — The organization already has an active or trialing subscription, so there's
nothing to check out. Manage the plan in account settings instead.

## Limits and quotas

### rate\_limit\_exceeded

**429** — You sent too many requests. Back off and retry. These response headers are
sent on **every** API-key response (including the 429 itself, so a throttled client
always learns when to retry):

| Header                  | Meaning                                                                                                                                         |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `X-RateLimit-Limit`     | Max requests for the window that's closest to its cap (100/minute, 2,000/day, or 10,000/week)                                                   |
| `X-RateLimit-Remaining` | Requests left in this window (`0` on a 429)                                                                                                     |
| `X-RateLimit-Reset`     | **UNIX epoch (seconds)** when the window resets — an absolute timestamp, matching GitHub/Stripe. Compute the wait as `X-RateLimit-Reset - now`. |
| `Retry-After`           | Seconds to wait before retrying — a **delta** (relative seconds), per the HTTP standard. Prefer this for simple back-off.                       |

### limit\_exceeded

**400** — A resource cap was reached (for example, the max number of webhooks or API
keys per org). Delete something you no longer use to free up room.

### storage\_limit\_exceeded

**400** — The business hit its media storage limit. Delete unused media, or upgrade
for more space.

### WORKSPACE\_LIMIT\_EXCEEDED

**400** — The organization reached the most workspaces its plan allows. Upgrade to add
more.

### WORKSPACE\_NOT\_SUPPORTED

**400** — Your plan doesn't support this workspace action.

### FILE\_TOO\_LARGE

**413** — The upload is over the size limit. Use a smaller file and try again.

## Content and generation

### NO\_ENABLED\_TOPICS

**422** — The business has no topics turned on, so there's nothing to generate from.
Enable at least one topic first.

### NO\_CONNECTED\_SOCIALS

**400** — The business has no connected social account (or none of the requested
platforms are connected), so there's nothing to read from or publish to. Connect a
social account first.

### NOT\_ENOUGH\_POSTS\_FOR\_TOPICS

**422** — There aren't enough past posts to suggest topics from. Publish or import a
few more posts, then try again.

### PLATFORM\_MEDIA\_UNSUPPORTED

**400** — The target platform doesn't support this media type (for example, Google
Business doesn't accept video). Use a different file or platform.

### PHONE\_NOT\_VERIFIED

**400** — The action needs a verified phone number (for example, enabling SMS).
Verify the phone first.

## Server and upstream

### internal\_error

**500** — Something went wrong on our end. Retry after a short delay. If it persists,
[submit feedback](/api-reference/submit-feedback) with the error details and the
request ID.

### UPSTREAM\_PROVIDER\_ERROR

**502** — A third-party provider we depend on (a social platform, or a service like
the SMS, email, transcription, or stock-media provider) failed. This is usually
transient and not a problem with your request. Retry after a moment.
