curl --request GET \
--url https://app.sapientpriors.com/api/v1/agents/{agent_id}/sources \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.sapientpriors.com/api/v1/agents/{agent_id}/sources"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.sapientpriors.com/api/v1/agents/{agent_id}/sources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"agent_id": "<string>",
"sources": [
{
"source_id": "<string>",
"filename": "<string>",
"media_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"size_bytes": 1,
"memory_referenced": true,
"memory_state": "learned",
"in_memory": true,
"href": "<string>",
"upload_state": "learning",
"stop_reason": "cancelled",
"turns_done": 1,
"turns_total": 1,
"can_finish": true,
"figures_unread": 1,
"figures_retry": "running",
"parent_source_id": "<string>"
}
],
"missing_source_ids": [
"<string>"
],
"next_cursor": "<string>"
}{
"error": "<string>",
"code": "<string>",
"request_id": "<string>",
"details": "<string>"
}{
"error": "<string>",
"code": "<string>",
"request_id": "<string>",
"details": "<string>"
}{
"error": "<string>",
"code": "<string>",
"request_id": "<string>",
"details": "<string>"
}{
"error": "<string>",
"code": "<string>",
"request_id": "<string>",
"details": "<string>"
}List an agent's uploaded sources
Returns the authenticated caller’s paginated source library and whether each source is referenced by learned memory.
curl --request GET \
--url https://app.sapientpriors.com/api/v1/agents/{agent_id}/sources \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.sapientpriors.com/api/v1/agents/{agent_id}/sources"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.sapientpriors.com/api/v1/agents/{agent_id}/sources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"agent_id": "<string>",
"sources": [
{
"source_id": "<string>",
"filename": "<string>",
"media_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"size_bytes": 1,
"memory_referenced": true,
"memory_state": "learned",
"in_memory": true,
"href": "<string>",
"upload_state": "learning",
"stop_reason": "cancelled",
"turns_done": 1,
"turns_total": 1,
"can_finish": true,
"figures_unread": 1,
"figures_retry": "running",
"parent_source_id": "<string>"
}
],
"missing_source_ids": [
"<string>"
],
"next_cursor": "<string>"
}{
"error": "<string>",
"code": "<string>",
"request_id": "<string>",
"details": "<string>"
}{
"error": "<string>",
"code": "<string>",
"request_id": "<string>",
"details": "<string>"
}{
"error": "<string>",
"code": "<string>",
"request_id": "<string>",
"details": "<string>"
}{
"error": "<string>",
"code": "<string>",
"request_id": "<string>",
"details": "<string>"
}Authorizations
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.
Path Parameters
Unique managed memory-agent identifier.
32^agent_[0-9A-HJKMNP-TV-Z]{26}$Query Parameters
1 <= x <= 1002048Response
Source library page
Server-generated agent identifier.
^agent_[0-9A-HJKMNP-TV-Z]{26}$Show child attributes
Show child attributes
Server-generated uploaded-source identifier.
^(?:img|src)_[0-9a-f]{32}$1