# Errors

Every error has the same format:

```json
{
  "error": {
    "code": "media_required",
    "lang": "en",
    "message": { "en": "…", "es": "…", "pt": "…" },
    "fix": { "en": "…", "es": "…", "pt": "…" },
    "docs_url": "https://wyroapi.com/docs/errores#media_required",
    "details": { "platform": "instagram" }
  }
}
```

`message` and `fix` always include every language; `lang` says which one fits you.

<h2 id="missing_api_key"><code>missing_api_key</code> (HTTP 401)</h2>

The API key is missing.

**How to fix it:** Send the "Authorization: Bearer <key>" header. No key yet? Create a test key with POST /v1/sandbox (no sign-up).

<h2 id="invalid_api_key"><code>invalid_api_key</code> (HTTP 401)</h2>

The API key is invalid or was revoked.

**How to fix it:** Check that the key starts with "wyro_sk_" and is complete. You can create a new one with POST /v1/sandbox.

<h2 id="sandbox_expired"><code>sandbox_expired</code> (HTTP 401)</h2>

The test key expired (it lasts 72 hours).

**How to fix it:** Create a new test key with POST /v1/sandbox, or connect a real account to keep using the same key.

<h2 id="key_expired"><code>key_expired</code> (HTTP 402)</h2>

The trial period has ended.

**How to fix it:** Show the user the link in details.payment_url to activate a plan. The same key publishes again, no reconfiguration needed.

<h2 id="workspace_suspended"><code>workspace_suspended</code> (HTTP 403)</h2>

This workspace is suspended.

**How to fix it:** Contact us at https://github.com/wyroapi/wyro/issues.

<h2 id="rate_limited"><code>rate_limited</code> (HTTP 429)</h2>

Too many requests.

**How to fix it:** Wait the number of seconds in the Retry-After header and try again.

<h2 id="sandbox_limit"><code>sandbox_limit</code> (HTTP 429)</h2>

Too many test keys were created from this IP.

**How to fix it:** Reuse the key you already have (it lasts 72 hours) or wait an hour.

<h2 id="validation_error"><code>validation_error</code> (HTTP 400)</h2>

The request has invalid data.

**How to fix it:** Check the field listed in details against /openapi.json.

<h2 id="platform_not_supported"><code>platform_not_supported</code> (HTTP 400)</h2>

That social network is not supported.

**How to fix it:** Use one of: instagram, facebook, tiktok, linkedin, twitter, threads, youtube, pinterest.

<h2 id="no_account_for_platform"><code>no_account_for_platform</code> (HTTP 400)</h2>

There is no connected account for that network.

**How to fix it:** List accounts with GET /v1/accounts. To connect a real account use POST /v1/connect.

<h2 id="media_required"><code>media_required</code> (HTTP 400)</h2>

That network needs an image or a video.

**How to fix it:** Add "media": [{"url": "https://..."}] with a public URL. TikTok and YouTube need a video.

<h2 id="text_too_long"><code>text_too_long</code> (HTTP 400)</h2>

The text exceeds the network's limit.

**How to fix it:** Shorten the text or post to that network separately. Limits are in details.

<h2 id="admin_only"><code>admin_only</code> (HTTP 403)</h2>

This route is for the platform administrator only.

**How to fix it:** Use the analytics token (ANALYTICS_TOKEN) or the admin token, not a workspace key. Your workspace metrics are at GET /v1/analytics/overview.

<h2 id="invalid_partner_token"><code>invalid_partner_token</code> (HTTP 401)</h2>

The partner token is invalid.

**How to fix it:** Use the partner token we gave you, as Authorization: Bearer <token>. It is not a workspace key.

<h2 id="workspace_not_found"><code>workspace_not_found</code> (HTTP 404)</h2>

The workspace does not exist or does not belong to this partner.

**How to fix it:** List your workspaces with GET /v1/partner/workspaces.

<h2 id="post_not_cancellable"><code>post_not_cancellable</code> (HTTP 409)</h2>

That post can no longer be cancelled.

**How to fix it:** Only scheduled posts that have not gone out can be cancelled. To delete a published post, do it on the network.

<h2 id="account_not_disconnectable"><code>account_not_disconnectable</code> (HTTP 409)</h2>

That account cannot be disconnected.

**How to fix it:** Only active real accounts can be disconnected. The simulated test accounts cannot.

<h2 id="account_not_found"><code>account_not_found</code> (HTTP 404)</h2>

The account does not exist in this workspace.

**How to fix it:** List accounts with GET /v1/accounts.

<h2 id="post_not_found"><code>post_not_found</code> (HTTP 404)</h2>

The post does not exist.

**How to fix it:** Check the id (it starts with post_). List posts with GET /v1/posts.

<h2 id="account_disconnected"><code>account_disconnected</code> (HTTP 409)</h2>

That account is disconnected.

**How to fix it:** Ask the user to reconnect it with the link in details.connect_url (or POST /v1/connect).

<h2 id="provider_error"><code>provider_error</code> (HTTP 502)</h2>

The social network did not accept the post right now.

**How to fix it:** If details.retryable is true, retry in a minute. Otherwise check the content (format, length, size) and the connected account.

<h2 id="post_not_reschedulable"><code>post_not_reschedulable</code> (HTTP 409)</h2>

That post is no longer scheduled: only a post that has not gone out can be rescheduled.

**How to fix it:** Check its status with GET /v1/posts/{id}. If it was already published, create a new post with POST /v1/posts.

<h2 id="not_found"><code>not_found</code> (HTTP 404)</h2>

The route does not exist.

**How to fix it:** See /openapi.json for the available routes.

<h2 id="internal_error"><code>internal_error</code> (HTTP 500)</h2>

Something failed on our side.

**How to fix it:** Try again in a few seconds. If it keeps happening, open an issue at https://github.com/wyroapi/wyro/issues with the request_id.
