Xuda logo Xuda Docs User Guides
/
xuda.io
← All guides AI Workspace

Xuda AI Agentic Workspace API Reference

Source file: xuda-ai-workspace-api-reference.md

Xuda AI Agentic Workspace API Reference

This reference covers the full method surface of the Xuda AI Agentic Workspace: the conversation engine behind the AI Chats tab, the no-code AI agent builder, mini apps, contacts, account profiles, the embeddable chat widget and contact form, sharing and contact import, and the session methods the workspace runs on. It is written for developers automating a workspace from their own code, embedding the widget or the contact form on their own website, or wiring workspace methods into an agent through MCP. Every method key, parameter name, type and required flag below is taken from the shipped method contract.

How To Call These Methods

Every method here is a CPI method. CPI methods are dispatched by name over the Xuda API and MCP layer, and the normal credential for that layer is the account API key. For the transport-level detail, including how requests are framed and how the MCP layer exposes methods, see /api-mcp-integration.

Three rules decide whether your credential reaches a given method:

  • A method flagged private is excluded from the API-key catalog and refused for API-key callers, even on a full-access key. Those are dashboard-session methods: the account identity comes from the signed-in session, never from a parameter.
  • A non-private method is reachable with an API key. A full access key covers every non-private method, evaluated at call time. A scoped key must name the method in its api_allow_methods list.
  • A method with public clearance needs no authentication at all and is callable at https://<xuda origin>/cpi/<method>. Several public methods here are also flagged private, which only means they are left out of the API-key catalog. They exist for the embedded chat widget, the embedded contact form and public profile pages, and a visitor's browser calls them directly.

Two notes if you are working through MCP. The standalone Xuda MCP server exposes any non-private method the presenting key is allowed, so most of the API-key methods below are available to an MCP client. Separately, only methods flagged mcp: true are offered to one of your own AI agents through the agent editor's cpi tool type, and inside this product that is get_ai_workspace_pending_counts alone.

What The Availability Labels Mean

Every method below carries one explicit availability line. Read it first, because it tells you whether you can call the method from your own code today.

  • Availability: API key means an external developer API key or the MCP layer can call it. Most of the workspace's list, organize, contact, profile and sharing methods carry this label.
  • Availability: Dashboard session means a signed-in user in the Xuda dashboard can call it, and an API key cannot. The method is flagged private, so it is not in the API-key catalog and an API-key call is refused. Almost everything that spends AI credits or opens a conversation lives here.
  • Availability: Public endpoint means no authentication at all. It is called from a visitor's browser or from your own server. Where a credential is involved, such as a widget token or a Google ID token, it is carried in the body rather than in a session.
  • Availability: Operator only means Xuda staff and platform operators, listed only for completeness. No AI Agentic Workspace method currently carries this label.

Method Index

Conversations and chat

Method What It Does
create_conversation Opens a new conversation, titles it, stamps the profile and model, and starts the background work.
submit_chat_conversation The single entry point for sending a turn, in any tab and any conversation mode.
get_ai_chats Lists conversations for the active profile, filtered, searched and paged.
get_chat_conversation Returns one conversation with its messages, for rendering an opened thread.
get_chat_suggestions Returns next-step suggestion cards, each able to name an agent to hand off to.
delete_conversation_item Removes one message from a thread.
conversation_actions Renders one answer to PDF and prints it, downloads it, or files it in Xuda Drive.
upload_prompt_attachment Stores an uploaded file in Drive under /Chat Attachments so a prompt can carry it.
delete_prompt_attachment Deletes a previously uploaded prompt attachment.
submit_chat_gpt_prompt A single-shot prompt with no conversation attached.
pin_ai_chat Pins a conversation to the top of the AI Chats grid.
unpin_ai_chat Removes the pinned state from a conversation.
archive_ai_chat Moves a conversation and its messages out of the active list.
unarchive_ai_chat Restores an archived conversation.
delete_ai_chat Permanently removes an archived conversation and everything it created.

AI agents

Method What It Does
get_ai_agents Lists the agents for the active profile, filtered, searched and paged.
create_ai_agent Creates an agent from a name and instructions, then fills in the rest in the background.
update_ai_agent Saves changes to an existing agent.
archive_ai_agent Moves an agent out of the active AI Agents list.
unarchive_ai_agent Restores an archived agent.
delete_ai_agent Permanently removes an archived agent.
pin_ai_agent Pins an agent to the top of the AI Agents grid.
unpin_ai_agent Removes the pinned state from an agent.
generate_ai_agent_image Regenerates the picture for one agent you own.
uninstall_ai_agent Uninstalls an agent that was installed from another app.
set_agent_tool_consent Grants or withdraws an installed agent's use of its publisher's tools.
ai_field_assist Writes or improves one form field using its sibling fields as context.

Mini apps, plugins and generated assets

Method What It Does
get_apps Lists the mini apps for the active profile.
create_mini_app Builds a mini app from a plain-language prompt.
pin_mini_app Pins a mini app to the top of the Apps grid.
unpin_mini_app Removes the pinned state from a mini app.
archive_mini_app Moves a mini app out of the active Apps list.
unarchive_mini_app Restores an archived mini app.
delete_mini_app Permanently removes an archived mini app.
classify_external_app_scan Turns an external app DOM scan into a short list of suggested actions.
create_plugin_via_ai Creates a Xuda-hosted plugin package from a prompt and validates it.
modify_plugin_via_ai Modifies an existing Xuda-hosted plugin package from a prompt.
generate_site_draft Generates or refines a website draft and returns a preview URL.
generate_release_notes Drafts user-facing release notes by diffing an app against its last build.
generate_login_screen Generates a landscape login-screen background from a text prompt.

Contacts

Method What It Does
get_contacts Lists the contacts of the active profile, with search, filtering and paging.
archive_contact Moves a contact out of the active list.
unarchive_contact Restores an archived contact.
delete_contact Permanently removes an archived contact.
unfriend_contact Ends the friend relationship but keeps the contact record.
pin_contact Pins a contact, and also pins a profile card.
unpin_contact Removes the pinned state from a contact.
not_spam_contact Clears a spam flag, whitelists the address and reclassifies the contact.
set_deep_research_contact Turns on deep research enrichment for one contact.
unset_deep_research_contact Turns deep research off and clears its cached data.
generate_contact_avatar Regenerates a contact's avatar.
get_contact_activity Returns the append-only activity trail of one contact.
compose_contact_email Drafts an email to a contact from an instruction plus that contact's history.
add_contact_member Sends a friend request to an email address or a known account.
get_contact_members Lists contact connections, optionally filtered by request status.
import_contacts_preview Reads an address book and reports, per person, what a request would do.
bulk_add_contact_members Sends friend requests to the picked addresses, in batches.

Account profiles and avatars

Method What It Does
get_account_profiles Lists the account's profiles, main profile first.
create_account_profile Creates a new work identity inside the account.
update_account_profile Saves a profile, including the workspace's active AI model.
update_entity_account_profiles Reassigns which profiles a chat, app, agent or contact belongs to.
archive_account_profile Moves a profile out of the active list.
unarchive_account_profile Restores an archived profile.
delete_account_profile Permanently removes a profile.
create_avatar Generates and saves a stylized avatar for an account or a profile.
modify_profile_avatar Regenerates the avatar by applying edit operations.
inspect_profile_picture Upload-time content check on a profile picture or business logo.

Embeddable widget and contact form settings

Method What It Does
get_widget_settings Reads a profile's chat widget setup, snippet and iframe URL.
update_widget_settings Turns the chat widget on or off and sets its skin and greeting.
get_widget_embed_snippet Returns the snippet a profile owner pastes on their website.
get_contact_form_settings Reads a profile's embeddable contact form setup.
update_contact_form_settings Enables and customizes the embeddable contact form.

Public visitor endpoints

Method What It Does
widget_signup A visitor signs up through the embedded chat widget with an email and a name.
widget_signup_google A visitor signs up through Google Identity Services.
widget_send_message A visitor sends a chat message, optionally with image attachments.
widget_get_messages A visitor polls for new messages and for the approval state.
widget_get_avatar Polls the generated avatar for a widget-created visitor account.
contact_form_submit The endpoint behind the embedded profile contact form.
public_profile_ask_friendship A visitor on a public profile page sends a friend request.
site_signup_google Site-level Google sign-in that is not tied to a persona.
site_get_avatar Polls the generated avatar for an account created at site login.
site_recreate_avatar Clears the cached avatar and regenerates it from the stored picture.
site_get_ascii_art Polls the ASCII-art portrait generated from the account avatar.
site_get_styled_portrait Polls a styled portrait generated from the account avatar.

Sharing

Method What It Does
create_share Shares a chat, mini app, agent or contact with another account by email.
get_shares Lists the shares of one kind for the caller.
confirm_share The recipient accepts a pending share and gets their own copy.
decline_share The recipient rejects a pending share.
cancel_share The sender withdraws a share that has not been accepted.
remove_share Ends an accepted share and removes the recipient's copy.
update_share Updates the access_view list on an existing share.

Workspace status

Method What It Does
get_ai_workspace_pending_counts Returns what is waiting for attention, grouped by workspace tab.

Sessions and CLI authentication

Method What It Does
start_cli_auth Begins the device-code flow used by the Xuda CLI.
poll_cli_auth Polls the device-code flow for a CLI access token.
approve_cli_auth Approves a CLI device-code login from the web.
deny_cli_auth Denies a CLI device-code login from the web.
clear_session_logs Clears the stored session logs for an app.
get_gtp_token_info Returns details about a GTP session token.
get_user_active_gtp_session Returns the user's active GTP session.
logout_gtp_session Ends a GTP session with a recorded reason.
notification_granted Stores the browser push token the user just granted.
create_app_session Creates an application session for an app.
logout_app_session Ends an application session.
get_live_preview_sessions Lists live preview sessions.
get_live_preview_session_info Returns one live preview session.
create_live_session Creates a live-preview session for a program in an app.
update_live_session Updates an existing live-preview session.
update_live_session_status Updates a session's status code.
get_miniapp_sessions Lists mini app sessions.
get_miniapp_session_info Returns one mini app session.
create_miniapp_session Creates a mini app session for a program in an app.

create_conversation

Create Conversation

Opens a new conversation document, creates the matching upstream OpenAI conversation, titles it from the first ten words of the prompt (or from the subject line for an email), stamps it with the active account profile and the chosen model, and then kicks off the background work that categorizes it and generates its cover image. It runs the credit gate before doing anything. For an email conversation it refuses unless the active profile has a mailbox bound. For a contact chat it refuses unless the contact is a connected Xuda user.

Availability: Dashboard session

Parameters

The method contract declares no fields. The implementation reads reference_type, reference_id, conversation_type, prompt, profile_id, ai_model, plan_mode, perform_ai_execution, subject, email_id, email_recipient_type, direction, from_mailbox and date_created.

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Runs as a background job. The conversation document exists immediately; the category and the cover image arrive afterwards.
  • reference_type is the workspace tab the conversation belongs to: ai_chats, contacts, apps, ai_agents, account_profiles, studio or dashboard. reference_id is the opened item inside that tab.
  • conversation_type selects the mode inside a contact: ai_chat, chat, email, note, sms or ticket.
  • Credit gate: the call is evaluated against the account's credit rules before any AI work starts.
  • Thumbnail generation for chat conversations is off by default for accounts on both the free membership tier and the free AI Workspace tier.

submit_chat_conversation

Submit Chat Conversation

The single entry point for sending a turn. It loads the conversation, resolves plan mode (including accepting a previously proposed plan item), then dispatches on reference_type and, for a contact, on conversation_type. Progress is reported through the job step list: initiating conversation, analyzing request, preparing tools, analyzing attachments, submitting chat, streaming results, finalizing.

Availability: Dashboard session

Parameters

Name Type Required Description
app_id string No Unique identifier of the application this request targets
prompt string No Prompt text to send for processing

The implementation additionally reads conversation_id, profile_id, metadata, plan_mode, accepted_plan_item_id, attachments, ai_agents, ai_model, output_format, stream and conversation_item_id. conversation_id is required in practice: without it the call throws missing conversation_id.

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Runs as a background job with a 600,000 ms (10 minute) timeout.
  • The answer is streamed to the browser over a websocket rather than returned by a poll. The events are stream_start, stream_phase, response_start, stream_delta (sequence numbered), suggestions and stream_end.
  • Errors are deliberately flattened to chat_request_failed before they reach the browser, so an internal failure can never leak a connection string. Expect that code rather than a specific cause.
  • ai_model is validated against the configured ai_models catalog after legacy keys are mapped through ai_model_aliases. Anything not in the catalog throws model not supported.
  • On the main chat path the model is the profile's active_ai_model, or the configured default gpt-1, with a per-agent override when an agent handles the turn. Automatic per-request model tiering applies only to the dashboard and project assistant path.
  • What is routed automatically on the chat path is the agent, not the model: a triage agent decides whether to answer directly or hand off to a specialist.
  • Request timeouts follow the reasoning effort in play: minimal 8 s, low 15 s, medium 60 s, high 120 s, and 180 s whenever a hosted tool is involved.
  • Credit gate: every AI call is metered before it runs, against the account's pool, per-profile, per-user, per-model and per-source rules.

get_ai_chats

Get AI Chats

Returns the conversation list for the active profile, filtered and paged. It also computes per-conversation message counts and unread counts, and assigns each card a gradient background derived from the conversation's mood level.

Availability: Dashboard session

Parameters

The method contract declares no fields. The implementation reads reference_type, reference_id, _id, search, filter_type, conversation_type, limit, skip, conversation_id and profile_id.

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • filter_type accepts all, archived, shared, pinned, mine and pending.
  • Not a background job. It answers inline.

get_chat_conversation

Get Chat Conversation

Returns one conversation with its messages, for rendering an opened thread.

Availability: Dashboard session

Parameters

Name Type Required Description
conversation_id string Yes Unique identifier of the conversation to process

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Not a background job.

get_chat_suggestions

Get Chat Suggestions

Returns next-step suggestion cards for a conversation item, either as prompt suggestions before the answer or as follow-up suggestions after it. Each suggestion can name an agent to hand the work to.

Availability: Dashboard session

Parameters

Name Type Required Description
conversation_item_id string Yes Unique identifier of the conversation item to process
ai_agents array No Agents to consider when suggesting a hand-off
no_of_suggestions number No How many suggestions to return

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Not a background job.

delete_conversation_item

Delete Conversation Item

Removes one message from a thread. It refuses when the caller does not own the message.

Availability: API key

Parameters

Name Type Required Description
conversation_item_id string Yes Unique identifier of the conversation item to process

Notes

  • Auth: clearance user. Not private, so a full-access API key reaches it and a scoped key must list it.
  • Ownership is enforced on the message itself, not on the conversation.

conversation_actions

Conversation Actions

Renders one conversation item's text to a PDF and then either sends it back as a download or a print stream, or uploads it into the caller's Xuda Drive at the drive root.

Availability: Dashboard session

Parameters

Name Type Required Description
conversation_id string Yes Unique identifier of the conversation to process
item_id string Yes Identifier of the conversation item whose text is rendered to PDF
action string Yes Action to perform on the generated PDF: print, download or save_to_drive

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • save_to_drive writes to the drive root, and the saved file counts against the account's Drive storage allowance.

upload_prompt_attachment

Upload Prompt Attachment

Validates an uploaded file against the Drive extension allow list and stores it in the user's Drive under /Chat Attachments, so it can be attached to a prompt.

Availability: Dashboard session

Parameters

This method takes no declared parameters. The file arrives as the request's uploaded file, as a multipart upload rather than a JSON field.

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • The extension allow list is Drive's, not a separate chat list.
  • Deleting the conversation later deletes the attachment files it carried.

delete_prompt_attachment

Delete Prompt Attachment

Deletes a previously uploaded prompt attachment from the upstream file store.

Availability: Dashboard session

Parameters

Name Type Required Description
file_id string Yes Value for the file id field

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.

submit_chat_gpt_prompt

Submit Chat Gpt Prompt

A single-shot prompt with no conversation attached, used internally for titles, categorization and short classifications. It defaults to the cheapest model and to minimal reasoning effort.

Availability: Dashboard session

Parameters

Name Type Required Description
prompt string Yes Prompt text to send for processing
app_id string No Unique identifier of the application this request targets

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Credits are metered to the caller, at the cheapest catalog model's rate unless another model is in play.
  • At minimal reasoning effort the request timeout is 8 seconds.

pin_ai_chat

Pin AI chat

Marks a conversation pinned so it floats to the top of the AI Chats grid.

Availability: API key

Parameters

Name Type Required Description
conversation_id string Yes Unique identifier of the AI chat to process

Notes

  • Auth: clearance user. Not private. No min_plan.

unpin_ai_chat

Unpin AI chat

Removes the pinned state from a conversation.

Availability: API key

Parameters

Name Type Required Description
conversation_id string Yes Unique identifier of the AI chat to process

Notes

  • Auth: clearance user. Not private. No min_plan.

archive_ai_chat

Archive AI Chat

Moves a conversation out of the active list by setting its status to archived, and archives its individual messages with it.

Availability: API key

Parameters

Name Type Required Description
conversation_id string Yes Unique identifier of the conversation to process

Notes

  • Auth: clearance user. Not private. No min_plan.
  • It refuses when the caller is neither the conversation's owner nor the owner of its account profile.
  • It refuses when the chat is currently shared. Remove the share first with remove_share.
  • Archiving is the required first step before delete_ai_chat will do anything.

unarchive_ai_chat

Unarchive AI Chat

Restores an archived conversation to the active list.

Availability: API key

Parameters

Name Type Required Description
conversation_id string Yes Unique identifier of the conversation to process

Notes

  • Auth: clearance user. Not private. No min_plan.

delete_ai_chat

Delete AI Chat

Permanently removes a conversation, and everything the conversation created with it.

Availability: API key

Parameters

Name Type Required Description
conversation_id string Yes Unique identifier of the conversation to process

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Archive first. It throws "A document can only be deleted after it has been archived" unless the chat is already archived.
  • Deleting also removes the upstream OpenAI conversation, deletes any uploaded attachment files, and deletes the generated cover image from the user's Drive.
  • If the chat arrived as a share, the share is removed instead and the copy is cleaned up by the team pipeline.

get_ai_agents

Get AI Agents

Returns the agent list for the active profile. Agents are studio documents with properties.menuType === 'ai_agent' scoped to the active profile's ids.

Availability: Dashboard session

Parameters

The method contract declares no fields. The implementation reads _id, search, filter_type, limit, skip, agent_id and profile_id.

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • filter_type accepts all, archived, shared, purchased, pinned, mine and pending.
  • Passing _id returns the full agent document including its agentConfig, but agentConfig is stripped unless the caller created the agent. Do not expect to read another account's instructions or tool list.
  • Not a background job.

create_ai_agent

Create AI Agent

Creates a new agent document under the account's default project, stamped with the active profile. In the background it then asks the AI for an assistant subtitle, a category, an industry and a structured user guide, generates the agent's picture, and uploads any attached agent files, including transcribing a YouTube URL into a searchable vector store.

Availability: Dashboard session

Parameters

Name Type Required Description
agentConfig.agent_name string Yes Agent Name
agentConfig.agent_instructions string Yes Agent Instructions

The full agentConfig object the editor sends also carries agent_ai_model, agent_user_guide, agent_tools (an array of tool objects), use_tools_only, agent_visibility, agent_marketplace_image, agent_category, agent_subcategory, agent_industry and agent_tags.

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • agent_tools accepts these tool types: web_search, file_search, image_generate, table, ai_agent (another agent used as a tool), plugin, mcp (a hosted MCP server URL plus an auth header), cpi (platform methods flagged mcp: true), full_stack_vps, and two Xuda-network website lookup tools.
  • Selecting full_stack_vps connects the agent to that box's MCP endpoint using the box's own scoped API key, which advertises both the box's enabled CPI methods and its installed plugin tools.
  • use_tools_only stops the agent answering from general knowledge.
  • Two retired tool types, xuda_network_mentor_dev_server_readonly and xuda_network_mentor_docs_readonly, are still accepted as strings but are remapped to a read-only public-docs lookup. Do not build against them.
  • Listing an agent on the Marketplace is gated at the Agency tier in the agent editor.

update_ai_agent

Update AI Agent

Saves changes to an existing agent.

Availability: Dashboard session

Parameters

The method contract declares no fields. Send agent_id plus the whole agentConfig object, the same shape create_ai_agent accepts.

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.

archive_ai_agent

Archive AI Agent

Moves an agent out of the active AI Agents list.

Availability: API key

Parameters

Name Type Required Description
agent_id string Yes Unique identifier of the AI agent to process

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Archiving is the required first step before delete_ai_agent will do anything.

unarchive_ai_agent

Unarchive AI Agent

Restores an archived agent to the active list.

Availability: Dashboard session

Parameters

Name Type Required Description
agent_id string No Unique identifier of the AI agent to process

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it. Note the asymmetry: archiving an agent is API-key reachable, unarchiving one is not.

delete_ai_agent

Delete AI Agent

Permanently removes an agent.

Availability: Dashboard session

Parameters

Name Type Required Description
agent_id string Yes Unique identifier of the AI agent to process

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Archive first. It throws "A document can only be deleted after it has been archived" otherwise.

pin_ai_agent

Pin AI agent

Marks an agent pinned so it floats to the top of the AI Agents grid.

Availability: API key

Parameters

Name Type Required Description
agent_id string Yes Unique identifier of the AI agent to process

Notes

  • Auth: clearance user. Not private. No min_plan.

unpin_ai_agent

Unpin AI agent

Removes the pinned state from an agent.

Availability: API key

Parameters

Name Type Required Description
agent_id string Yes Unique identifier of the AI agent to process

Notes

  • Auth: clearance user. Not private. No min_plan.

generate_ai_agent_image

Generate AI Agent Image

Generates a new picture for one agent you own and saves it onto the agent, using the same generator that runs at creation time. It is meant for agents whose card has fallen back to the placeholder.

Availability: API key

Parameters

Name Type Required Description
agent_id string Yes Agent ID

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Runs as a background job with caching disabled, so the new picture appears on the next load rather than in the response.
  • Image generation spends AI credits at the image model's rate.

uninstall_ai_agent

Uninstall AI Agent

Uninstalls an agent that was installed from another app, by marking its document as removed.

Availability: Dashboard session

Parameters

Name Type Required Description
agent_id string No Unique identifier of the AI agent to process

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • The install path itself lives in the marketplace module and is not part of this surface.

set_agent_tool_consent

Set Agent Tool Consent

Records, or withdraws, the caller's permission for an installed agent to use plugin tools published by another account. Consent is always scoped to the caller: a user can only ever consent on their own behalf. Without it, a foreign publisher's plugin tool is never handed to the model at all, and the agent is told to say plainly that it cannot do the work.

Availability: API key

Parameters

Name Type Required Description
agent_id string Yes The AI agent the decision applies to
granted boolean Yes True to allow this agent to use tools that run in its publisher's workspace, false to withdraw
owner_uid string No The publisher account the tools run under

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Cross-tenant tool execution is blocked by default. This method is the only thing that unblocks it, and it unblocks it for the calling user alone.
  • An install claim that no live marketplace listing backs is refused outright, and consent cannot lift that refusal. The listing's app_uid must match and the listing must be live.
  • The consent record's document id is derived from the caller uid and the agent id, so repeated calls update one record per caller and agent rather than accumulating grants.
  • A withheld tool is reported back to the model, which is why an agent will tell a user what it cannot do instead of failing silently.

ai_field_assist

Ai Field Assist

Writes or improves the text of a single form field using the other values on the same form as context. This is what the sparkle icon next to a field label calls, for example on the agent name and agent instructions fields.

Availability: Dashboard session

Parameters

Name Type Required Description
field string Yes Key of the form field being written, for example agent_name or agent_instructions
value string No Text currently in the field. Empty generates from context, filled improves what is already there
context object No Sibling form values that give the model context, as a flat object of strings
label string No Human label of the field, used when the field key has no built-in preset
hint string No What the field is for, used when the field key has no built-in preset
instructions string No Optional free-text guidance to steer the rewrite

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Credits are metered to the caller.
  • Not a background job. It answers inline.

get_apps

Get Mini Apps

Returns the mini app list for the active profile. Mini apps are studio documents with studio_meta.miniApp === true.

Availability: Dashboard session

Parameters

The method contract declares no fields. The implementation reads _id, search, filter_type, limit, skip, mini_app_id and profile_id.

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • filter_type implements archived, shared, mine and pinned. purchased and pending are not implemented here and fall through to the unfiltered list, so do not treat a purchased response as filtered.
  • Not a background job.

create_mini_app

Create Mini App

Creates a mini app (a studio component flagged miniApp) under the account's default project from a plain-language prompt, asks the AI for a five-word title, stamps it with the active profile, and generates its thumbnail in the background.

Availability: Dashboard session

Parameters

Name Type Required Description
prompt string Yes Prompt text to send for processing

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • The title and the thumbnail both cost credits, and both land after the response.

pin_mini_app

Pin Mini App

Marks a mini app pinned so it floats to the top of the Apps grid.

Availability: API key

Parameters

Name Type Required Description
prog_id string Yes Unique identifier of the mini app to process

Notes

  • Auth: clearance user. Not private. No min_plan.

unpin_mini_app

Unpin Mini App

Removes the pinned state from a mini app.

Availability: API key

Parameters

Name Type Required Description
prog_id string Yes Unique identifier of the mini app to process

Notes

  • Auth: clearance user. Not private. No min_plan.

archive_mini_app

Archive Mini App

Moves a mini app out of the active Apps list.

Availability: API key

Parameters

Name Type Required Description
prog_id string Yes Unique identifier of the mini app to process

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Archiving is the required first step before delete_mini_app will do anything.

unarchive_mini_app

Unarchive Mini App

Restores an archived mini app.

Availability: API key

Parameters

Name Type Required Description
prog_id string Yes Unique identifier of the mini app to process

Notes

  • Auth: clearance user. Not private. No min_plan.

delete_mini_app

Delete Mini App

Permanently removes a mini app.

Availability: API key

Parameters

Name Type Required Description
prog_id string Yes Unique identifier of the mini app to process

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Archive first. It throws "A document can only be deleted after it has been archived" otherwise.

classify_external_app_scan

Classify External App Scan

Turns an external app DOM scan payload into a short list of concrete suggested actions (add_contact, send_email, fill_form, navigate). It verifies the caller owns the app and returns { summary, detected_context, suggestions: [{ title, kind, rationale, confidence, destructive, cpi_method, args, drive }] }.

Availability: Dashboard session

Parameters

Name Type Required Description
data.app_id string Yes Id of the external app the scan came from, ownership-checked
data.scan object Yes The v1 scan payload object from window.__xuda_embed.scan()

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Ownership of app_id is enforced before the scan is read.
  • Each suggestion carries a destructive flag. Treat it as a signal to confirm with the user before executing the named cpi_method.

create_plugin_via_ai

Create Plugin Via AI

Creates a Xuda-hosted plugin package using AI, inside the named project, and validates it there.

Availability: Dashboard session

Parameters

Name Type Required Description
app_id string Yes Project id where the plugin will be created and validated
prompt string Yes Prompt describing the plugin to create
widget_type string Yes Plugin category: graphics, dbs, framework, library, ui or widget
plugin_name string No Optional scoped package name for the hosted plugin

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Plugin code runs sandboxed when an agent later uses it as a plugin tool.

modify_plugin_via_ai

Modify Plugin Via AI

Modifies an existing Xuda-hosted plugin package using AI.

Availability: Dashboard session

Parameters

Name Type Required Description
app_id string Yes Project id where the plugin is installed and validated
prompt string Yes Prompt describing the plugin modification
widget_type string Yes Plugin category: graphics, dbs, framework, library, ui or widget
plugin_name string Yes Scoped package name of the existing Xuda-hosted plugin

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.

generate_site_draft

Generate Site Draft

Generates, or refines, a website from a prompt into a draft folder on the studio filesystem, and returns a /studio-drive preview URL. The create flow then adopts the draft folder as the new app's source. Job steps are: Preparing workspace, Generating with AI, Ready to preview.

Availability: Dashboard session

Parameters

Name Type Required Description
prompt string Yes What the site should be, or the change to apply
draft_folder string No Existing draft folder to refine. Omit to start a new draft
image_mode string No How to source images: svg (default), stock, gen_low or gen_high

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Runs as a background job with a 600,000 ms (10 minute) timeout, and broadcasts progress.
  • Plan gate: gen_low and gen_high need a paid membership plan plus a paid workspace credit plan. svg and stock have no such gate. No min_plan is declared on the method itself.
  • stock sources photos from Pexels, which requires the platform's Pexels key to be configured.
  • Passing draft_folder refines the existing draft in place rather than starting a new one.

generate_release_notes

Generate Release Notes

AI-generates concise, user-facing release notes for a build a developer is about to create, by diffing the app's published programs against the previous release's timestamp. It is read-only and never writes the release. Returns { notes, changed_count, since_build, version }.

Availability: API key

Parameters

Name Type Required Description
app_id string Yes Unique identifier of the application this request targets
version string No The proposed version string for the new build, for example 10.99.0
build_type string No major, minor or patch, the semantic bump for this build
instructions string No Optional free-text hint from the developer to steer the generated notes

Notes

  • Auth: clearance user_access, satisfied by a user-group, developer or admin share on the app. Not private, so an API key with that access reaches it.
  • Credits are metered to the caller.
  • Not a background job, and it writes nothing. Calling it twice produces two drafts and no side effects.

generate_login_screen

Generate Login Screen

AI-generates a landscape login-screen background from a text prompt and stores it.

Availability: Dashboard session

Parameters

Name Type Required Description
prompt string Yes Text description of the desired login-screen background, for example "calm blue mountain landscape at dawn"

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Plan gate: min_plan is pro. This is the only method in the workspace surface that carries a platform membership plan gate. The gate compares the account's membership rank against the Pro rank.
  • Runs as a background job with a 240,000 ms timeout, and broadcasts progress.
  • Also credit-gated on top of the plan gate.

get_contacts

Get Contacts

Returns the contact list for the active account profile, with search, filtering and paging. Contacts live as contact documents in the account's default project database. When no filter is set, pending inbound and outbound connection requests are included alongside the real contacts.

Availability: API key

Parameters

Name Type Required Description
_id string No Unique identifier of the document
uid string No Unique identifier of the user
name string No Human-readable name used for identification or search
contact_id string No Unique identifier of the related contact
limit number No Maximum number of records to return
skip number No Number of records to skip for pagination
bookmark string No Pagination bookmark used to continue fetching results
search string No Search query string used to filter results (matches name, email or id)
filter_type string No Filtering scope. Declared options: all (default), archived, shared, mine, pending, online

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Only archived, shared, pinned, online and pending are implemented server side. Anything else, including mine, falls through to the unfiltered list. Do not treat a mine response as filtered.
  • Not a background job.

archive_contact

Archive Contact

Moves a contact out of the active list.

Availability: API key

Parameters

Name Type Required Description
contact_id string Yes Unique identifier of the contact to archive

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Archiving is the required first step before delete_contact.
  • The action is recorded on the contact's activity trail.

unarchive_contact

Unarchive Contact

Restores an archived contact.

Availability: API key

Parameters

Name Type Required Description
contact_id string Yes Unique identifier of the archived contact to restore

Notes

  • Auth: clearance user. Not private. No min_plan.
  • The action is recorded on the contact's activity trail.

delete_contact

Delete Contact

Permanently removes an archived contact.

Availability: API key

Parameters

Name Type Required Description
contact_id string Yes Unique identifier of the archived contact to delete

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Archive first. The workspace enforces archive before delete across chats, agents, apps and contacts alike.

unfriend_contact

Unfriend Contact

Ends the friend relationship with a contact by closing its team request and clearing the link from the contact. The contact record itself remains.

Availability: API key

Parameters

Name Type Required Description
contact_id string Yes Unique identifier of the contact to unfriend

Notes

  • Auth: clearance user. Not private. No min_plan.
  • This is not a delete. To remove the record too, archive and then delete it.

pin_contact

Pin Contact

Pins a contact so it floats to the top of the grid.

Availability: API key

Parameters

Name Type Required Description
contact_id string Yes Unique identifier of the contact to pin

Notes

  • Auth: clearance user. Not private. No min_plan.
  • The Profiles tab reuses this method for pinning profile cards, so a profile id is a valid contact_id here.

unpin_contact

Unpin Contact

Removes the pinned state from a contact.

Availability: API key

Parameters

Name Type Required Description
contact_id string Yes Unique identifier of the contact to unpin

Notes

  • Auth: clearance user. Not private. No min_plan.
  • As with pin_contact, the Profiles tab reuses it for profile cards.

not_spam_contact

Not Spam Contact

Marks a contact as not spam, whitelists its email address, and refreshes its business or personal classification.

Availability: API key

Parameters

Name Type Required Description
contact_id string Yes Unique identifier of the contact to mark as not spam

Notes

  • Auth: clearance user. Not private. No min_plan.
  • The reclassification is an AI step and is recorded on the contact's activity trail.

set_deep_research_contact

Set Deep Research Contact

Enables deep research on a contact, enriching its business or personal information and processing related conversation transcripts.

Availability: API key

Parameters

Name Type Required Description
contact_id string Yes Unique identifier of the contact to enable deep research on

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Enrichment is AI work and spends credits against the account's gate.

unset_deep_research_contact

Unset Deep Research Contact

Disables deep research on a contact and clears its cached data.

Availability: API key

Parameters

Name Type Required Description
contact_id string Yes Unique identifier of the contact to disable deep research on

Notes

  • Auth: clearance user. Not private. No min_plan.
  • The cached enrichment is discarded, so re-enabling it later regenerates and re-charges.

generate_contact_avatar

Generate Contact Avatar

Clears a contact's existing pictures and regenerates its profile avatar.

Availability: API key

Parameters

Name Type Required Description
contact_id string Yes Unique identifier of the contact to generate an avatar for

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Gate: not available on free accounts. It refuses when the account is on both the free membership plan and the free AI Workspace plan. This is enforced inside the method, not by the platform plan gate.
  • The existing pictures are cleared before the new one is generated, so a failed generation leaves the contact without a picture until it is retried.

get_contact_activity

Get Contact Activity

Returns the activity trail of one contact, newest first: how it was created, which AI steps ran on it and what each concluded, picture and avatar generation, archive, unarchive, delete, pin and deep research.

Availability: Dashboard session

Parameters

Name Type Required Description
contact_id string Yes Unique identifier of the contact to read the activity trail of

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it. It is the one contact method that is not API-key reachable.
  • The trail is append-only, one contact_activity document per event, stored in the same project database as the contact.
  • A failure to write a trail entry never fails the action being recorded, so the trail is a best-effort record rather than a ledger.

compose_contact_email

Compose Contact Email

Writes a draft email to a contact from the sender's instruction plus that contact's own history. It returns the draft only. Nothing is sent.

Availability: Dashboard session

Parameters

Name Type Required Description
contact_id string Yes The contact the email is being written to
instruction string No What the sender asked for, in their own words. The composer turns it into a finished email
ai_model string No Model to compose with. Defaults to the account model

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Nothing is sent and nothing is stored as an outbound message. Sending is a separate step.
  • Not a background job. Credits are spent on the draft.

add_contact_member

Add Contact Member

Sends a friend request (a contact_connection team request) to an email address or an existing Xuda account.

Availability: API key

Parameters

Name Type Required Description
access_email string No Email address of the user receiving access or an invitation
to_uid string No Target account id, when connecting to a known account

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Broadcasts, so the recipient's workspace updates live.
  • A recipient already on Xuda gets an in-product invitation. Anyone else gets an invitation email.
  • The request sits at status 2 (pending) until it is accepted, and shows under the Pending filter on both sides.

get_contact_members

Get Contact Members

Lists contact connections, optionally filtered by request status.

Availability: API key

Parameters

Name Type Required Description
team_req_stat array of number No Status codes to filter by: 1 draft, 2 pending, 3 approved, 4 cancelled

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Not a background job.

import_contacts_preview

Import Contacts Preview

Reads an address book and reports, per person, what a friend request would do. Sources are Google Contacts (read with the caller's own OAuth access token through the People API), a vCard file, or a CSV file exported from a computer. It sends nothing.

It returns the parsed entries with a per-entry status of new, self, or the existing connection state, plus total_found, total_with_email, selectable, truncated, lookup_limit (500) and max_per_send (100).

Availability: Dashboard session

Parameters

Name Type Required Description
source string No Where the contacts come from: google, vcard, csv, or file to sniff the format from the content. Default file
access_token string No OAuth access token carrying the contacts.readonly scope, minted in the browser by Google Identity Services. Required when source is google
file_content string No Raw text of the exported vCard or CSV file. Required when source is not google
file_name string No Original file name, used to tell a vCard from a CSV

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Ceiling of 2,000 parsed entries per address book. Past that the response comes back with truncated set.
  • At most 500 "already on Xuda" lookups per preview, reported as lookup_limit.
  • Nothing is sent by this call. It is safe to run repeatedly.
  • The Google access token is minted in the caller's own browser and carries read-only contacts scope.

bulk_add_contact_members

Bulk Add Contact Members

Sends a friend request to each picked email address through the normal contact invitation flow, in batches of 4. Returns { sent, failed, skipped, results } with a per-address outcome.

Availability: Dashboard session

Parameters

Name Type Required Description
entries array No Contacts to invite, each holding an email and an optional name
emails array No Plain list of email addresses to invite, used when no entries are given
contact_source string No Label stored on the resulting contact, for example "contacts import (google)". Default "contacts import"

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • At most 100 addresses per call, sent 4 at a time. Split a larger list across calls.
  • entries wins when both entries and emails are supplied.
  • A Xuda Verify gate refusal stops the whole run rather than burning the rest of the list, so re-running after clearing the gate is the intended recovery.
  • Read results rather than assuming success: every address lands in one of sent, failed or skipped, with its own outcome.
  • Run import_contacts_preview first. It tells you per person whether a request would be new, already pending, already connected, previously declined, or yourself, so you only send what is worth sending.

get_account_profiles

Get Profiles

Returns the account's profiles, with search, filtering and paging. The main profile is always floated to the top of the page.

Availability: API key

Parameters

Name Type Required Description
_id string No Unique identifier for the document
uid string No Unique identifier of the user associated with the request
profile_id string No Unique identifier of the profile
profile_name string No Display name to assign to the profile
limit number No Maximum number of records to return
skip number No Number of records to skip for pagination
bookmark string No Pagination bookmark used to continue fetching results
search string No Search query string used to filter results (matches profile name, profile email or id)
filter_type string No Filtering scope. Declared options: all (default), archived, shared, mine, pending

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Only archived, shared and pending are implemented server side. mine falls through to the unfiltered list.

create_account_profile

Create Account Profile

Creates a new work identity inside the account.

Availability: API key

Parameters

Name Type Required Description
profile_name string Yes Display name to assign to the profile
account_type string Yes Account type for the profile, such as personal or business
profile_signature string No Signature or short text associated with the profile
profile_email string No Email address associated with the profile
profile_picture string No URL or stored reference for the main profile image
profile_avatar string No URL or stored reference for the avatar image
profile_picture_obj object No Structured asset object for the main profile image
profile_avatar_obj object No Structured asset object for the avatar image

Notes

  • Auth: clearance user. Not private. No min_plan.
  • A profile is the scoping unit for the whole workspace: chats, apps, contacts and agents all filter to the active profile.
  • The embeddable chat widget and contact form attach to a saved profile, so create the profile before configuring either.

update_account_profile

Update Account Profile

Saves changes to a profile. This is also the method that persists the workspace's active AI model, the profile's allowed model list, and the legacy auto-respond settings.

Availability: API key

Parameters

Name Type Required Description
profile_name string No Display name to assign to the profile
account_type string No Account type for the profile, such as personal or business
profile_signature string No Signature or short text associated with the profile
email_account_id string No Unique identifier of the connected email account to use
profile_picture string No URL or stored reference for the main profile image
profile_avatar string No URL or stored reference for the avatar image
profile_picture_obj object No Structured asset object for the main profile image
profile_avatar_obj object No Structured asset object for the avatar image
auto_respond boolean No Whether automatic responses are enabled for the profile. Default false
auto_respond_mode string No always (default) or when_offline
auto_respond_agents array of string No Agent IDs allowed to send automatic responses for the profile. Default empty
active_ai_model string No Primary AI model to use for this profile or request
ai_models array No AI models available to this profile or request

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Model choice is remembered per profile, not per chat. Writing active_ai_model here is what the composer's model chip does, so the choice survives a reload and follows a profile switch.
  • active_ai_model must be a code from the configured catalog, or the chat path will throw model not supported on the next turn.
  • The three auto_respond* fields are legacy.
  • Binding email_account_id is what lets the profile open email conversations at all. Without it, an email conversation is refused.

update_entity_account_profiles

Update Entity Account Profiles

Reassigns which profiles a workspace item (a chat, mini app, agent or contact) belongs to. This is the Profiles submenu on a grid card.

Availability: API key

Parameters

Name Type Required Description
account_profiles array Yes Array of account profile records to save or update
_id string No Unique identifier of the record to retrieve or update

Notes

  • Auth: clearance user. Not private. No min_plan.
  • The array replaces the item's profile assignment rather than adding to it, so send the full intended set.

archive_account_profile

Archive Account Profile

Moves a profile out of the active list.

Availability: API key

Parameters

Name Type Required Description
profile_id string Yes Unique identifier of the profile to process

Notes

  • Auth: clearance user. Not private. No min_plan.

unarchive_account_profile

Unarchive Account Profile

Restores an archived profile.

Availability: API key

Parameters

Name Type Required Description
profile_id string Yes Unique identifier of the profile to process

Notes

  • Auth: clearance user. Not private. No min_plan.

delete_account_profile

Delete Account Profile

Permanently removes a profile.

Availability: API key

Parameters

Name Type Required Description
profile_id string Yes Unique identifier of the profile to process

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Anything embedded against that profile, a chat widget or a contact form, stops having a target. Turn those off first if the snippet is live on a website.

create_avatar

Create Account Profile Avatar

Generates and saves a stylized profile avatar for an account or an account profile from a source image URL, after a credit check.

Availability: Dashboard session

Parameters

Name Type Required Description
url string Yes HTTPS URL of the source profile picture to generate the avatar from
name string Yes Display name associated with the avatar being created
account_type string Yes Account type for the avatar, either personal or business
docType string Yes Target document type, either account or account_profile

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Runs as a background job with a 240,000 ms timeout, and broadcasts progress.
  • Credit-gated before the image model is called.

modify_profile_avatar

Modify Profile Avatar

Regenerates the profile avatar by applying the requested edit operations as an image-edit prompt.

Availability: Dashboard session

Parameters

Name Type Required Description
methods array Yes List of avatar edit operations to apply: Enlarge, Shrink, Female, Male, Younger, Older

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • The personal-only operations (Younger, Older, Male, Female) are hidden for business profiles in the product's own UI.
  • Each call regenerates the image and spends credits.

inspect_profile_picture

Inspect Profile Picture

An upload-time content check for a profile picture or business logo. It answers whether the image is the right kind of image and of usable quality (a real person's photo for a personal account, a brand mark for a business one) and returns { acceptable, reason_code, message }.

Availability: Dashboard session

Parameters

Name Type Required Description
url string Yes HTTPS URL of the just-uploaded profile picture or logo to inspect
account_type string No Account type the image was uploaded for, personal or business. Defaults to personal

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • It is explicitly not identity verification: no face embedding, no matching against a reference, nothing retained.
  • Read acceptable as a quality and suitability signal, not as proof of who is in the picture.

get_widget_settings

Get Widget Settings

Reads an account profile's chat widget setup for the profile setup Chat bot tab: the enabled flag, the skin config, the embed snippet and the iframe URL. Read only, it never mutates the profile.

Availability: Dashboard session

Parameters

Name Type Required Description
profile_id string Yes Account profile id whose widget settings to read

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Not a background job. Nothing is minted or changed by reading.

update_widget_settings

Update Widget Settings

Saves the Chat bot tab: turns the embeddable chat widget on or off and sets its skin and greeting. Returns the refreshed settings including the embed snippet.

Availability: Dashboard session

Parameters

Name Type Required Description
profile_id string Yes Account profile id to update
enabled boolean No Turn the chat widget on or off for this profile
config object No Widget skin: { title, color (#hex), greeting, position (br, bl, tr, tl) }. Pass an empty string for a key to reset it to the default

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • The default greeting when none is set is "Hi! How can we help?".
  • position accepts br, bl, tr and tl for the four corners.
  • Not a background job.

get_widget_embed_snippet

Get Widget Embed Snippet

Returns the JavaScript snippet a profile owner pastes on their website to embed the chat widget.

Availability: Dashboard session

Parameters

Name Type Required Description
profile_id string Yes Account profile id to bind the widget to
config object No Optional widget styling: color, position, greeting, title

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • update_widget_settings and get_widget_settings both return the snippet too, so this method is only needed when you want a snippet for a styling variant without saving it.

get_contact_form_settings

Get Contact Form Settings

Reads an account profile's embeddable contact form setup for the profile setup Contact Form tab: the enabled flag, the form config, the embed snippet and the iframe URL. Read only.

Availability: Dashboard session

Parameters

Name Type Required Description
profile_id string Yes Account profile id whose contact form settings to read

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • Not a background job.

update_contact_form_settings

Update Contact Form Settings

Saves the Contact Form tab: enables or disables the embeddable contact form and customizes it. Returns the refreshed settings including the embed snippet.

Availability: Dashboard session

Parameters

Name Type Required Description
profile_id string Yes Account profile id to update
enabled boolean No Turn the contact form on or off for this profile. The form starts off until explicitly enabled
config object No Form customization: { title, intro, color (#hex), button_text, success_message, fields: { phone, company, subject: { show, required } }, notify_email, auto_respond }

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • notify_email emails the owner on each submission and defaults to true. auto_respond lets the profile AI reply automatically and defaults to whatever the profile's own auto respond setting is.
  • Each of phone, company and subject carries its own show and required pair, so a field can be visible without being mandatory.
  • The form defends itself without a captcha by default. Turning on the "I'm not a robot" check is an option, and it makes captcha_response required on the public submit endpoint.
  • Not a background job.

widget_signup

Widget Signup

An anonymous visitor signs up through the embedded chat widget with an email and a name. It creates a contact_connection invitation and auto-accepts it if the operator has auto respond on. Returns a widget_token plus the assignee's name and avatar, the greeting and the visitor's first name.

Availability: Public endpoint

Parameters

Name Type Required Description
profile_id string Yes Canonical widget profile id of the form <uid>.<pid>
email string Yes Visitor email address
name string Yes Visitor display name
widget_origin string No Host page that embedded the widget

Notes

  • Auth: none. Public clearance. It is also flagged private, which only keeps it out of the API-key catalog.
  • This path is primarily used by tests. The shipped widget signs visitors in through widget_signup_google.
  • The widget_token it returns identifies the session for widget_send_message, widget_get_messages and widget_get_avatar, and the session lasts 7 days.
  • Until the connection request is accepted, the session sits in state pending and messages are refused.

widget_signup_google

Widget Signup (Google)

A visitor signs up through Google Identity Services. The ID token is verified against Google's tokeninfo endpoint (signature, expiry, verified email and audience), the Xuda account is linked or created, and then the same invitation and auto-accept flow as widget_signup runs.

Availability: Public endpoint

Parameters

Name Type Required Description
profile_id string Yes Canonical widget profile id of the form <uid>.<pid>
id_token string Yes ID token from Google Sign-In (Google Identity Services credential)
widget_origin string No Host page that embedded the widget

Notes

  • Auth: none beyond the Google ID token itself, which is the credential. Public clearance, also flagged private.
  • Verification checks signature, expiry, email_verified and the audience against the configured client id. A token that fails any of those is refused.
  • A visitor who has no Xuda account gets one created and linked on their google_sub.

widget_send_message

Widget Send Message

A visitor sends a chat message, optionally with image attachments, through the embed widget.

Availability: Public endpoint

Parameters

Name Type Required Description
widget_token string Yes Session token issued by widget_signup
prompt string No Message text to send. Optional when attachments are present
attachments array No Inline image attachments as base64 data URIs, max 5, roughly 2.5 MB each

Notes

  • Auth: the widget_token is the credential. Public clearance, also flagged private.
  • The session must be in state open, meaning the connection request has been accepted. A pending session cannot send.
  • Attachments are validated as inline base64 image data URIs: at most 5 per message, each capped at 3,500,000 characters, and PNG, JPEG, GIF or WebP only.

widget_get_messages

Widget Get Messages

A visitor polls for new messages and for the approval state of the widget conversation.

Availability: Public endpoint

Parameters

Name Type Required Description
widget_token string Yes Session token issued by widget_signup
since_ts number No Return items with date_created_ts greater than this
limit number No Maximum number of items to return, capped server-side

Notes

  • Auth: the widget_token is the credential. Public clearance, also flagged private.
  • Responses are sent cache_control: no-store, so an intermediary will not serve a stale poll.
  • Poll with since_ts set to the newest timestamp you already hold rather than refetching the thread.

widget_get_avatar

Widget Get Avatar

Polls the generated persona avatar for the visitor account created by a widget Google signup. Returns generation status and the avatar as base64 so an embedding page can draw it without a cross-origin taint.

Availability: Public endpoint

Parameters

Name Type Required Description
widget_token string Yes Session token issued by widget_signup or widget_signup_google

Notes

  • Auth: the widget_token is the credential. Public clearance, also flagged private.
  • Generation is asynchronous, so poll until the returned status says it is ready.
  • Sent cache_control: no-store.

contact_form_submit

Contact Form Submit

The public endpoint behind the embedded profile contact form. It verifies the human-detection signals, adds the sender as a contact (not a friend) on the profile owner's side, and opens a ticket conversation carrying the message.

Availability: Public endpoint

Parameters

Name Type Required Description
profile_id string Yes Canonical widget profile id of the form <uid>.<pid>
token string Yes Human detection token minted when the form was rendered
name string Yes Sender display name
email string Yes Sender email address
message string Yes The message text
subject string No Optional subject line, shown when the owner enabled the subject field
phone string No Optional phone number, owner-configured field
company string No Optional company name, owner-configured field
website string No Honeypot field, must stay empty. Submissions that fill it are silently dropped
captcha_response string No Response token from the embedded bot-protection widget, required only when the owner turned on the "I'm not a robot" check
origin string No Host page that embedded the form
visitor_lang string No Sender browser language tag

Notes

  • Auth: none. Public clearance, also flagged private.
  • Three defenses run before anything is written: the age of the render token, the website honeypot, and rate limits. The honeypot drops the submission silently, so do not expect an error when it trips.
  • The sender becomes a contact, not a friend. No friend request is created by this path.
  • The message opens a ticket conversation on the owner's side. Depending on the form config, the owner is emailed and the profile's AI replies automatically.
  • captcha_response becomes required only when the owner turned on the "I'm not a robot" check in the Contact Form tab.

public_profile_ask_friendship

Public Profile Ask Friendship

A visitor on a public profile page signs in with Google, then sends a contact_connection friend request to the profile owner.

Availability: Public endpoint

Parameters

Name Type Required Description
id_token string Yes ID token from Google Sign-In (Google Identity Services credential)
target_uid string Yes Account id of the profile owner being friend-requested

Notes

  • Auth: the Google ID token is the credential. Public clearance, also flagged private.
  • It auto-accepts when the owner has auto respond enabled. Otherwise the owner gets an invitation email and the request waits under Pending.

site_signup_google

Site Signup (Google)

Site-level Google sign-in that is not tied to a persona. It verifies the ID token and finds or creates and links the visitor's free Xuda account by google_sub, the same account setup the widget does, so a visitor is fully provisioned at site login.

Availability: Public endpoint

Parameters

Name Type Required Description
id_token string Yes ID token from Google Sign-In (Google Identity Services credential)

Notes

  • Auth: the Google ID token is the credential. Public clearance, also flagged private.
  • The account it creates is on the free tier, which grants 1 AI credit every 24 hours rather than a lump allowance.
  • The uid it returns is what site_get_avatar, site_get_ascii_art and site_get_styled_portrait expect.

site_get_avatar

Site Get Avatar

Polls the generated persona avatar for an account created by site_signup_google. Returns generation status and the avatar as base64.

Availability: Public endpoint

Parameters

Name Type Required Description
uid string Yes Account uid returned by site_signup_google

Notes

  • Auth: none. Public clearance, also flagged private.
  • Sent cache_control: no-store. Poll until the status says the avatar is ready.

site_recreate_avatar

Site Recreate Avatar

Clears the cached avatar for the account owning the Google identity and re-triggers generation from the stored profile picture. This powers the "Recreate avatar" button.

Availability: Public endpoint

Parameters

Name Type Required Description
id_token string Yes ID token from Google Sign-In; proves ownership of the account whose avatar is recreated

Notes

  • Auth: the Google ID token is the credential and it is what proves ownership. There is no other way to target another account here.
  • The cached avatar is cleared first, so poll site_get_avatar afterwards rather than expecting the new image in the response.

site_get_ascii_art

Site Get ASCII Art

Polls the AI-generated ASCII-art portrait of the account's avatar, used for the ASCII-Art Shirt merchandise. It is generated once per avatar and cached, and returns base64 when ready.

Availability: Public endpoint

Parameters

Name Type Required Description
uid string Yes Account uid returned by site_signup_google

Notes

  • Auth: none. Public clearance, also flagged private.
  • Ready is status 3. Sent cache_control: no-store.
  • Cached per avatar, so recreating the avatar is what invalidates it.

site_get_styled_portrait

Site Get Styled Portrait

Polls the AI-generated styled portrait of the account's avatar for a Personal shirt. It is generated once per style and avatar and cached, and returns base64 when ready.

Availability: Public endpoint

Parameters

Name Type Required Description
uid string Yes Account uid returned by site_signup_google
style string Yes Style key: ai_agent, style_1, style_2

Notes

  • Auth: none. Public clearance, also flagged private.
  • Ready is status 3. Sent cache_control: no-store.
  • The cache key is the style plus the avatar, so each of the three styles generates once.

create_share

Create Share

Shares one workspace item with another account by email. It creates a team request the recipient must confirm.

Availability: API key

Parameters

Name Type Required Description
access_email string Yes Email address of the user receiving access or an invitation
share_item_id string Yes Unique identifier of the item being shared
access_type string Yes What is being shared: chat, miniapp, ai_agent or contact

Notes

  • Auth: clearance user. Not private. No min_plan.
  • Broadcasts, so both workspaces update live.
  • The share sits at status 2 (pending) until the recipient confirms. Until then it shows under the Pending filter and can be withdrawn with cancel_share.
  • A shared chat cannot be archived. archive_ai_chat refuses until the share is removed.

get_shares

Get Shares

Lists the shares of one kind for the caller.

Availability: API key

Parameters

Name Type Required Description
access_type string Yes Which kind of share to list: ai_agent, miniapp, chat or contact

Notes

  • Auth: clearance user. Not private. No min_plan.
  • One kind per call. There is no combined listing.
  • Not a background job.

confirm_share

Confirm Share

The recipient accepts a pending share.

Availability: API key

Parameters

Name Type Required Description
team_req_id string No Unique identifier of the team request to review or update

Notes

  • Auth: clearance user. Not private. No min_plan. Broadcasts.
  • Confirming a mini app or agent copies the source studio document into the recipient's own project, stamped with studio_meta.shared_from_uid, shared_from_app_id, team_req_id and share_item_id.
  • Confirming a contact copies the contact document under a new id on the recipient's side.
  • The recipient receives a copy, not a live pointer. Later edits by the sender do not flow through.

decline_share

Decline Share

The recipient rejects a pending share.

Availability: API key

Parameters

Name Type Required Description
team_req_id string No Unique identifier of the team request to review or update

Notes

  • Auth: clearance user. Not private. No min_plan. Broadcasts.

cancel_share

Cancel Share

The sender withdraws a share that has not been accepted yet.

Availability: API key

Parameters

Name Type Required Description
team_req_id string No Unique identifier of the team request to review or update

Notes

  • Auth: clearance user. Not private. No min_plan. Broadcasts.
  • Use this while the request is still pending. Once it is accepted, use remove_share.

remove_share

Remove Share

Ends an accepted share and removes the copy from the recipient's workspace.

Availability: API key

Parameters

Name Type Required Description
team_req_id string No Unique identifier of the team request to review or update

Notes

  • Auth: clearance user. Not private. No min_plan. Broadcasts.
  • This is also the prerequisite for archiving a chat that is currently shared.

update_share

Updates Share

Updates the access_view list on an existing share request.

Availability: API key

Parameters

Name Type Required Description
team_req_id string No Unique identifier of the team request to review or update

Notes

  • Auth: clearance user. Not private. No min_plan. Broadcasts.

get_ai_workspace_pending_counts

Get AI Workspace Pending Counts

Returns the number of items waiting for the account's attention, grouped by kind, so the dashboard can paint the red badges on the five tabs. It maps the team-request access types onto workspace buckets: chat becomes ai_chats, ai_agent becomes ai_agents, miniapp becomes apps, contact and contact_connection become contacts, account_profile becomes account_profiles, and user_drive becomes user_drive.

Availability: API key

Parameters

This method takes no parameters.

Notes

  • Auth: clearance user. Explicitly not private, and flagged mcp: true. No min_plan.
  • This is the only workspace method offered to one of your own AI agents as a cpi tool. Everything else an agent reaches goes through the other tool types.
  • It returns an empty object unless the caller's active profile is the main profile. Treat an empty result as "not the main profile" rather than "nothing pending".

start_cli_auth

Start CLI Auth

Begins the device-code flow used by the Xuda CLI to sign a user in. It returns a device_code plus a user_code to show in the terminal.

Availability: Public endpoint

Parameters

This method takes no parameters.

Notes

  • Auth: none. Public clearance, and not private, so it is also in the API-key catalog.
  • Pair it with poll_cli_auth on the CLI side and approve_cli_auth or deny_cli_auth on the web side.

poll_cli_auth

Poll CLI Auth

Polls the device-code flow for a CLI access token once the user approves in the browser.

Availability: Public endpoint

Parameters

Name Type Required Description
device_code string Yes The device_code returned by start_cli_auth

Notes

  • Auth: none. Public clearance, and not private.
  • The token only appears once the user has approved from the web side.

approve_cli_auth

Approve CLI Auth

Approves a CLI device-code login for the signed-in user, called from the web.

Availability: API key

Parameters

Name Type Required Description
user_code string Yes The user_code shown in the terminal

Notes

  • Auth: clearance user. Not private.
  • The approval binds the CLI session to the approving user's identity.

deny_cli_auth

Deny CLI Auth

Denies a CLI device-code login, called from the web.

Availability: API key

Parameters

Name Type Required Description
user_code string Yes The user_code shown in the terminal

Notes

  • Auth: clearance user. Not private.

clear_session_logs

Clear Session Logs

Clears the stored session logs for an app.

Availability: API key

Parameters

Name Type Required Description
app_id string Yes Unique identifier of the application this request targets

Notes

  • Auth: clearance admin, which is higher than the user clearance most of this surface takes. A key whose caller is not an app admin is refused.
  • Not private, so an API key with admin clearance reaches it. Flagged security: true, and it broadcasts.
  • The clear is not reversible.

get_gtp_token_info

Get GTP Token Info

Retrieves details about a GTP session token.

Availability: Dashboard session

Parameters

This method takes no declared parameters.

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • The GTP session is the dashboard session every non-public method here is validated against.

get_user_active_gtp_session

Get User Active Gtp Session

Retrieves the user's active GTP session.

Availability: Dashboard session

Parameters

This method takes no declared parameters.

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.

logout_gtp_session

Logout GTP Session

Ends a GTP session.

Availability: Dashboard session

Parameters

Name Type Required Description
gtp_token string Yes The GTP session token to close
reason string Yes Reason recorded for closing the GTP session

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • reason is required, and it is recorded with the closure.

notification_granted

Notification Granted

Stores the browser push token the user just granted, against the current session, so the workspace can send a push when a long chat finishes.

Availability: Dashboard session

Parameters

Name Type Required Description
gtp_token string Yes The GTP session token to attach the push token to
fcm_token string Yes The Firebase Cloud Messaging token granted by the client for push notifications

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.
  • This is what makes a 10 minute chat job worth walking away from: the push fires when the run ends.

create_app_session

Create App Session

Creates an application session for a given app.

Availability: Dashboard session

Parameters

Name Type Required Description
app_id string Yes Unique identifier of the application the session is created for

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.

logout_app_session

Logout App Session

Ends an application session.

Availability: Dashboard session

Parameters

Name Type Required Description
app_id string Yes The id of the app whose session is being closed
app_token string Yes The app session token identifying the session to close

Notes

  • Auth: clearance admin. Flagged private, so an API key cannot call it regardless of clearance.

get_live_preview_sessions

Get Live Preview Sessions

Retrieves live preview sessions.

Availability: Dashboard session

Parameters

This method takes no declared parameters.

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.

get_live_preview_session_info

Get Live Preview Session Info

Retrieves one live preview session.

Availability: Dashboard session

Parameters

Name Type Required Description
_id string Yes The document id of the live-preview session to look up

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.

create_live_session

Create Live Session

Creates a live-preview session for a program in an app.

Availability: Dashboard session

Parameters

Name Type Required Description
app_id string Yes The id of the app the live-preview session belongs to
settings object Yes Settings object stored on the live-preview session
preview_name string Yes Display name given to the live-preview session
prog_id string Yes The id of the program (screen) the session previews

Notes

  • Auth: clearance developer. Flagged private, so an API key cannot call it regardless of clearance.

update_live_session

Update Live Session

Updates an existing live-preview session.

Availability: Dashboard session

Parameters

Name Type Required Description
app_id string Yes The id of the app the live-preview session belongs to
_id string Yes The document id of the live-preview session to update
settings object Yes Updated settings object stored on the session
preview_name string Yes Updated display name for the live-preview session
prog_id string Yes The id of the program (screen) the session previews

Notes

  • Auth: clearance developer. Flagged private, so an API key cannot call it.

update_live_session_status

Update Live Session Status

Updates a session's status code.

Availability: Dashboard session

Parameters

Name Type Required Description
_id string Yes The document id of the session whose status is updated
status number Yes The new session status code: 1 pending, 2 active, 3 closed

Notes

  • Auth: clearance developer. Flagged private, so an API key cannot call it.

get_miniapp_sessions

Get Mini App Sessions

Retrieves mini application sessions.

Availability: Dashboard session

Parameters

This method takes no declared parameters.

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.

get_miniapp_session_info

Get Mini App Session Info

Retrieves one mini application session.

Availability: Dashboard session

Parameters

Name Type Required Description
_id string Yes The document id of the mini-app session to look up

Notes

  • Auth: session user, clearance user. Flagged private, so an API key cannot call it.

create_miniapp_session

Create Mini App Session

Creates a mini application session for a program in an app.

Availability: Dashboard session

Parameters

Name Type Required Description
app_id string Yes The id of the app the mini-app session belongs to
settings object Yes Settings object stored on the mini-app session
preview_name string Yes Display name given to the mini-app session
prog_id string Yes The id of the program (screen) the session previews

Notes

  • Auth: clearance developer. Flagged private, so an API key cannot call it.

Models

ai_model and active_ai_model take a catalog code, not a vendor model id. Legacy keys are mapped through ai_model_aliases first, and anything still outside the catalog throws model not supported.

Code Name Type Price badge
gpt-1 GPT-5 Nano text $
gpt-2 GPT-5.4 Nano text $$
gpt-3 GPT-5.6 Luna text $$$
gpt-4 GPT-5.6 Terra text $$$$
gpt-5 GPT-5.6 Sol text $$$$$
img-1 GPT Image Mini image
img-2 ChatGPT Image Pro image
voice-1 Whisper Speech AI voice
voice-2 GPT Realtime Voice voice

gpt-1 is the configured default and the cheapest text model. The spread across the text tier is wide: the top text model costs 100 times the default per million input tokens, so a careless active_ai_model write is the fastest way to burn an account's credits.

Credits And Metering

Every AI call is gated before it runs. The gate enforces pool, per-profile, per-user, per-model and per-source soft and hard limits, model allow and deny lists, and a freeze switch, falling back to a single account-wide ledger cap when no rules are set.

  • Limits are { type: 'credits' | 'percent', value }. percent is a share of the granted pool and is allowed on the pool, profile and user scopes. Model and source caps are absolute credits.
  • Default alert thresholds are 80% and 100%, the default window is lifetime, and rules start disabled.
  • The credit rules editor is gated at the Team tier or above.
  • Cost is priced from the model catalog, per million tokens, on the real model behind the catalog code. One usage document is written per AI call, recording input and output tokens, the real model id, the cost, the source and the first 40 characters of the prompt.

Credits sit in two pools and do not roll over:

  • period credits are the plan's allowance for the current billing period. They are granted when the Stripe invoice is paid and they reset with the period.
  • topup credits are separately acquired (ops grants and bonuses) and never reset.
  • Spend comes out of the period pool first and overflows into topup.

Accounts on the free AI Workspace tier receive 1 credit per 24 hours, written as a period credit so it does not accumulate forever, delivered by an hourly platform cron.

Plans And Gates

Two ladders stack. AI credits come from the membership plan, and the AI Workspace add-on stacks its credits and storage on top for any paid membership. The Free membership tier does not stack the add-on; it keeps its base only.

Membership ladder, per month:

Plan Rank Price AI credits Drive GB Projects Team members
Free 0 $0 30 15 5 1
Pro 1 $49 600 50 50 2
Team 2 $149 1,600 250 250 100
Agency 3 $399 3,500 1,000 1,000 1,000
Enterprise T1 4 $1,999 10,000 5,000 5,000 5,000
Enterprise T2 5 $4,999 50,000 10,000 10,000 10,000
Enterprise T3 6 call unlimited unlimited unlimited unlimited

AI Workspace add-on ladder, per month:

Plan id AI credits Storage Price Purchasable today
free_ai_workspace 30 15 GB $0 Yes
200_ai_workspace 200 100 GB No, its Stripe price is still a placeholder
400_ai_workspace 400 500 GB $15 Yes
600_ai_workspace 800 1 TB $25 Yes
1500_ai_workspace 1,500 2 TB No, its Stripe price is still a placeholder
2000_ai_workspace 2,500 3 TB $75 Yes
3000_ai_workspace 4,000 5 TB $115 Yes
6000_ai_workspace 10,000 10 TB $230 Yes

An account with a paid membership is billed a member price on its AI Workspace line, which is 10% off the same Stripe product, and the item is re-pointed at the standard price when the membership lapses. Membership, support and AI Workspace are billed as items on one consolidated subscription.

Method-level plan gates. min_plan is enforced by comparing the account's membership rank against the required plan's rank. Within this product's surface exactly one method carries one: generate_login_screen requires Pro. Nothing else in the chat, agent, app, contact, profile, share or session set carries a min_plan.

Gates that are not min_plan:

Gate Where it bites
Free membership plus free workspace plan generate_contact_avatar refuses outright
Free membership plus free workspace plan Chat conversation thumbnail generation defaults off
Paid membership plus a paid workspace credit plan generate_site_draft image modes gen_low and gen_high
Agency tier Listing an agent on the Marketplace, enforced in the agent editor
Team tier or above The credit rules editor
Membership team_members greater than 1 Sharing a profile with members

Errors

The workspace does not publish a numeric error-code table of its own. What it returns is a small set of thrown messages, plus one deliberately flattened code on the chat path.

Error Raised by Meaning
api method <name> is unauthorized API key validation You called a private method with a developer API key. It is refused even on a full-access key, and the method is not in the published catalog either.
chat_request_failed submit_chat_conversation Something in the run failed. Every underlying failure is flattened to this before it reaches the browser, so that an internal error can never leak a connection string.
missing conversation_id submit_chat_conversation No conversation was named. conversation_id is required in practice even though it is not in the declared field list.
model not supported The main chat path The requested model is not in the configured catalog after alias mapping. Use a code from the model table above.
A document can only be deleted after it has been archived delete_ai_chat, delete_ai_agent, delete_mini_app Archive the item first, then delete it.

Ownership and state refusals you should expect to handle:

  • archive_ai_chat refuses when the caller is neither the conversation's owner nor the owner of its account profile, and refuses again when the chat is currently shared.
  • delete_conversation_item refuses when the caller does not own the message.
  • create_conversation refuses an email conversation when the active profile has no mailbox bound, and refuses a contact chat when the contact is not a connected Xuda user.
  • generate_contact_avatar refuses on an account that is on both free tiers.
  • classify_external_app_scan refuses when the caller does not own the app.
  • A tool belonging to another account is withheld before it reaches the model unless set_agent_tool_consent granted it, and an install claim that no live marketplace listing backs is refused outright.
  • bulk_add_contact_members stops the whole run on a Xuda Verify gate refusal rather than continuing through the list.

Because the chat path flattens its failures, do not try to branch on the cause of a chat_request_failed. Check the conversation state and the credit balance instead.

Rate Limits And Quotas

Scope Limit
Widget chat attachments 5 per message, each data URI capped at 3,500,000 characters (roughly 2.5 MB), PNG, JPEG, GIF or WebP only
Contact import, parsed entries 2,000 per address book, past which the response is marked truncated
Contact import, existing-account lookups 500 per preview, reported as lookup_limit
Friend requests per bulk_add_contact_members call 100, sent 4 at a time, reported as max_per_send
Contact form submissions Rate limited, alongside the render-token age check and the honeypot

Job timeouts:

Method Timeout
submit_chat_conversation 600,000 ms (10 minutes)
generate_site_draft 600,000 ms (10 minutes)
create_avatar 240,000 ms (4 minutes)
generate_login_screen 240,000 ms (4 minutes)

Request timeouts follow the reasoning effort in play: minimal 8 s, low 15 s, medium 60 s, high 120 s, and 180 s whenever a hosted tool is involved.

The dashboard warns before the wall rather than after: at 10% of the balance remaining the AI Workspace pill turns amber and reads "AI credits running low", and at zero it reads "Out of AI credits".

Idempotency, Ordering And Lifetimes

The workspace does not take an idempotency key. What it gives you instead is a set of ordering rules and derived ids you can rely on.

  • Archive before delete, everywhere. delete_ai_chat, delete_ai_agent and delete_mini_app all refuse an unarchived document, and contacts follow the same pattern. A delete on an already-deleted item is not a silent success, so drive the state machine rather than retrying blind.
  • Remove the share before archiving a chat. archive_ai_chat refuses while a share is live.
  • Consent is one record per caller and agent. The set_agent_tool_consent document id is derived from the caller uid and the agent id, so calling it repeatedly updates that one record rather than stacking grants. Consent is scoped to the caller alone and can never be given on someone else's behalf.
  • Deleting a chat is a cascade. It removes the upstream OpenAI conversation, every uploaded attachment file, and the generated cover image in Drive. There is nothing left to clean up separately, and nothing to undo.
  • Confirming a share copies, it does not link. The recipient gets their own document stamped with shared_from_uid, shared_from_app_id, team_req_id and share_item_id. Later sender-side edits do not propagate.
  • Preview then send on contact import. import_contacts_preview writes nothing and can be re-run freely. bulk_add_contact_members is the only call in that pair with side effects.
  • Generated pictures are cached. Chat, agent and mini app cover images are cached per account and keyed on the chat title or category, so a repeated title reuses the existing image instead of regenerating and re-charging. Site portraits and ASCII art are cached per avatar, and per style where a style applies.
Lifetime Value
Widget session 7 days
Free tier credit drip 1 credit per 24 hours
Period credits Reset with the billing period
Topup credits Never reset

Webhooks

This product publishes no inbound webhook of its own. Nothing in the AI Workspace surface defines a webhook you can register against, and there is no outbound event delivery to your own endpoint. Two Stripe webhooks nonetheless decide what the workspace can do:

  • invoice.paid is what actually mints a period's AI credits into the ledger. It is the only writer of the plan allowance, which is why a failed invoice shows up as an account that suddenly cannot run an AI call.
  • invoice.upcoming triggers the deployment usage flush. It is adjacent to this product rather than part of it.

The only recurring work belonging to this surface runs as a platform cron, hourly: the free tier's 1-credit-per-24-hours drip, and the retirement of period grants whose period has ended. Topup credits are never expired by it.

For live updates you want the websocket, not a webhook. A running turn emits stream_start, stream_phase, response_start, sequence-numbered stream_delta, suggestions and stream_end to the dashboard, and the sharing and friend-request methods broadcast so both sides update without polling.

A Note On The Rest Of The Surface

The methods above are the documented surface. Three things sit next to it and are deliberately not listed as API:

  • The MCP server itself publishes no CPI methods. It is a separate process serving the Model Context Protocol, authenticating on a Bearer API key, and registering as tools either the whole non-private catalog for a full-access key or that key's api_allow_methods. For a key scoped to a Full Stack VPS it also registers that box's installed plugin methods.
  • Agent tools are not methods. An agent's agent_tools array is configuration you write through create_ai_agent and update_ai_agent, and the tools themselves run inside the agent run, not as calls you make.
  • Filters that are offered in the product but not implemented server side return unfiltered results rather than an error: purchased and pending on get_apps, mine on get_contacts, and mine on get_account_profiles. Do not build a count or a badge on any of them.