Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.oneperfectslice.ai/llms.txt

Use this file to discover all available pages before exploring further.

When a request fails, the OnePerfectSlice API returns a JSON object with a machine-readable code and a human-readable message:
{
  "error": {
    "code": "INVALID_FILTERS",
    "message": "Filter validation failed",
    "details": {
      "field": "crmDealStages",
      "maxAllowed": 100,
      "validValuesEndpoint": "/api/public/v1/filters/crm-deal-stages"
    }
  }
}
FieldTypeWhat it contains
codestringMachine-readable identifier in UPPER_SNAKE_CASE
messagestringPlain-English explanation of what went wrong
detailsobject or nullAdditional context when available (e.g., which field failed, valid alternatives)

HTTP status codes

StatusWhat it meansWhat to do
200Success
202Accepted — an async slice run has startedPoll GET /slice-runs/{id} for results
400Bad request — invalid parameters or filtersFix the request body; check filter endpoints for valid values
401Unauthorized — missing or invalid API keyCheck your key; see Authentication
403Forbidden — usage limit exceededWait for your billing cycle to reset or contact support
404Resource not foundVerify the ID and that your key has access to this team’s data
409Conflict — idempotency mismatch or run not readyUse a new idempotency key, or wait for the run to complete
429Concurrency limit exceededWait for active runs to finish; see Rate Limiting
503Timeout or temporary unavailabilityRetry with exponential backoff (1s → 2s → 4s)

Error code reference

Authentication (401)

CodeWhen it happens
MISSING_TOKENNo Authorization: Bearer header in the request
INVALID_TOKENThe key doesn’t match any active token
TOKEN_REVOKEDAn Org Admin revoked this key
TOKEN_EXPIREDThe key has passed its expiration date

Validation (400)

CodeWhen it happens
INVALID_REQUESTThe request body isn’t valid JSON
INVALID_FILTERSOne or more filter values are invalid
DATE_RANGE_TOO_WIDEDate range exceeds the 90-day lookback limit
FILTER_ARRAY_TOO_LARGEA filter array has more than 100 items
INVALID_IDEMPOTENCY_KEYIdempotency key is empty or longer than 255 characters

Not found (404)

CodeWhen it happens
SLICE_NOT_FOUNDNo slice with this key exists for your team
RUN_NOT_FOUNDNo run with this ID exists or it belongs to a different org
Resources in a different organization always return 404 — never 403 — so you can’t determine whether a resource exists outside your org.

Conflict (409)

CodeWhen it happens
IDEMPOTENCY_KEY_CONFLICTYou reused an idempotency key with different arguments
RUN_NOT_COMPLETEDYou requested evidence for a run that hasn’t finished yet

Limits (403 / 429)

CodeStatusWhen it happens
USAGE_LIMIT_EXCEEDED403Your team’s monthly AI insights quota is exhausted
CONCURRENT_RUN_LIMIT429Your team already has 5 active slice runs

Timeouts (503)

CodeWhen it happens
PREVIEW_COUNT_TIMEOUTPreview count query took too long — try narrowing your filters
RUN_LIST_TIMEOUTRun history query took too long
RUN_LOOKUP_TIMEOUTRun detail lookup took too long
EVIDENCE_TIMEOUTEvidence retrieval took too long
POST_SEARCH_TIMEOUTPost search took too long — try a shorter date range
FILTER_LOOKUP_TIMEOUTFilter lookup took too long
BILLING_UNAVAILABLEUsage gating service is temporarily down
IDEMPOTENCY_KEY_IN_PROGRESSAnother request with this idempotency key is still being processed — retry in a few seconds