Skip to main content
GET
Get the status of an observation request

Authorizations

Authorization
string
header
required

Your API key, shaped sp_<key_id>_<secret>, sent as Authorization: Bearer sp_.... It identifies your organization, not a person. Your organization owns the agents, holds the credit, and is billed. Every key your organization holds reaches the same things, so you rotate a key by minting the new one, deploying it, and revoking the old one.

Keep the key on your server. A request that carries a Sec-Fetch-Site header is refused with 400, because only a browser sets that header. Priors sends no CORS headers, so a browser blocks the call before it leaves the page. The secret is shown once when the key is minted and is stored only as a hash. A lost secret is replaced, never recovered.

An administrator of your organization mints and revokes keys in the Priors application, under Settings. There is no endpoint for it: a key reaches your whole organization, so issuing one is an act of administration.

Headers

X-SP-End-User
string

Your own identifier for the person this request acts for: an account number, a row id, anything stable on your side. It works only with a partner API key. The value is not stored. Priors hashes it together with your organization id, so two clients that send the same string are still two different people.

With the header, you reach the threads that same person created and no others. A new thread is recorded against that person, and GET /v1/agents/{agent_id} returns that person's conversations only. Without the header, the key acts as the organization and reaches every thread on every agent it owns. Learned memory is shared across the agent either way. Only the thread list narrows.

Sent with anything that is not a partner API key, the header returns 400 instead of being ignored. Sent empty or as whitespace, it also returns 400, and it is never read as absent: absent means the whole organization, which is wider access than you asked for. Surrounding whitespace is removed. The 255-character limit is measured on the value as sent.

Required string length: 1 - 255
Pattern: \S

Path Parameters

agent_id
string
required

Unique managed memory-agent identifier.

Maximum string length: 32
Pattern: ^agent_[0-9A-HJKMNP-TV-Z]{26}$
thread_id
string
required

Unique thread identifier scoped to the agent.

Maximum string length: 33
Pattern: ^thread_[0-9A-HJKMNP-TV-Z]{26}$
observation_id
string
required

Identifier of an accepted observation request, scoped to the thread.

Maximum string length: 30
Pattern: ^obs_[0-9A-HJKMNP-TV-Z]{26}$

Response

Observation request status

agent_id
string
required

Server-generated agent identifier.

Pattern: ^agent_[0-9A-HJKMNP-TV-Z]{26}$
thread_id
string
required

Server-generated thread identifier.

Pattern: ^thread_[0-9A-HJKMNP-TV-Z]{26}$
observation_id
string
required

Server-generated observation identifier.

Pattern: ^obs_[0-9A-HJKMNP-TV-Z]{26}$
status
enum<string>
required

queued, converting, and processing: still running; poll again. interrupted: a Priors restart paused the request, and it resumes by itself where it stopped, with nothing charged again; keep polling. committed, failed, and cancelled are final and never change.

Available options:
queued,
converting,
processing,
committed,
failed,
cancelled,
interrupted
turns_total
integer
required

Turns in this observation request. For a document upload this is the number of pieces it was split into, because one piece is exactly one turn.

Required range: x >= 0
turns_processed
integer
required

Turns read so far. Memory for a turn is written shortly after it is read, so reaching turns_total does not mean completion. Only status committed does.

Required range: x >= 0
queue_depth
integer

Observation jobs still pending ahead of this one on this thread. Zero means this thread's backlog is drained.

Required range: x >= 0
error
string | null

Failure detail when status is failed.

queued
boolean

True while the job waits its turn behind another file this agent is reading (the status is converting meanwhile). It starts by itself. Nothing to do.

resumed_at
string<date-time> | null

When a Priors restart paused this request and it resumed where it stopped, with nothing charged again. Null when it ran without a break. Show "resumed after an update, nothing to do" instead of an error.

learning
object | null

Set when a job that ended failed or cancelled has settled: which of its turns were not learned into memory, and what was refunded for them. Null while the job runs, when it committed, and for an interrupted job, which resumes by itself.