Apilyn DocsDeveloper portal

Public error codes (/v1)

All public JSON errors use the envelope:

{
  "error": {
    "code": "validation_error",
    "message": "Request validation failed.",
    "details": {},
    "request_id": "req_…"
  }
}

error.code is stable API surface. New codes may be added; existing codes must not be repurposed. Source of truth in code: apilyn.api.error_codes.PUBLIC_ERROR_CODES.

Common / transport

CodeTypical HTTPMeaning
validation_error422Request body/query failed schema validation
unauthorized401Generic auth failure (fallback)
missing_bearer401Authorization: Bearer … missing
invalid_token401JWT/access token invalid or expired
forbidden403Generic authorization failure (fallback)
permission_denied403Actor lacks required RBAC permission
user_actor_required403Endpoint requires a user-backed actor (not API key alone)
not_found404Generic missing resource (fallback)
rate_limited429RPM / soft-rate limit
http_error*Unstructured HTTPException fallback
internal_error5xxUnexpected server failure (message sanitized)
missing_org_header400X-Org-Id required for JWT actors
invalid_org_header400X-Org-Id is not a UUID
org_mismatch403X-Org-Id does not match API key org
org_not_found404Organization missing
membership_required403Actor is not an active org member

API keys / auth

CodeTypical HTTPMeaning
invalid_api_key401Key format/secret invalid
api_key_revoked401Key revoked or expired
environment_mismatch401Live/sandbox mismatch
insufficient_scope403API key lacks required scope
unknown_scopes / scopes_required403Scope validation on create/rotate
api_key_not_found404Key id unknown in org

Jobs / pipelines

CodeTypical HTTPMeaning
invalid_idempotency_key400Missing/invalid Idempotency-Key
idempotency_conflict409Same key, different payload fingerprint
idempotency_race409Concurrent create race
pipeline_not_found404Unknown pipeline name
pipeline_version_mismatch400Unsupported pipeline version
invalid_inputs / input_not_found / input_not_ready / input_expired400/404/409Upload inputs invalid
job_not_found404Unknown job id
invalid_state409Illegal state transition (e.g. cancel)
hard_limit / concurrent_limit / quota_exceeded429Usage caps
output_not_found / output_not_ready / retention_expired404/409/403Artifact download

Storage / intake

CodeTypical HTTPMeaning
upload_not_found / upload_missing / upload_gone404/410Upload lifecycle
payload_too_large / size_limit_exceeded413Size caps
invalid_file_type / malformed_document / decompression_bomb400Intake rejection
malware_detected422Malware scanner quarantine
scanner_unavailable503Fail-closed scanner unavailable
retention_expired403Outside retention window

Sync tools

CodeTypical HTTPMeaning
tool_not_found404Unknown tool name
invalid_parameters400Tool parameter validation
ssrf_blocked400URL/tool SSRF policy
capability_unavailable400Optional runtime/binary not provisioned
tool_timeout / tool_failed408/500Execution failure

Webhooks

CodeTypical HTTPMeaning
blocked_hostname / blocked_ip422SSRF on endpoint URL
invalid_events400Subscribed events invalid
webhook_not_found / delivery_not_found404Missing resources

Accounts / billing

CodeTypical HTTPMeaning
plan_not_found / org_slug_taken / membership_exists404/409Org/membership admission
email_unverified403Identity email not verified
invalid_stripe_signature / portal_origin_denied400Billing webhook/portal

Client guidance

  1. Branch on HTTP status for coarse handling; use error.code for precise UX.
  2. Always log/correlate request_id.
  3. Treat unknown codes as http_error-class failures without crashing.
  4. Never assume message is stable English copy — codes are the contract.