Save an interface to share
const url = 'https://api.asklucy.eu/v1/interfaces';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"title":"example","code":"example","conversation_id":"example","message_id":"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/interfaces \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "title": "example", "code": "example", "conversation_id": "example", "message_id": "example" }'Saves a component so people of your organization can open it.
conversation_id and message_id, when given, must be your own
(400 otherwise); with only message_id, the conversation is the
message’s.
Saving the same title from the same message_id again returns the
interface saved before (same id, still 201), with code replaced
when it changed.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Any unique string (a UUID works). Retries with the same key return the first result.
Request Bodyrequired
Section titled “Request Bodyrequired”object
At most 204800 bytes (200 KiB) of UTF-8.
One of your conversations.
A message of one of your conversations (of conversation_id, when given).
Example generated
{ "title": "example", "code": "example", "conversation_id": "example", "message_id": "example"}Responses
Section titled “Responses”Saved
object
The title of the answer’s jsx interface block.
The component’s source: one React function component,
export default function App() { ... }, importing only react.
The chat renders it; Lucy’s API never runs it.
Last save (saving the same block again with other code).
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.
The conversation it came from. Null once that conversation is deleted, and for interfaces of other people (you can’t open their conversations).
The answer it came from; null like conversation_id.
You saved it (you can delete it).
Example
{ "id": "ifc_7QmT2b", "created_by": { "kind": "person" }}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.
Rate limit (problem type …/errors/rate-limited, retry after
Retry-After) or quota used up (…/errors/quota-exceeded, with
quota saying which limit and when it resets).
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.
Seconds to wait before retrying.