Reference
Approvals
What an agent asked that only a person may do, and the sends a person wanted to see first.
Calls go to https://address.seleya.ai/api. A refusal is {"error": {"code", "message"}} with its status; every code is in Errors.
Waiting for a person
GET /v1/approvals
Called with a key or a person signed in.
What waits for a person: sends held for approval, and person-only actions agents asked for. Results are paginated with limit (1-100, default 100). Pass next_cursor as cursor with the same filters; null means the end. Each page checks current access. Held mail is oldest first; approvals are newest first. Equal timestamps use the unique id as a stable tiebreaker.
Parameters
-
addressstring, in query - One address.
-
allstring, in query - true includes those already decided.
-
limitinteger, in query -
cursorstring, in query - The previous page's next_cursor.
Answers
- 200
- Done
- 401
- No valid key, session or token
- 404
- Not found, or not yours to see
- 422
- bad_cursor or bad_query: invalid continuation or page size
- 503
- content_unavailable: retained message content is temporarily unavailable
Fields of the 200 answer
-
approvalsarray of Approval -
next_cursorstring, or null - Continuation position, or null at the end. It is not an authorization credential.
curl https://address.seleya.ai/api/v1/approvals \
-H "Authorization: Bearer $SELEYA_KEY"import os, requests
r = requests.get(
"https://address.seleya.ai/api/v1/approvals",
headers={"Authorization": f"Bearer {os.environ['SELEYA_KEY']}"},
)
print(r.status_code, r.json())const r = await fetch("https://address.seleya.ai/api/v1/approvals", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.SELEYA_KEY}` },
});
console.log(r.status, await r.json());{
"approvals": [
{
"id": "7f3c9a2e-0000-4000-8000-000000000001",
"kind": "send",
"summary": "send a meeting invitation to sam@beta.example",
"address": "desk@acme.seleya.email",
"company": "Acme",
"asked_by": "The app Example agent",
"status": "pending",
"decided_at": null,
"created_at": "2026-10-22T12:00:00Z",
"request": {
"to": [
"sam@beta.example"
],
"cc": [],
"subject": "Meeting",
"text": "Can we meet on Tuesday?",
"transport": "auto"
}
}
]
}An ask from its emailed link
POST /v1/approvals/by-link
Called by address.seleya.ai, signed in.
What an emailed link asks, as the confirm page shows it.
Body
-
tokenstring required - The token from the emailed link's fragment.
-
downloadfile -
partstring
Answers
- 200
- Done
- 403
- Current person no longer controls this request
- 404
- Not found, or not yours to see
- 422
- bad_query: select a file
- 503
- content_unavailable: retained message content is temporarily unavailable
Fields of the 200 answer
-
idstring -
kindsend | release | allow_sender | unblock_sender | screening | approvals_mode | set_holder | retire | add_admin | remove_admin | add_contacts | hard_stop_off | use_address -
summarystring, or null -
addressstring, or null -
companystring, or null -
asked_bystring -
statuspending | sending | approving | approved | rejected | failed | prepared -
decided_atstring, or null -
created_atstring -
requestobject
Decide from the link
POST /v1/approvals/by-link/decide
Called by address.seleya.ai, signed in.
The confirm page's button. Opening the link decides nothing.
Body
-
tokenstring required - The token from the emailed link's fragment.
-
decisionapprove | reject required - approve carries it out; reject drops it.
Answers
- 200
- Done
- 403
- Not allowed for this caller
- 404
- Not found, or not yours to see
- 409
- Conflicts with the current state
- 422
- A value is refused; the message says which
- 503
- content_unavailable: retained message content is temporarily unavailable
One ask
GET /v1/approvals/{id}
Called with a key or a person signed in.
One ask, with what was asked and where it stands. Full content is a JSON manifest with stable text/HTML/file part ids. File retrieval requires this delivery or approval, not an uploader id. Refresh checks current authority and held-mail restrictions. Issued URLs remain bearer capabilities for five minutes after issuance.
Parameters
-
idstring, in path required - Its id.
-
downloadfile, in query - Retrieve a fresh capability after current authorization.
-
partstring, in query - Stable file part id with download=file.
Answers
- 200
- Done
- 401
- No valid key, session or token
- 404
- Not found, or not yours to see
- 422
- bad_query: invalid download selection
- 503
- content_unavailable: retained content unavailable; retry later
Fields of the 200 answer
-
idstring -
kindsend | release | allow_sender | unblock_sender | screening | approvals_mode | set_holder | retire | add_admin | remove_admin | add_contacts | hard_stop_off | use_address -
summarystring, or null -
addressstring, or null -
companystring, or null -
asked_bystring -
statuspending | sending | approving | approved | rejected | failed | prepared -
decided_atstring, or null -
created_atstring -
requestobject
curl https://address.seleya.ai/api/v1/approvals/ID \
-H "Authorization: Bearer $SELEYA_KEY"import os, requests
r = requests.get(
"https://address.seleya.ai/api/v1/approvals/ID",
headers={"Authorization": f"Bearer {os.environ['SELEYA_KEY']}"},
)
print(r.status_code, r.json())const r = await fetch("https://address.seleya.ai/api/v1/approvals/ID", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.SELEYA_KEY}` },
});
console.log(r.status, await r.json());{
"id": "7f3c9a2e-0000-4000-8000-000000000001",
"kind": "send",
"summary": "send a meeting invitation to sam@beta.example",
"address": "desk@acme.seleya.email",
"company": "Acme",
"asked_by": "The app Example agent",
"status": "pending",
"decided_at": null,
"created_at": "2026-10-22T12:00:00Z",
"request": {
"to": [
"sam@beta.example"
],
"cc": [],
"subject": "Meeting",
"text": "Can we meet on Tuesday?",
"transport": "auto"
}
}Approve
POST /v1/approvals/{id}/approve
Called by address.seleya.ai, signed in.
Approves and carries it out. A person only.
Parameters
-
idstring, in path required - Its id.
Answers
- 200
- Done
- 401
- No valid key, session or token
- 403
- Not allowed for this caller
- 404
- Not found, or not yours to see
- 409
- Conflicts with the current state
- 503
- content_unavailable: retained message content is temporarily unavailable
Reject
POST /v1/approvals/{id}/reject
Called by address.seleya.ai, signed in.
Refuses it; nothing is done. A person only.
Parameters
-
idstring, in path required - Its id.
Answers
- 200
- Done
- 401
- No valid key, session or token
- 403
- Not allowed for this caller
- 404
- Not found, or not yours to see
- 409
- Conflicts with the current state
Fields of the 200 answer
-
idstring -
kindsend | release | allow_sender | unblock_sender | screening | approvals_mode | set_holder | retire | add_admin | remove_admin | add_contacts | hard_stop_off | use_address -
summarystring, or null -
addressstring, or null -
companystring, or null -
asked_bystring -
statuspending | sending | approving | approved | rejected | failed | prepared -
decided_atstring, or null -
created_atstring -
requestobject