Documents and access requests
The demo company
The demo company comes with demonstration agents, which use this interface from inside the platform. Connecting your company’s own agents is part of a company deployment, arranged on request: request a quote.
Two things come before an action: the document it concerns, if it has one, and the agent’s access to the service through which it is executed.
Uploading a document
A content action, for example sending an offer, concerns a document. The agent first uploads the document’s exact bytes, then names it in the action. The example below is an illustration only: on synarun.com, this document would be refused, as explained at the end of this section.
POST /v1/content-artifacts HTTP/1.1
Host: synarun-api.example
Authorization: DPoP xNpV-O7gPKnPYmv__XVGDr3WpScgL1WiIPORgCr6Gzw
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVkRFNBIiwiandrIjp7…
Content-Type: application/json
{
"media_type": "text/plain; charset=utf-8",
"content_base64": "U2FtcGxlIG9mZmVyIG5vLiAxNzogMTIlIGRpc2NvdW50LCBwYXltZW50IHdpdGhpbiAzMCBkYXlzLgo="
}
- The only accepted type is
text/plain; charset=utf-8. - The whole body of the HTTP request, with the document in base64, is at most 64 KiB, that is 65,536 bytes; a larger one gets 413
PROTOCOL_PAYLOAD_TOO_LARGE. Base64 makes the document a third longer, so the document itself has between 1 and 49,104 bytes, with the body written without spaces. Synarun’s own limit on a document, 262,144 bytes, is therefore never reached through this interface. digestissha256:followed by the SHA-256 of the document’s bytes, in hexadecimal; it identifies the document from then on. A document cannot be changed after the upload.- Uploading the same bytes again is safe: the answer is 201 when the document is recorded now and 200 when it was already there; the
createdfield says which.
On synarun.com, Synarun accepts only the demonstration documents it knows, and only for demo companies; any other document gets 403 FORBIDDEN_ROLE.
{
"digest": "sha256:01a8093e143bede5c79d97a0253ddb627321538904350b21af3504065b5367fc",
"media_type": "text/plain; charset=utf-8",
"size_bytes": 59,
"created_at": "2026-11-24T10:40:11.530Z",
"readings": [],
"created": true
}
The document in the action
The action names the document in the parameter its action type declares for it, for example content_ref, as the action type’s definition gives it (see What the agent needs), with exactly the three values of the upload: { "digest", "media_type", "size_bytes" }. A content action has no economic effect, so it has no max_exposure.
If Synarun has not finished checking the document, the answer is 409 PRECONDITION_NOT_READY, with the retry-after: 2 header. Nothing was decided and the idempotency key was not used: repeat the same HTTP request, with the same key and body.
The agent can read a document’s data at any time, by its digest. readings holds the results of Synarun’s checks, never the values read from the document:
GET /v1/content-artifacts/sha256:01a8093e143bede5c79d97a0253ddb627321538904350b21af3504065b5367fc HTTP/1.1
Host: synarun-api.example
Authorization: DPoP xNpV-O7gPKnPYmv__XVGDr3WpScgL1WiIPORgCr6Gzw
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVkRFNBIiwiandrIjp7…
{
"digest": "sha256:01a8093e143bede5c79d97a0253ddb627321538904350b21af3504065b5367fc",
"media_type": "text/plain; charset=utf-8",
"size_bytes": 59,
"created_at": "2026-11-24T10:40:11.530Z",
"readings": []
}
The company’s services
GET /v1/services lists the services of the agent’s company, whether the agent has access or not, each with its operations and the state of the access: NONE, PENDING or GRANTED. On synarun.com, the services’ names, descriptions and operation labels are in Romanian.
GET /v1/services HTTP/1.1
Host: synarun-api.example
Authorization: DPoP xNpV-O7gPKnPYmv__XVGDr3WpScgL1WiIPORgCr6Gzw
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVkRFNBIiwiandrIjp7…
{
"services": [
{
"service_id": "447d0faa-28ea-4114-adab-386c0c1dd5eb",
"key": "plati",
"name": "Plăți (simulat)",
"description": "Plăți și rambursări simulate, cu bani demonstrativi: nimic nu pleacă.",
"simulated": true,
"operations": [{ "operation": "refund.create", "label": "Rambursare" }],
"access": { "state": "NONE", "grant": null, "last_request": null }
}
]
}
The agent’s tools
GET /v1/tools lists the operations the agent can use, as tools: each operation of a service the agent has access to, except those that move money or carry a document. For each tool, the answer gives its name, the action type and its version, the connection to name in the action, the label, the class (a read or a change), a description, the closed schema of its parameters, with idempotency_key required, and a TypeScript declaration of the call. An operation that is not a tool is listed in left_out, with the reason. The list changes when a person of the company grants or revokes access.
GET /v1/tools HTTP/1.1
Host: synarun-api.example
Authorization: DPoP xNpV-O7gPKnPYmv__XVGDr3WpScgL1WiIPORgCr6Gzw
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVkRFNBIiwiandrIjp7…
{
"schema_version": "1.0",
"tools": [
{
"tool_name": "erp__invoice_read_____________6e4e0e9d86",
"service_key": "erp",
"operation": "invoice.read",
"label": "Citirea facturilor",
"capability": {
"id": "erp.invoice.read",
"version": "1.0.0"
},
"connection_id": "3f6c1e52-8a0d-4b7e-9c21-5d4e8f7a6b10",
"class": "READ_ONLY",
"description": "erp.invoice.read: Citirea facturilor. Citire: nu schimbă nimic la serviciu.",
"effects": [],
"input_schema": {
"additionalProperties": false,
"properties": {
"idempotency_key": {
"description": "Cheia de idempotență a apelului (8–128 caractere: litere, cifre, . _ : -): același apel cu aceeași cheie primește aceeași decizie.",
"maxLength": 128,
"minLength": 8,
"pattern": "^[A-Za-z0-9._:-]{8,128}$",
"type": "string"
},
"invoice_ref": {
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,39}$",
"type": "string"
}
},
"required": [
"invoice_ref",
"idempotency_key"
],
"type": "object"
},
"annotations": {
"readOnlyHint": true,
"destructiveHint": false,
"idempotentHint": true,
"openWorldHint": true
},
"declaration": "/**\n * erp.invoice.read: Citirea facturilor\n * Citire: nu schimbă nimic la serviciu.\n */\nexport declare function erp__invoice_read_____________6e4e0e9d86(input: {\n idempotency_key: string;\n invoice_ref: string;\n}): Promise<…>;\n"
}
],
"left_out": [
{
"service_key": "plati",
"operation": "refund.create",
"reason": "ECONOMIC"
}
]
}
Calling a tool is an action like any other: the agent sends it to POST /v1/action-intents, with the action type, the version and the connection from the list, the parameters and the idempotency key, and receives the decision.
The access request
For a service it has no access to, the agent sends an access request, with a justification: why it needs the access and for what. Only a person of the company can grant it.
POST /v1/access-requests HTTP/1.1
Host: synarun-api.example
Authorization: DPoP xNpV-O7gPKnPYmv__XVGDr3WpScgL1WiIPORgCr6Gzw
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVkRFNBIiwiandrIjp7…
Content-Type: application/json
{
"service_id": "447d0faa-28ea-4114-adab-386c0c1dd5eb",
"justification": "I refund customers for orders returned on time, after the product is checked.",
"operations": ["refund.create"],
"monthly_limit": { "amount_minor": 500000, "currency": "RON" }
}
justificationhas between 10 and 2,000 characters, with no spaces at its start or end and no control characters.operationsholds between 1 and 16 of the service’s operations, each once.monthly_limitisnullor an amount in lei (RON) of at least one minor unit.- If an access request for the same service is already waiting for an answer, the new access request gets 409
APPROVAL_NOT_PENDING.
The answer is 201, with the access request in the PENDING state:
{
"request_id": "6508b106-0b1a-41e5-b43f-7b5028358e04",
"service_id": "447d0faa-28ea-4114-adab-386c0c1dd5eb",
"service_name": "Plăți (simulat)",
"justification": "I refund customers for orders returned on time, after the product is checked.",
"state": "PENDING",
"requested": { "operations": ["refund.create"], "monthly_limit": { "amount_minor": 500000, "currency": "RON" } },
"granted": null,
"requested_at": "2026-11-24T10:45:00.000Z",
"answered_at": null,
"explanation": "Cererea de acces a fost primită și așteaptă răspunsul unei persoane din companie."
}
The answer to the access request
An Owner or a Company admin answers in Decisions › Access requests: they approve the access request in full or in part, or refuse it, each with a confirmation. The agent reads the answer:
GET /v1/access-requests/6508b106-0b1a-41e5-b43f-7b5028358e04 HTTP/1.1
Host: synarun-api.example
Authorization: DPoP xNpV-O7gPKnPYmv__XVGDr3WpScgL1WiIPORgCr6Gzw
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIsImFsZyI6IkVkRFNBIiwiandrIjp7…
{
"request_id": "6508b106-0b1a-41e5-b43f-7b5028358e04",
"service_id": "447d0faa-28ea-4114-adab-386c0c1dd5eb",
"service_name": "Plăți (simulat)",
"justification": "I refund customers for orders returned on time, after the product is checked.",
"state": "PARTIALLY_APPROVED",
"requested": { "operations": ["refund.create"], "monthly_limit": { "amount_minor": 500000, "currency": "RON" } },
"granted": { "operations": ["refund.create"], "monthly_limit": { "amount_minor": 300000, "currency": "RON" } },
"requested_at": "2026-11-24T10:45:00.000Z",
"answered_at": "2026-11-24T11:05:12.000Z",
"explanation": "Accesul a fost aprobat în parte, numai pentru: Rambursare. Limita lunară: 3000,00 RON. Motivul: Pentru început, o limită mai mică este suficientă."
}
The states of an access request are PENDING, APPROVED, PARTIALLY_APPROVED, REFUSED and REVOKED. The explanation field gives the answer in words: the operations granted, the monthly limit and, if the person wrote one, the reason. On synarun.com, these explanations are in Romanian, like the service’s name in service_name.
Access at decision time
An action on a service without an access that covers it is refused before anything is recorded: 403 FORBIDDEN_ROLE, with the keyword access and a sentence that explains the reason, in Romanian on synarun.com. The possible reasons: the service is not granted, the action type is not granted, the granted monthly limit is exceeded, the action’s currency is not that of the granted limit, or the service has been withdrawn.
{
"error": {
"code": "FORBIDDEN_ROLE",
"category": "AUTHORIZATION",
"message": "The signed-in person lacks the role for this operation.",
"retryable": false,
"trace_id": "af672565be45e99abbbc491917704ba5",
"details": {
"errors": [{ "path": "/connection_id", "keyword": "access" }],
"text": "Agentul nu are acces la acest serviciu: transmiteți o cerere de acces din catalog, cu o justificare, iar o persoană din companie o poate aproba."
}
}
}