Approve a request
const url = 'https://api.asklucy.eu/v1/org/requests/req_4aB9cD2eF7gH1jK3mN5p/approve';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"limit":{"amount":"50.00","currency":"EUR"},"note":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.asklucy.eu/v1/org/requests/req_4aB9cD2eF7gH1jK3mN5p/approve \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "limit": { "amount": "50.00", "currency": "EUR" }, "note": "example" }'limit: limit is required, the person’s new limit for the window
(their own override for it; their other windows are unchanged).
model: grants the person the model; a model that is off becomes
selected, one that is everyone needs nothing; 409
model-unavailable when Lucy no longer offers it. 409
request-decided when the request isn’t waiting any more.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Body
Section titled “Request Body”object
Required for limit, the person’s new limit for the window.
object
Decimal amount, e.g. “12.50” (up to 6 decimals for small usage).
For the member.
Responses
Section titled “Responses”OK
Something a member asked their admins for.
object
object
Zitadel user ID.
service is a customer system’s Zitadel service user; agent is a service agent (its ID is the agt_ ID), the author of its runs’ messages.
For limit, the window they want raised.
For model, the model they want.
object
Their words, for the admins.
What the admin who decided wrote back; the member sees it.
Admins only, for a waiting limit, the person’s window now.
object
object
Decimal amount, e.g. “12.50” (up to 6 decimals for small usage).
Null for a rolling window that hasn’t started.
Example
{ "id": "req_4aB9cD2eF7gH1jK3mN5p", "kind": "limit", "user": { "kind": "person" }, "window": "five_hours", "status": "pending", "decided_by": { "kind": "person" }, "granted_limit": { "amount": "50.00", "currency": "EUR" }, "current": { "window": "five_hours", "limit": { "amount": "50.00", "currency": "EUR" }, "spent": { "amount": "50.00", "currency": "EUR" }, "source": { "level": "user_override", "group": { "source": "identity_provider" } } }}The request is invalid; errors lists what’s wrong.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.
Missing, expired or invalid token.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.
The token is valid but lacks the role this needs.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.
No such object in your organization.
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.
The object isn’t in a state that allows this (e.g. Lucy is already answering).
RFC 9457 problem details.
object
For quota-exceeded, the window that is used up.
object
Null for a rolling window that hasn’t started.
organization when the organization’s budget is closer to running out than the member’s own limit.
Field-level problems (400 only).
object
JSON pointer into the request body.
Example
{ "type": "https://docs.asklucy.eu/errors/answer-in-progress", "quota": { "window": "five_hours", "limited_by": "personal", "request": { "status": "pending" } }}Headers
Section titled “Headers”Unique per request; quote it to support.