Developer

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.

JSON
{
  "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.

TypeScript
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);
  }
}
TypeScript
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

TypeStatusMeaning
bad_request400The request is malformed or missing something the endpoint needs.
validation_error400A field failed validation; param names it when known.
unauthorized401No valid API key was sent.
payment_required402The account does not have enough balance for this call: credits or, with dollar billing, its extra usage.
forbidden403The API key or its owner cannot do this.
not_found404Nothing matches that path or id.
method_not_allowed405That HTTP method is not supported on this path.
conflict409The request collides with the current state of the resource.
gone410The resource existed but was archived or removed.
payload_too_large413The request body or file exceeds the size limit.
unsupported_media_type415The request's Content-Type is not accepted here.
unprocessable422The request is well-formed but cannot be processed as sent.
rate_limited429Too many requests; retry after the seconds in Retry-After.
internal_error500Something failed on our side. The detail stays in the server log under requestId.
bad_gateway502An upstream service Lid depends on returned an invalid response.
service_unavailable503The service is temporarily down; retry with backoff.
gateway_timeout504An upstream service Lid depends on took too long to answer.

Authentication & API key

TypeStatusMeaning
missing_bearer401The Authorization: Bearer header is missing.
invalid_key_format401The API key does not look like a Lid key (it should start with lpmcp_).
invalid_or_inactive_key401The key does not exist, was removed, or is inactive. A removed key never comes back: the owner regenerates it in Settings → Development.
key_expired401The 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_linked403The key is not linked to a user account yet.
key_inactive403The key was removed by its owner or an admin.
user_not_found404The user behind the key no longer exists.
account_blocked403The account that owns the key is blocked; the API does not accept its calls.
insufficient_scope403The 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_scoped403The key belongs to a site and the route or site is a different one.
key_tasks_only403The 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_managed409Lid 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_disabled404Site keys are turned off.
site_tool_not_found404That tool doesn't exist.
site_tool_unavailable409That tool isn't available on this site (its piece is off).
site_tool_invalid400The tool's arguments aren't valid.
insufficient_credits402The account ran out of credits for this action.
origin_not_allowed403A 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

TypeStatusMeaning
product_creation_limit429You hit the daily or lifetime cap on product creation for this key (or, for the day, for your account).
mcp_creation_disabled403Creation with API keys is turned off (admin kill-switch).
creation_limit_reached403You hit the creation cap for this resource.

Idempotency

TypeStatusMeaning
idempotency_key_required400This call moves money: send an Idempotency-Key header.
idempotency_key_invalid400The Idempotency-Key header is malformed.
idempotency_key_reused422That key was already used for a different request body.
idempotency_key_failed409The original request with that key failed; fix the input before retrying with a new key.
idempotency_key_in_progress409A request with that key is still being processed; retry shortly.

Account & products

TypeStatusMeaning
no_solana_wallet400The account has no Solana wallet linked yet.
product_not_found404No product matches that PDA.
not_product_owner403The wallet behind the key does not own this product.
not_your_product403This product belongs to a different account.
no_deliverable_content400The product has no file attached yet; buyers can't receive anything.
product_archived410The product was archived by its creator and can't be bought.
product_blocked410The product was blocked by an admin.
agent_wallet_provision_failed500The agent wallet for this key could not be created; try again in a moment.

Files

TypeStatusMeaning
file_required400The request needs a file and none was sent.
file_empty400The uploaded file has no content.
file_too_large413The file exceeds the 25 MB cap.
invalid_url400The url is not a valid http or https address.
blocked_url400The url points to a private or local network; use a public address.
fetch_failed400Lid could not download the file at that url; check that it is public and try again.
too_many_redirects400The url redirects too many times; pass the final address.

Purchases & sales

TypeStatusMeaning
affiliate_not_found400No affiliate matches that code.
affiliate_without_wallet400The affiliate has no wallet to receive commission.
signature_not_found404No transaction matches that signature yet; the listener may not have confirmed it.
transaction_failed400The Solana transaction failed or was rejected.
price_above_max400The product's price is above the maxPriceUsdc cap you set.
insufficient_agent_usdc400The agent wallet does not have enough USDC for this purchase.
sponsor_missing500The gas sponsor is not configured; the transaction cannot be paid for.
sold_out400The product sold out.
own_product400The buyer is the creator of the product and cannot buy it.
sale_not_started400The product's sale has not opened yet; the message says when it does.
product_paused400The creator paused the product; it cannot be bought right now.
affiliate_vault_missing400The sharer in the purchase cannot receive their cut yet; buy without them or try again later.

Bounties & pools

TypeStatusMeaning
bounty_without_pool400This bounty has no funded pool yet.
pool_not_open400The pool is not open for new assignments.
pool_not_custodial403The pool is not custodial; Lid cannot sign on its behalf.
insufficient_pool_funds400The pool does not have enough funds for this payout.
prizes_below_minimum400The prizes add up to less than the minimum of 10 digital dollars.
site_only_requires_site400A challenge shown only on your site needs a published site.
bounty_blocked410Lid's moderation blocked this challenge.
prize_already_assigned409That submission's prize is already assigned, so its verdict can no longer change.
no_winners400There are no prizes to assign.
duplicate_winner_wallet400The same wallet appears in two prizes; give each wallet one prize.

Sites (Builder)

TypeStatusMeaning
sites_disabled404The Builder is not active for the key's account (a Lid admin turns it on).
site_not_found404That site does not exist or does not belong to the key's account.
site_busy409Lida or another write is working on the site, or the draft changed while you were writing; read the files again and retry.
site_limit_reached409The account reached the cap of live sites it can create with an API key; work on one it already has.
site_name_invalid400The site name is empty or longer than 80 characters.
site_config_invalid400The site config is not valid (brand, language, modules or featured products).
site_memberships_unavailable400Memberships cannot be turned on: the platform has no active subscriptions.
challenges_site_only409Turning 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_suspended409The site is suspended; it cannot be edited or published.
site_payment_required402Publishing 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_assisted409The 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_found404create_app with forClient: there is no account with that email, wallet or username.
site_paused409The site is paused; turn it back on to publish.
site_conflict409The site server already has that site; read its status again and retry.
slug_invalid400The slug must be 3 to 40 lowercase letters, numbers or hyphens.
slug_reserved400That word is reserved and cannot be used as a slug.
slug_taken409Another site already uses that slug.
no_capacity503There is no room on the site servers right now; try again later.
sites_pass_key_missing503The site pass key is not configured on the Lid server.
sites_buyer_key_missing503The site buyer pass keys are not configured on the Lid server.
site_pass_mark_invalid400The pass does not carry a valid browser mark.
not_store_owner403This account does not manage that store.
builder_disabled403The Builder is not active for your account.
store_suspended409The store is suspended; its admin panel cannot be opened.
return_url_invalid400The return address does not belong to that store.
buyer_pass_invalid400The buyer pass is missing the operation or the product.
purchase_not_found409That purchase is not on the account yet; wait a few seconds and retry.
store_not_connected409The store is not connected to the account yet.
connection_not_found404That store is not connected to the account.
host_unreachable502The site's server is not responding; try again in a few minutes.
host_disconnected503A 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_progress409Lida is still working on the previous request; wait for it to finish.
build_message_invalid400The request to Lida is empty or longer than 4000 characters.
build_run_not_found404That Lida turn does not exist.
builds_per_hour429The hourly limit of requests to Lida was reached.
lida_daily_limit429Today'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_insufficient402ask_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_invalid400The code breaks the site rules; details says which file or rule failed.
site_content_blocked400The 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_invalid400That file path is not valid or is outside the site zone.
source_file_not_found404That file does not exist in the draft.
sandbox_busy409Another preview is in use on that server; try again in a few minutes.
preview_unavailable503The preview is not available on that server.
screenshots_unavailable503The capture browser is busy or unavailable; retry in a few seconds.
media_missing400The image is missing: send url or dataBase64.
media_url_invalid400The image address must start with http:// or https://.
media_too_large413The image is over 8 MB.
media_type_invalid415Only png, jpg, webp, gif, svg or avif are accepted.
media_quota413The site reached its image quota; delete one to upload another.
media_download_failed400The image could not be downloaded from that address.
domain_invalid400The domain is not valid; write it like shop.yourdomain.com, without https:// or paths.
domain_reserved400That domain belongs to Lid; use one of your own.
domain_taken409That domain is already connected to another site.
domain_not_found404The site has no custom domain connected.

System apps and Lida keys

TypeStatusMeaning
admin_required403Only a Lid admin's key can do this: create a system app, its versions and its logs.
not_a_store409This is a system app: it has no catalog, preview or store code. Use create_system_release and publish_app with releaseId.
not_a_system409That site is a store: it doesn't take system versions. Build it with the Builder tools.
invalid_manifest400lid-system.json is not valid: details.field says which field fails. Fix it, package again and create another version.
invalid_release400The 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_found404That version doesn't exist or its package wasn't uploaded yet: upload the .tar.gz with the howTo command and publish again.
sha256_mismatch400The package that reached the server doesn't have the SHA-256 you declared. Compute it again with sha256sum and create another version.
release_too_large413The package is over 150 MB. Leave out node_modules, .next, dist and coverage.
host_agent_outdated409This app's server doesn't take system apps yet (it needs host-agent 0.14.0). Tell the Lid team.
release_conflict409That version is already on the server with another SHA-256. Create a new version with create_system_release.
piece_required400On a system app, logs need the piece: one from the manifest, postgres or redis.
piece_not_found404That piece isn't in the published version. Check the names in get_app_status.
lida_key_name_invalid400Give the key a name of 1 to 60 characters.
lida_key_limit409The account already has 5 Lida keys. Remove one to create another.
lida_key_not_found404That Lida key doesn't exist or isn't the account's.

Lida on sites and system apps

TypeStatusMeaning
confirm_required400confirm: true is missing. It costs money: ask the person first and repeat with confirm: true.
site_lida_web_needs_plan409Choose a plan for your site to connect it to Lida.
site_lida_web_blocked409Lid's team turned off this site's connection to Lida.
site_lida_web_owner_only403Only the site owner connects their site to Lida.
lida_web_invalid400Send on (true or false) and, if you want, capCents.
invalid_extra_cap400The monthly limit is 0 (only the site's plan) or from $1 to $1,000 (100 to 100,000 cents).
extra_cap_unavailable409The monthly limit is set once the account pays in dollars.
admin_only403Only an API key of a Lid team account can do that.