Get agent embed policy
Code Mode: praxis.agent.agents.retrieveEmbedPolicy
HTTP: GET /agent/v1/agents/{agent_id}/embed_policy
Read a service agent’s embed settings: the pages allowed to open its Kit chat (allowed_origins), the development switch (allow_localhost), what an embedded end user may upload (uploads) and whether the agent may be shared by link with the daily caps its visitors count against (share_links). The allow list decides where the agent can be embedded at all, so after deploying an application, add that application’s URL origin here (scheme, host and port, never a path) before the page loads the agent — otherwise its Kit chat answers ORIGIN_NOT_ALLOWED. Budgets, monthly caps and token lifetime are set in the console and are not part of this API. An agent of another organization answers 404; an agent that is not a service agent answers 400.
签名
praxis.agent.agents.retrieveEmbedPolicy(args:{path:{agent_id:string}}):Promise<{/** The pages that may open this agent's Kit chat, each an https origin with no path, query or fragment (https://my-app.example.com). */ allowed_origins:Array<string>;/** Whether pages served from http://localhost or http://127.0.0.1 may open the chat during development. */ allow_localhost:boolean;/** What an embedded end user may attach to their own conversation. */ uploads:{/** Whether an embedded end user may attach files at all. */ enabled:boolean;/** The largest single file, in bytes: 1 to 104857600 (100 MiB). */ max_file_bytes:number;/** How many files one embedded end-user session may hold: 1 to 100. */ max_files_per_session:number};/** Whether this agent may be shared by link and the daily budget its share links may use. */ share_links:{/** Whether this agent may be shared by link. */ enabled:boolean;/** The most primary sessions this agent's share links may start in one UTC day, a whole number, or null for no session cap. */ daily_session_cap:number|null;/** The most this agent's share links may spend in one UTC day, in millionths of `currency` (whole minor units), or null for no spending cap. */ daily_spend_cap_micro_usd:number|null;/** The currency daily_spend_cap_micro_usd is in: the account's settlement currency (CNY for a mainland account, USD for a global one), or null for a policy saved b */ currency?:"USD"|"CNY"|null}}>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| agent_id | path | string | 是 | Service agent id from agent creation or listing, the eight character identity number or the handle; the agent must be a service agent of your organization. Also accepts an 8-character identity number (0–9, A–Z); malformed, absent and foreign references return 404, and response ids always use agent_…. |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | The agent’s embed settings. |
| 400 | INVALID_PARAMS: embed settings exist only for service agents, so a general or assume agent is refused; a value that breaks a rule (an origin that is not an https origin, max_file_bytes outside 1–104857600, max_files_per_session outside 1–100, share_links turned on for an agent with no identity number) is refused with the field named too. | |
| 401 | Authenticate with your API key or a console session. | |
| 403 | application/json | permission_error: the credential’s role or bound resources do not allow this operation. Use a key with access to the agent domain and its resources. |
| 404 | AGENT_NOT_FOUND: no service agent with this reference belongs to your organization. | |
| 409 | EMBED_POLICY_REQUIRED: this agent has no saved embed settings yet, so there is nothing to read or merge into; open the agent’s 嵌入设置 page in the console once and save, then retry. EMBED_POLICY_CONFLICT: the settings changed while this request was in flight; read them again and resend, which is not automatic. | |
| 502 | Agent service failed | |
| 503 | Agent service unavailable |