Example requests
Copy these to set policies, ask for a decision and request consent. Open a response to see what comes back.
All paths are under your organization: https://consent.scrambleid.com/orgs/{orgCode}/api/v1. The examples use org acme.
Send a ScrambleID M2M token. Its orgCode must match the path. Each section names the scopes it needs.
The guide explains how it all works, and the API reference lists every field and error.
Policies
Policies decide what happens when an agent wants to call an action on a service: allow it, deny it, or ask for consent first. You set them at three levels, and every level takes the same body.
Scopes: policy.write to set or remove a policy, policy.read to read one.
The levels
| Level | Path | Applies to |
|---|---|---|
| Organization | /orgs/acme/api/v1/policy | Every call in the organization that nothing below decides |
| Service | /orgs/acme/api/v1/services/{service}/policy | Every action on that service that has no policy of its own |
| Action | /orgs/acme/api/v1/services/{service}/actions/{action}/policy | That action on that service, with optional rules on its parameters |
The most specific level that is set decides: a rule whose conditions hold, then the action, then the service, then the organization. If none is set, the call is denied: POST /decisions answers deny. An agent can only ask for consent on such a call by naming the approvers itself, which needs consent.request.notify.
Every level takes { "outcome", "notify"?, "quorum"? }. outcome is allow, deny or consent. notify (who is asked) and quorum (how many must approve, default 1) only go with consent. Actions also take rules.
PUT sets a level, replacing whatever was there. GET reads it (404 when it is not set). DELETE removes it, so the level above decides.
1. Organization default
Ask the security team about anything that has no policy of its own:
PUT/orgs/acme/api/v1/policy
{
"outcome": "consent",
"notify": { "groups": ["Security"] }
}
Response 200
{
"data": {
"outcome": "consent",
"notify": { "groups": [{ "displayName": "Security" }] },
"quorum": null
}
}This is the safety net for the whole organization. Without it, calls that no service or action policy covers are denied. While you are trying things out, { "outcome": "allow" } lets everything through instead.
2. Service default
Let every action on invoice-service through, unless the action has a policy of its own:
PUT/orgs/acme/api/v1/services/invoice-service/policy
{
"outcome": "allow"
}
Response 200
{ "data": { "outcome": "allow", "notify": null, "quorum": null } }A call to lookup on invoice-service is now allowed, while a call on hr-service still falls back to the organization default. A service is any stable id you choose, such as invoice-service. Use the same id in calls and policies; a policy for one service never applies to another.
3. Action default with a rule
Payments need Finance's approval, except small ones:
PUT/orgs/acme/api/v1/services/invoice-service/actions/payment/policy
{
"outcome": "consent",
"notify": { "groups": ["Finance"] },
"quorum": 1,
"rules": [
{ "when": [ { "parameter": "amount", "operator": "lt", "value": 1000 } ], "outcome": "allow" }
]
}
Response 200
{
"data": {
"outcome": "consent",
"notify": { "groups": [{ "displayName": "Finance" }] },
"quorum": 1,
"rules": [
{
"id": "pol_r00_aef12e7a...",
"when": [ { "parameter": "amount", "operator": "lt", "value": 1000 } ],
"outcome": "allow",
"notify": null,
"quorum": null
}
]
}
}The top-level outcome (with its notify and quorum) is the action default: what happens to a call of payment on invoice-service when no rule holds. Each rule overrides it for the calls whose parameters meet its conditions.
amount | Result | Why |
|---|---|---|
| 500 | allowed | The rule holds |
| 5,000 | consent, 1 of Finance | No rule holds: the action default |
| missing | consent, 1 of Finance | An allow rule never holds on doubt |
At the organization and service paths the same top-level fields are that level's default, and there are no rules.
The top-level outcome is optional on an action. With rules only, calls that no rule matches fall through to the service default, then the organization default.
4. A rule with its own approvers
Large payments need two of the CFO and CEO instead of Finance. The rule names its approvers inline, next to "outcome": "consent":
PUT/orgs/acme/api/v1/services/invoice-service/actions/payment/policy
{
"outcome": "consent",
"notify": { "groups": ["Finance"] },
"rules": [
{ "when": [ { "parameter": "amount", "operator": "lt", "value": 1000 } ], "outcome": "allow" },
{ "when": [ { "parameter": "amount", "operator": "gte", "value": 50000 } ],
"outcome": "consent", "notify": { "users": ["cfo", "ceo"] }, "quorum": 2 }
]
}
amount | Who is asked |
|---|---|
| 500 | Nobody, allowed (first rule) |
| 5,000 | 1 of Finance (action default) |
| 75,000 | 2 of cfo and ceo (second rule) |
notifyandquorumonly go with"outcome": "consent". On anallowordenyrule they are refused.- A rule's approvers replace the action default's, they are not added to them. At 75,000, Finance is not asked.
- If several consent rules hold at once, their approvers are combined and the highest
quorumapplies. Adenyfrom any rule that holds beats them all. - A consent rule that names no one borrows the approvers of the nearest level above that names someone: the action default, then the service default, then the organization default. If none does, the agent must name approvers in its consent request, or it gets
422 NOTIFY_REQUIRED.
notify takes up to three lists: users (usernames), emails (primary emails) and groups (group display names), for example { "users": ["alice"], "emails": ["bob@acme.com"], "groups": ["Finance"] }.
Check and remove
Read the organization default (404 when it is not set). The same GET works on the service and action paths:
GET/orgs/acme/api/v1/policy
Admins can also see and change it on their organization's Policy page, /orgs/acme/policy, at the top under Organization default.
See what applies to an action when no rule holds, and every level on the way:
GET/orgs/acme/api/v1/services/invoice-service/actions/payment/policy?effective=true
Remove a level, so the one above decides:
DELETE/orgs/acme/api/v1/services/invoice-service/actions/payment/policy
Response 200
{ "data": { "service": "invoice-service", "action": "payment", "deleted": true } }Decisions
Ask what should happen to one exact call, as your gateway does. Nothing is stored. Scope: policy.evaluate.
POST/orgs/acme/api/v1/decisions
{
"service": "invoice-service",
"action": "payment",
"parameters": { "amount": 5000 }
}
Response 200: consent needed
{
"data": {
"decision": "consent",
"level": "action",
"approvers": { "users": [], "emails": [], "groups": ["Finance"], "quorum": 1, "inherited": false }
}
}Response 200: allowed
{ "data": { "decision": "allow", "level": "rule" } }Response 200: denied
{ "data": { "decision": "deny", "level": "rule" } }With a consent token
Pass the agent's consent token and ScrambleID checks it against the call, so your gateway needs no matching logic. It is good for one call.
POST/orgs/acme/api/v1/decisions
{
"service": "invoice-service",
"action": "payment",
"parameters": { "amount": 75000 },
"consentToken": "eyJhbGciOiJFUzI1NiIs..."
}
Response 200: exact match
{
"data": {
"decision": "allow",
"level": "rule",
"consent": { "requestId": "cr_01M6KS830FJEB3JMBSGRBABYNK", "accepted": true }
}
}Response 403: parameters differ
{ "error": { "code": "CONSENT_PARAM_MISMATCH", "message": "The parameters differ from what was approved" } }Response 403: token expired
{ "error": { "code": "TOKEN_EXPIRED", "message": "The consent token has expired" } }Consent requests
Ask people to approve one call. Scopes: consent.request.write to create, consent.request.read to read.
Create a request
Idempotency-Key is required, so a retry cannot create a second request. x-client-request-id is optional: your own id, echoed on the response.
POST/orgs/acme/api/v1/consent-requests
Idempotency-Key: run-123-step-4
x-client-request-id: client-trace-9f8e7d
{
"service": "invoice-service",
"action": "payment",
"parameters": { "amount": 75000 },
"explanation": "Pay invoice INV-2201 to Acme Supplies."
}
Response 201
{
"data": {
"id": "cr_01M6KS830FJEB3JMBSGRBABYNK",
"status": "PENDING",
"action": "payment",
"parameters": { "amount": 75000 },
"explanation": "Pay invoice INV-2201 to Acme Supplies.",
"quorum": 2,
"version": 1,
"metadata": null,
"createdAt": "2026-11-04T17:20:59Z",
"expiresAt": "2026-11-04T17:35:59Z",
"decidedAt": null,
"callbackUrl": null,
"clientRequestId": "client-trace-9f8e7d",
"service": "invoice-service",
"serviceName": null,
"additionalContext": null,
"recipients": [
{ "userName": "cfo", "notification": { "status": "PENDING", "attempts": 0, "lastAttemptAt": null }, "decision": null },
{ "userName": "ceo", "notification": { "status": "PENDING", "attempts": 0, "lastAttemptAt": null }, "decision": null }
]
}
}Wait for the outcome
This long poll returns as soon as the status is final, or PENDING after timeoutSeconds (up to 25). Repeat until it changes.
GET/orgs/acme/api/v1/consent-requests/cr_01M6KS830FJEB3JMBSGRBABYNK/wait?timeoutSeconds=25
Response 200
{ "data": { "id": "cr_01M6KS830FJEB3JMBSGRBABYNK", "status": "APPROVED", "clientRequestId": "client-trace-9f8e7d" } }Read the approved request
Once approved, the record carries consentToken. Each recipient's notification is about delivery of the push, and decision is what they chose.
GET/orgs/acme/api/v1/consent-requests/cr_01M6KS830FJEB3JMBSGRBABYNK
Response 200
{
"data": {
"id": "cr_01M6KS830FJEB3JMBSGRBABYNK",
"status": "APPROVED",
"quorum": 2,
"decidedAt": "2026-11-04T17:24:10Z",
"clientRequestId": "client-trace-9f8e7d",
"service": "invoice-service",
"recipients": [
{
"userName": "cfo",
"notification": { "status": "SENT", "attempts": 1, "lastAttemptAt": "2026-11-04T17:21:00Z" },
"decision": { "decision": "APPROVE", "decidedAt": "2026-11-04T17:22:31Z" }
},
{
"userName": "ceo",
"notification": { "status": "SENT", "attempts": 1, "lastAttemptAt": "2026-11-04T17:21:00Z" },
"decision": { "decision": "APPROVE", "decidedAt": "2026-11-04T17:24:10Z" }
}
],
"consentToken": "eyJhbGciOiJFUzI1NiIs..."
}
}The record above is shortened.
Decoded consent token
{
"iss": "https://consent.scrambleid.com",
"aud": "https://gateway.scrambleid.com",
"sub": "payments-agent",
"orgCode": "acme",
"jti": "cr_01M6KS830FJEB3JMBSGRBABYNK",
"iat": 1793812859,
"exp": 1793813759,
"consent": {
"service": "invoice-service",
"action": "payment",
"parameters": { "amount": 75000 },
"params_rev": 1,
"digest": "v1:088df375...",
"decided_at": 1793812859919,
"approvers": ["cfo", "ceo"]
}
}Validate the consent token
consentToken is an ES256 JWT signed by the Consent Server. Whoever receives it validates it against this public URL. It is the same for every organization and needs no token:
GEThttps://consent.scrambleid.com/.well-known/jwks.json
Response 200
{
"keys": [
{ "kty": "EC", "crv": "P-256", "x": "1ML0N_WX...", "y": "DddKBgnG...", "kid": "consent-qa-2026-11", "alg": "ES256", "use": "sig" }
]
}Pick the key whose kid matches the token, then check the signature, iss, aud and exp. Compare orgCode, sub and the consent claims with the call, and accept each jti once. This is not one of the URLs on your JWKS configuration page: those check tokens sent to ScrambleID.
Next: the guide explains how it all works, and the API reference lists every field and error.