List the caller's agent chats in a workspace
Returns the chats this user created in the workspace, most recently updated first, with each chat's status, model, appearance, and last error. A chat still marked `running` past the stuck threshold is reaped into `error` while the list is built. Requires a Clerk session for a workspace member with the `ai:read` permission; API keys cannot call this group.
Authorization
apiKey Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.
In: header
Path Parameters
Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/v1/workspaces/string/agent/chats"{ "data": [ { "id": "string", "workspaceId": "string", "title": "string", "parentSessionId": "string", "model": "string", "appearance": { "shape": "box", "color": "string", "accentColor": "string", "eyes": "dot", "eyePlacement": "centered", "motion": "still" }, "status": "idle", "runningMessageId": "string", "lastError": "string", "createdAt": "string", "updatedAt": "string" } ]}{ "_tag": "ApiNotFound", "error": "not_found", "message": "That item does not exist, or this key cannot see it.", "status": 404}{ "_tag": "ApiNotFound", "error": "not_found", "message": "That item does not exist, or this key cannot see it.", "status": 404}Link an AI artifact to a workspace item
Attaches the artifact to an existing workspace item so the two reference each other, and returns the updated artifact. Requires a workspace member with the `ai:write` permission who can also write both the artifact's current reference and the target item; an archived artifact cannot be linked. Send an `Idempotency-Key` header to make retries safe; a replay within the window returns the original response.
Create an agent chat
Creates an empty chat owned by the caller, with an optional title, model, and appearance, and returns it. Requires a Clerk session for a workspace member with the `ai:write` permission. The conversation itself is driven by the separate streaming turn route, not by this operation.