Starter API keys and the playground sign with a test certificate that is not publicly trusted.

LENS PROOF SIGN API

Errors

Every error response has a JSON body with a stable code and a message for people, and the status tells you whether a retry can help.

View as Markdown

Error body

json
{
  "error": {
    "code": "rate_limited_per_minute",
    "message": "This organization has reached its per-minute limit."
  }
}

Branch on error.code. The message is a plain sentence that can change, so show it to people or log it, but don't parse it.

Some errors also carry a header. A 401 has WWW-Authenticate: Bearer, a 405 has Allow: POST, and a 429, a 402 with credit_limit_reached, or a 503 with server_busy has Retry-After in whole seconds.

Every response from POST /v1/sign and POST /v1/validate, success or error, carries X-Request-Id. It is the id of that request in Lens Proof's own record, so quote it when you ask about a request. The record holds no file data. A 402 or 429 from signing also carries the X-Lens-* headers that show where your organization stands against its limits, described in Limits.

Error codes

StatusCodeMeaningWhat to do
400unsupported_requestThe request has a query string or a header outside the accepted list.Send only the file and the accepted headers, as listed in Headers.
400invalid_ai_disclosureX-Lens-AI-Source or X-Lens-AI-Oversight has an unsupported value, or X-Lens-AI-Oversight was sent without X-Lens-AI-Source.Use the supported AI disclosure header values in Headers, or omit both headers.
400ai_disclosure_requiredThe API key requires an AI disclosure policy, and X-Lens-AI-Source was omitted.Send X-Lens-AI-Source, or use a key whose policy does not require AI disclosure.
400ai_disclosure_lockedThe API key locks AI disclosure to configured values, and the request sent a conflicting AI disclosure header.Omit the AI disclosure headers to apply the key's locked values, or send headers that match the key's policy.
400unrecognized_fileThe body is not a file of any supported media type.Send the raw bytes of the file, not a form upload, base64 text, JSON, or the file's path. With curl, put @ before the path, as in --data-binary @photo.jpg.
401unauthorizedThe key is missing, malformed, unknown, or wrong.Check the Authorization header and the key. A retry with the same key gets the same answer.
402insufficient_creditsYour trial organization has used all of its starter signatures.Contact sales for more API access.
402credit_limit_reachedYour organization reached its monthly credit limit. Signing resumes at 00:00 UTC on the first day of the next month.Do not retry before then. Retry-After is the number of seconds until the count starts again. An admin can ask for a higher limit in the developer console, or contact sales. The refused request does not count.
402billing_holdSigning is on hold for your organization. The message says whether Lens Proof put the hold on, or an invoice is past due, and when an invoice holds signing it names the invoice number. Your keys are kept.Pay the invoice the message names, quoting its number as the payment reference, or contact sales. An organization admin can find the invoice in the developer console, under Billing. Signing resumes on the same keys when the hold ends. Validation is not held.
403origin_not_allowedThe request has an Origin header, which browsers send.Call the API from your server, not from a web page.
403key_revokedThe key was revoked.Use another key, or ask an organization admin to create one in the developer console.
403key_expiredThe key has expired.Use another key, or ask an organization admin to rotate it or create one in the developer console.
403customer_pausedAPI access is not open for your organization: it is paused, or not approved yet.Contact sales.
404not_foundThe API is not enabled on this host.Check that the URL is https://sign-api.lensproof.app/v1/sign or https://sign-api.lensproof.app/v1/validate.
405method_not_allowedThe method is not POST.Send a POST request.
413file_too_largeThe file is larger than the cap for its type: 10 MB, or 30 MB for a video (32 MB when you validate one).Send a file within that cap. See Limits.
415unsupported_media_typeThe Content-Type is missing or is not a supported media type.Set Content-Type to one of the supported media types.
415type_mismatchThe bytes of the file are not the type that Content-Type names.The message names the type the bytes turned out to be. Send the file again with Content-Type set to that type. The file's name plays no part.
422unreadable_fileThe file sent to POST /v1/sign is the type it declares, but it could not be read for signing. It may be damaged or incomplete, for example a video cut off partway, or built in a way that is not supported.A retry gets the same answer. Check that the file opens, or export it again, then send the new file.
422no_credentialsThe file sent to POST /v1/validate has no Content Credentials.Nothing to validate. Send a file that carries Content Credentials.
422manifest_unreadableThe file sent to POST /v1/validate has Content Credentials that could not be read.The Content Credentials are damaged or not in a form the validator reads. A retry gets the same answer.
422remote_manifest_not_fetchedThe file sent to POST /v1/validate points to Content Credentials stored elsewhere.The API does not fetch them. Validate a file with Content Credentials embedded in it.
422report_too_largeThe validation report would be larger than 16 MB.A retry gets the same answer. Contact Lens Proof if you need this file validated.
429rate_limited_per_minuteYour organization reached its limit for this minute.Wait the number of seconds in Retry-After, then retry.
429rate_limited_per_dayYour organization reached its limit for this UTC day.Wait the number of seconds in Retry-After, then retry.
429trial_daily_capStarter signing reached its daily capacity across all trial accounts.Wait the number of seconds in Retry-After, or contact sales for more API access.
500internal_errorThe API hit an error it did not expect.Retry with backoff, and contact Lens Proof if it keeps happening.
502signing_failedSigning failed, and no file was returned.Retry with backoff, and contact Lens Proof if it keeps happening.
502validation_failedValidation failed, and no report was returned.Retry with backoff, and contact Lens Proof if it keeps happening.
503service_unavailableSigning or validation is not available right now.Retry with backoff.
503server_busyThe server is already signing or validating as many files as it can.Wait the number of seconds in Retry-After, then retry.
504validation_timeoutValidation took longer than 30 seconds, and no report was returned.Retry once. A file that times out again is likely to keep timing out.

Limits explains which errors count toward your rate limits and how to retry. Requests to POST /v1/validate have their own limit, described in Limits.