Errors
Every error from /agent/* (and its /mcp/agent/* alias) has one shape. type is a stable slug: branch on it, not on message.
The error envelope
param names the request field when known; details carries what the service attached (a limit, seconds to wait, funds available); requestId identifies the request and also travels in the x-request-id header.
{
"error": {
"type": "insufficient_scope",
"message": "Esta llave no tiene el permiso \"catalogo\": catálogo (productos y retos sin fondos). El dueño lo agrega en lid.pro, en Ajustes › Desarrollo.",
"details": {
"need": "catalogo",
"permission": "catalogo",
"permissions": [
"sitio"
]
},
"requestId": "req_9f2a1c"
}
}Handling it with the SDK
isLidError narrows unknown to LidError. details is typed per type with isLidErrorOfType.
import { isLidError } from '@lidpro/sdk';
try {
await lid.products.create(body);
} catch (e) {
if (!isLidError(e)) throw e;
switch (e.type) {
case 'insufficient_scope':
// details.permission: the one the key lacks (sitio, catalogo or dinero)
console.error('The key lacks a permission', e.details);
break;
case 'product_creation_limit':
// details carries the quota and the seconds to wait for this slug
console.error('Daily product quota reached', e.details);
break;
default:
console.error(e.type, e.message, e.requestId);
}
}import { isLidErrorOfType } from '@lidpro/sdk';
if (isLidErrorOfType(e, 'rate_limited')) {
await sleep((e.details?.retryAfter ?? 1) * 1000);
}Catalog
Every slug the API emits today, grouped the same way as the backend source. A service can throw others outside this list if they follow the slug format; a new one is an API decision and gets added here.
General
| Type | Status | Meaning |
|---|---|---|
bad_request | 400 | The request is malformed or missing something the endpoint needs. |
validation_error | 400 | A field failed validation; param names it when known. |
unauthorized | 401 | No valid API key was sent. |
payment_required | 402 | The account does not have enough balance for this call: credits or, with dollar billing, its extra usage. |
forbidden | 403 | The API key or its owner cannot do this. |
not_found | 404 | Nothing matches that path or id. |
method_not_allowed | 405 | That HTTP method is not supported on this path. |
conflict | 409 | The request collides with the current state of the resource. |
gone | 410 | The resource existed but was archived or removed. |
payload_too_large | 413 | The request body or file exceeds the size limit. |
unsupported_media_type | 415 | The request's Content-Type is not accepted here. |
unprocessable | 422 | The request is well-formed but cannot be processed as sent. |
rate_limited | 429 | Too many requests; retry after the seconds in Retry-After. |
internal_error | 500 | Something failed on our side. The detail stays in the server log under requestId. |
bad_gateway | 502 | An upstream service Lid depends on returned an invalid response. |
service_unavailable | 503 | The service is temporarily down; retry with backoff. |
gateway_timeout | 504 | An upstream service Lid depends on took too long to answer. |
Authentication & API key
| Type | Status | Meaning |
|---|---|---|
missing_bearer | 401 | The Authorization: Bearer header is missing. |
invalid_key_format | 401 | The API key does not look like a Lid key (it should start with lpmcp_). |
invalid_or_inactive_key | 401 | The key does not exist, was removed, or is inactive. A removed key never comes back: the owner regenerates it in Settings → Development. |
key_expired | 401 | The key expired (every key lasts 30, 90 or 180 days); details.expiredAt says when. The owner renews it or creates a new one in Settings → Development. |
key_not_linked | 403 | The key is not linked to a user account yet. |
key_inactive | 403 | The key was removed by its owner or an admin. |
user_not_found | 404 | The user behind the key no longer exists. |
account_blocked | 403 | The account that owns the key is blocked; the API does not accept its calls. |
insufficient_scope | 403 | The key lacks the permission the route needs: details.permission says which one is missing (sitio, catalogo, dinero or datos) and details.permissions the ones it has. |
key_site_scoped | 403 | The key belongs to a site and the route or site is a different one. |
key_tasks_only | 403 | The key only has Lida permissions (Lida tasks or Chat with Lida): on /agent/* only me.get answers. For anything else, use a key with other permissions. |
key_managed | 409 | Lid manages the key ("Your site's Lida" or "Lida for an app"): it can't be shown, regenerated or have its permissions changed. |
site_keys_disabled | 404 | Site keys are turned off. |
site_tool_not_found | 404 | That tool doesn't exist. |
site_tool_unavailable | 409 | That tool isn't available on this site (its piece is off). |
site_tool_invalid | 400 | The tool's arguments aren't valid. |
insufficient_credits | 402 | The account ran out of credits for this action. |
origin_not_allowed | 403 | A write came from a browser on an origin that is not Lid (for example, a site's code) and was rejected before reaching the route. |
Quotas
| Type | Status | Meaning |
|---|---|---|
product_creation_limit | 429 | You hit the daily or lifetime cap on product creation for this key (or, for the day, for your account). |
mcp_creation_disabled | 403 | Creation with API keys is turned off (admin kill-switch). |
creation_limit_reached | 403 | You hit the creation cap for this resource. |
Idempotency
| Type | Status | Meaning |
|---|---|---|
idempotency_key_required | 400 | This call moves money: send an Idempotency-Key header. |
idempotency_key_invalid | 400 | The Idempotency-Key header is malformed. |
idempotency_key_reused | 422 | That key was already used for a different request body. |
idempotency_key_failed | 409 | The original request with that key failed; fix the input before retrying with a new key. |
idempotency_key_in_progress | 409 | A request with that key is still being processed; retry shortly. |
Account & products
| Type | Status | Meaning |
|---|---|---|
no_solana_wallet | 400 | The account has no Solana wallet linked yet. |
product_not_found | 404 | No product matches that PDA. |
not_product_owner | 403 | The wallet behind the key does not own this product. |
not_your_product | 403 | This product belongs to a different account. |
no_deliverable_content | 400 | The product has no file attached yet; buyers can't receive anything. |
product_archived | 410 | The product was archived by its creator and can't be bought. |
product_blocked | 410 | The product was blocked by an admin. |
agent_wallet_provision_failed | 500 | The agent wallet for this key could not be created; try again in a moment. |
Files
| Type | Status | Meaning |
|---|---|---|
file_required | 400 | The request needs a file and none was sent. |
file_empty | 400 | The uploaded file has no content. |
file_too_large | 413 | The file exceeds the 25 MB cap. |
invalid_url | 400 | The url is not a valid http or https address. |
blocked_url | 400 | The url points to a private or local network; use a public address. |
fetch_failed | 400 | Lid could not download the file at that url; check that it is public and try again. |
too_many_redirects | 400 | The url redirects too many times; pass the final address. |
Purchases & sales
| Type | Status | Meaning |
|---|---|---|
affiliate_not_found | 400 | No affiliate matches that code. |
affiliate_without_wallet | 400 | The affiliate has no wallet to receive commission. |
signature_not_found | 404 | No transaction matches that signature yet; the listener may not have confirmed it. |
transaction_failed | 400 | The Solana transaction failed or was rejected. |
price_above_max | 400 | The product's price is above the maxPriceUsdc cap you set. |
insufficient_agent_usdc | 400 | The agent wallet does not have enough USDC for this purchase. |
sponsor_missing | 500 | The gas sponsor is not configured; the transaction cannot be paid for. |
sold_out | 400 | The product sold out. |
own_product | 400 | The buyer is the creator of the product and cannot buy it. |
sale_not_started | 400 | The product's sale has not opened yet; the message says when it does. |
product_paused | 400 | The creator paused the product; it cannot be bought right now. |
affiliate_vault_missing | 400 | The sharer in the purchase cannot receive their cut yet; buy without them or try again later. |
Bounties & pools
| Type | Status | Meaning |
|---|---|---|
bounty_without_pool | 400 | This bounty has no funded pool yet. |
pool_not_open | 400 | The pool is not open for new assignments. |
pool_not_custodial | 403 | The pool is not custodial; Lid cannot sign on its behalf. |
insufficient_pool_funds | 400 | The pool does not have enough funds for this payout. |
prizes_below_minimum | 400 | The prizes add up to less than the minimum of 10 digital dollars. |
site_only_requires_site | 400 | A challenge shown only on your site needs a published site. |
bounty_blocked | 410 | Lid's moderation blocked this challenge. |
prize_already_assigned | 409 | That submission's prize is already assigned, so its verdict can no longer change. |
no_winners | 400 | There are no prizes to assign. |
duplicate_winner_wallet | 400 | The same wallet appears in two prizes; give each wallet one prize. |
Sites (Builder)
| Type | Status | Meaning |
|---|---|---|
sites_disabled | 404 | The Builder is not active for the key's account (a Lid admin turns it on). |
site_not_found | 404 | That site does not exist or does not belong to the key's account. |
site_busy | 409 | Lida or another write is working on the site, or the draft changed while you were writing; read the files again and retry. |
site_limit_reached | 409 | The account reached the cap of live sites it can create with an API key; work on one it already has. |
site_name_invalid | 400 | The site name is empty or longer than 80 characters. |
site_config_invalid | 400 | The site config is not valid (brand, language, modules or featured products). |
site_memberships_unavailable | 400 | Memberships cannot be turned on: the platform has no active subscriptions. |
challenges_site_only | 409 | Turning Challenges off hides challenges that only live on this site; details.count says how many. Repeat the call with confirmChallengesOff: true after the person confirms. |
site_suspended | 409 | The site is suspended; it cannot be edited or published. |
site_payment_required | 402 | Publishing a site without a plan needs one chosen in Lid's web (it can't be subscribed or paid by API or MCP). details.plans has the plans, details.freeDays the free site's days, details.chooseUrl where to choose and details.payNow whether the site already has a plan waiting for a payment. |
site_assisted | 409 | The Lid team is building this site for its owner: the owner's key can read it but not change it until it is handed over. |
client_not_found | 404 | create_app with forClient: there is no account with that email, wallet or username. |
site_paused | 409 | The site is paused; turn it back on to publish. |
site_conflict | 409 | The site server already has that site; read its status again and retry. |
slug_invalid | 400 | The slug must be 3 to 40 lowercase letters, numbers or hyphens. |
slug_reserved | 400 | That word is reserved and cannot be used as a slug. |
slug_taken | 409 | Another site already uses that slug. |
no_capacity | 503 | There is no room on the site servers right now; try again later. |
sites_pass_key_missing | 503 | The site pass key is not configured on the Lid server. |
sites_buyer_key_missing | 503 | The site buyer pass keys are not configured on the Lid server. |
site_pass_mark_invalid | 400 | The pass does not carry a valid browser mark. |
not_store_owner | 403 | This account does not manage that store. |
builder_disabled | 403 | The Builder is not active for your account. |
store_suspended | 409 | The store is suspended; its admin panel cannot be opened. |
return_url_invalid | 400 | The return address does not belong to that store. |
buyer_pass_invalid | 400 | The buyer pass is missing the operation or the product. |
purchase_not_found | 409 | That purchase is not on the account yet; wait a few seconds and retry. |
store_not_connected | 409 | The store is not connected to the account yet. |
connection_not_found | 404 | That store is not connected to the account. |
host_unreachable | 502 | The site's server is not responding; try again in a few minutes. |
host_disconnected | 503 | A Lid admin deleted the connection with the site's server: it stays online, but it can't be published or changed until the server is connected again. |
build_in_progress | 409 | Lida is still working on the previous request; wait for it to finish. |
build_message_invalid | 400 | The request to Lida is empty or longer than 4000 characters. |
build_run_not_found | 404 | That Lida turn does not exist. |
builds_per_hour | 429 | The hourly limit of requests to Lida was reached. |
lida_daily_limit | 429 | Today's Lida messages ran out. With details.scope site, the site plan's (they apply with credits on or off; details.plan says which plan, and a bigger plan is chosen in Lid's web); with details.scope account, the turn cap of an account with no paid site while the Builder is open to every account. details.retryAt says when they come back. With dollar billing it's a high limit that only protects against abuse. |
credits_insufficient | 402 | ask_lida or publishing uses more credits than the site owner has; details.needed and details.balance say how many are missing. Credits are bought on the web. With dollar billing there is no details.needed: it has details.unit usd, details.reason (balance: the balance between the site's plan and the extra usage isn't enough; daily_cap: the site's usage limit for today, with details.resetsAt) and details.payer; for the owner, also details.estimate, details.extraLeftCents, details.planPercentUsed and details.topUpUrl. Top-ups are made on the web. |
source_invalid | 400 | The code breaks the site rules; details says which file or rule failed. |
site_content_blocked | 400 | The change adds a form that asks for credentials, sends visitor data to another domain or writes wallets or prize amounts; nothing was saved and details.errors says which file and rule. |
source_path_invalid | 400 | That file path is not valid or is outside the site zone. |
source_file_not_found | 404 | That file does not exist in the draft. |
sandbox_busy | 409 | Another preview is in use on that server; try again in a few minutes. |
preview_unavailable | 503 | The preview is not available on that server. |
screenshots_unavailable | 503 | The capture browser is busy or unavailable; retry in a few seconds. |
media_missing | 400 | The image is missing: send url or dataBase64. |
media_url_invalid | 400 | The image address must start with http:// or https://. |
media_too_large | 413 | The image is over 8 MB. |
media_type_invalid | 415 | Only png, jpg, webp, gif, svg or avif are accepted. |
media_quota | 413 | The site reached its image quota; delete one to upload another. |
media_download_failed | 400 | The image could not be downloaded from that address. |
domain_invalid | 400 | The domain is not valid; write it like shop.yourdomain.com, without https:// or paths. |
domain_reserved | 400 | That domain belongs to Lid; use one of your own. |
domain_taken | 409 | That domain is already connected to another site. |
domain_not_found | 404 | The site has no custom domain connected. |
System apps and Lida keys
| Type | Status | Meaning |
|---|---|---|
admin_required | 403 | Only a Lid admin's key can do this: create a system app, its versions and its logs. |
not_a_store | 409 | This is a system app: it has no catalog, preview or store code. Use create_system_release and publish_app with releaseId. |
not_a_system | 409 | That site is a store: it doesn't take system versions. Build it with the Builder tools. |
invalid_manifest | 400 | lid-system.json is not valid: details.field says which field fails. Fix it, package again and create another version. |
invalid_release | 400 | The package is not a valid .tar.gz (absolute paths, "..", links outside or no lid-system.json at its root) or its size is not the one you declared. |
release_not_found | 404 | That version doesn't exist or its package wasn't uploaded yet: upload the .tar.gz with the howTo command and publish again. |
sha256_mismatch | 400 | The package that reached the server doesn't have the SHA-256 you declared. Compute it again with sha256sum and create another version. |
release_too_large | 413 | The package is over 150 MB. Leave out node_modules, .next, dist and coverage. |
host_agent_outdated | 409 | This app's server doesn't take system apps yet (it needs host-agent 0.14.0). Tell the Lid team. |
release_conflict | 409 | That version is already on the server with another SHA-256. Create a new version with create_system_release. |
piece_required | 400 | On a system app, logs need the piece: one from the manifest, postgres or redis. |
piece_not_found | 404 | That piece isn't in the published version. Check the names in get_app_status. |
lida_key_name_invalid | 400 | Give the key a name of 1 to 60 characters. |
lida_key_limit | 409 | The account already has 5 Lida keys. Remove one to create another. |
lida_key_not_found | 404 | That Lida key doesn't exist or isn't the account's. |
Lida on sites and system apps
| Type | Status | Meaning |
|---|---|---|
confirm_required | 400 | confirm: true is missing. It costs money: ask the person first and repeat with confirm: true. |
site_lida_web_needs_plan | 409 | Choose a plan for your site to connect it to Lida. |
site_lida_web_blocked | 409 | Lid's team turned off this site's connection to Lida. |
site_lida_web_owner_only | 403 | Only the site owner connects their site to Lida. |
lida_web_invalid | 400 | Send on (true or false) and, if you want, capCents. |
invalid_extra_cap | 400 | The monthly limit is 0 (only the site's plan) or from $1 to $1,000 (100 to 100,000 cents). |
extra_cap_unavailable | 409 | The monthly limit is set once the account pays in dollars. |
admin_only | 403 | Only an API key of a Lid team account can do that. |