Skip to main content
The API uses standard HTTP status codes and returns a consistent JSON error body for all error responses.

Error response format

{
  "status_code": 422,
  "error_type": "validation_error",
  "message": "Missing required field: name",
  "request_id": "550e8400-e29b-41d4-a716-446655440000"
}
status_code
integer
The HTTP status code.
error_type
string
A machine-readable error type. See the table below.
message
string
A human-readable explanation of what went wrong.
request_id
string
A unique identifier for the request. Include this when contacting support.

Error types

Error typeStatus codeDescription
invalid_request400The request is malformed or uses an unsupported HTTP method.
unauthenticated401Missing, invalid, or deactivated API key.
insufficient_credits402Your account does not have enough credits for this operation.
forbidden403The API key does not have permission for this action.
not_found404The requested resource does not exist or does not belong to your company.
conflict409The request conflicts with the current state of the resource.
validation_error422The request body is missing required fields or contains invalid values.
rate_limited429Too many requests. Back off and retry after a delay.
internal_error500An unexpected error occurred on the server.

Handling errors with the SDK

import LassoClient, { LassoError } from "@lasso-ai/sdk";

const client = new LassoClient({ apiKey: "lasso_..." });

try {
  await client.tables.get("nonexistent_id");
} catch (err) {
  if (err instanceof LassoError) {
    console.log(err.statusCode);  // 404
    console.log(err.errorType);   // "not_found"
    console.log(err.message);     // "Table not found"
    console.log(err.requestId);   // "550e8400-..."
  }
}