Use the SketricGen Admin API to automate projects, agents, Brand Agents, knowledge bases, conversations, usage, members, and connectors.
The SketricGen Admin API is the control plane for managing a Teamspace from your backend, CLI, automation, or custom SDK. It uses the same permissions and plan limits as the SketricGen application.Use the Runtime API instead when your goal is to execute an existing agent and receive its response. Use the MCP guide when an AI assistant should manage SketricGen conversationally.Python applications can access the SDK-supported Admin API operations and the Runtime API through one SketricGenClient. See the Python SDK guide; version 0.3.0 no longer exposes a separate AdminClient.
Every request requires a Teamspace API key with Manage resources access:
Authorization: Bearer sk_api_YOUR_KEY
Create the key from Teamspace settings → API keys → Create key. Enable Manage resources, choose a Viewer, Editor, or Admin role, and set the Project scope. The plaintext sk_api_... value is shown once.If the same key also needs to run agents through the Runtime API or an SDK, enable Run agents during the same creation flow. A dual-capability key uses one shared Project scope; agent restrictions apply to its runtime access.When creating the key, choose:
Project scope: all accessible Projects, or a selected set of Projects.
Role: Viewer, Editor, or Admin.
Expiration: 30, 90, 180, or 365 days, or a custom date within the supported maximum.
Keys with Manage resources access expire and cannot be changed in place. Revoke and recreate a key when its role, scope, capabilities, or expiration needs to change.
First request
Confirm the Teamspace before performing any write:
Never log the authorization header or include it in an error report.
Project and role behavior
Selected-Project key
A selected-Project key can only access its selected Project or Projects. Reads return resources from that scope, and writes targeting another Project return 403 project_scope_mismatch.
All-Project key
An all-Project key can read across Projects. Write operations that create project-owned resources require a project_id in the request body when the key covers more than one Project.
Editor: Viewer access plus agent, Brand Agent, knowledge-base, and connector changes.
Admin: Editor access plus Teamspace-level project and member management where the endpoint supports it.
The effective permission is limited by both the key’s role and the key creator’s current membership. Removing or demoting the creator can reduce or disable the key immediately.
Endpoint groups
Area
Available operations
Teamspace
Read the Teamspace associated with the key
Projects
List, read, create, and rename projects
Workflow agents
List, create, read, update, delete, and retrieve embed snippets
Brand Agents
List templates; create asynchronously; read and edit identity, model, instructions, knowledge bases, and widget settings
Knowledge bases
List, create, read, rename, delete, add text content, refresh website sources, list data sources, and delete data sources
Conversations
List conversations, read a conversation, and list its traces
Members
List members and change an existing member’s role with an all-Project key using the Admin role
Usage
Read plan and credit usage
Connectors
List connectors and tools, create hosted connection links, check status, attach, and detach
Endpoint directory
Teamspace and projects
GET /teamspacesGET /projectsPOST /projectsGET /projects/{project_id}PATCH /projects/{project_id}
Creating projects requires a key with Manage resources access, the Admin role, and all-Project (Teamspace-wide) scope.
Workflow agents
GET /agentsPOST /agentsGET /agents/{agent_id}PATCH /agents/{agent_id}DELETE /agents/{agent_id}GET /agents/{agent_id}/embed-snippet
POST /agents expects a complete workflow_config. Use Agent Build when a human should visually edit the workflow graph.
POST /agents/{agent_id}/run currently returns 501 run_not_available. Run agents through the Runtime API at POST https://chat-v2.sketricgen.ai/api/v1/run-workflow with a key that has Run agents access.
Brand Agents
GET /brand-agent-templatesPOST /brand-agentsGET /jobs/{job_id}GET /brand-agents/{agent_id}PATCH /brand-agents/{agent_id}GET /brand-agents/{agent_id}/widget-configPATCH /brand-agents/{agent_id}/widget-config
Brand Agent creation is asynchronous. The initial request returns 202 Accepted and a job_id; poll the job until it reaches succeeded or failed.
Knowledge bases
GET /knowledge-basesPOST /knowledge-basesGET /knowledge-bases/{knowledge_base_id}PATCH /knowledge-bases/{knowledge_base_id}DELETE /knowledge-bases/{knowledge_base_id}POST /knowledge-bases/{knowledge_base_id}/contentPOST /knowledge-bases/{knowledge_base_id}/refreshGET /knowledge-bases/{knowledge_base_id}/data-sourcesDELETE /knowledge-bases/{knowledge_base_id}/data-sources/{file_name}
The Admin API can create an empty knowledge base. Website-based Brand Agent creation crawls content and builds a populated knowledge base. Direct file upload is not exposed; extract file text before adding it through the content endpoint.POST /knowledge-bases/{knowledge_base_id}/content accepts a JSON body with title of up to 120 characters and plain-text or Markdown content of up to 200,000 characters. It returns 202 Accepted with status: "processing" while indexing runs. Changes affect every agent using the knowledge base. Storage and plan limits apply.POST /knowledge-bases/{knowledge_base_id}/refresh re-crawls a website already in the knowledge base. Send base_url when several websites are present. It returns 202 Accepted and a job_id; poll GET /jobs/{job_id} through queued, crawling, and kb_refreshing until succeeded or failed. The result reports added, updated, deleted, unchanged, and uncrawled pages. Missing pages are deleted only after a complete crawl within the plan’s page limit; background indexing can continue after success.Content additions and refreshes return 409 kb_not_ready while the knowledge base is processing another change. Knowledge-base deletion returns 409 kb_in_use while a live agent uses it. Supply expected_name as a query parameter for a name-checked deletion; a mismatch returns 409 kb_name_mismatch. Accepted deletion returns 202 Accepted with status: "deleting" while cleanup runs.
Conversations, traces, members, and usage
GET /conversationsGET /conversations/{conversation_id}?agent_id={agent_id}GET /conversations/{conversation_id}/traces?agent_id={agent_id}GET /membersPATCH /members/{user_uuid}GET /usage
Conversation and trace endpoints are read-only. GET /conversations/{conversation_id} requires agent_id and returns the conversation plus a messages transcript in chronological order. Pass limit and next_token to read the remaining messages. Member endpoints require a key with Manage resources access, the Admin role, and all-Project (Teamspace-wide) scope.
Connectors
GET /connectorsGET /connectors/{app_slug}/toolsPOST /connectors/{app_slug}/connect-linkGET /connectors/{app_slug}/connectionPOST /agents/{agent_id}/connectorsDELETE /agents/{agent_id}/connectors/{app_slug}
External-app authorization remains human-in-the-loop. The API returns a short-lived hosted connection URL for the user to open; it never returns the external provider’s OAuth token to your integration.
curl -X PATCH "$SKETRICGEN_ADMIN_API_URL/brand-agents/skbrand_123" \ -H "Authorization: Bearer $SKETRICGEN_ADMIN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "instructions": "Help website visitors choose the right plan. Ask before collecting personal information." }'
Brand Agent patches can change the display name, primary agent name, instructions, model, and assigned knowledge bases. They cannot add, remove, or rewire arbitrary workflow nodes.
Example: connect an app
Connector permissions are a grant to the agent. Use the exact tools published for the connector:
GET /connectors to choose an app.
GET /connectors/{app_slug}/tools to inspect grantable actions.
POST /connectors/{app_slug}/connect-link to create a hosted authorization URL.
Give that URL to the intended user. Do not log or persist it.
Poll GET /connectors/{app_slug}/connection until connected is true.
POST /agents/{agent_id}/connectors with the approved allowed_tools.
Omitting allowed_tools, or sending an empty list for some external connectors, can grant every available tool. Enumerate the connector tools and obtain explicit approval for write-capable actions.
Pagination
Most list endpoints use cursor pagination:
?limit=50&next_token=OPAQUE_TOKEN
limit accepts 1 through 200 and defaults to 50.
Continue while next_token is a string.
Stop only when next_token is null.
Treat the token as opaque; do not decode or modify it.
A short page does not guarantee the listing is complete.
The template and connector-tool catalogs use their documented limit and offset behavior instead of cursor pagination.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"SketricGen Docs","description":"SketricGen docs for website Brand Agents and AI Workforce automation with AI knowledge bases, 2,000+ connectors, skills, models, files, and deployment.","colors":{"primary":"#7D4AEA","light":"#A78BFA","dark":"#7D4AEA"},"logo":{"light":"https://mintcdn.com/sketricgen/xEOJ-xI4AkgppWxS/logo/light.png?fit=max\u0026auto=format\u0026n=xEOJ-xI4AkgppWxS\u0026q=85\u0026s=5aaa568bd8a521722da44b684e1aacc8","dark":"https://mintcdn.com/sketricgen/xEOJ-xI4AkgppWxS/logo/dark.png?fit=max\u0026auto=format\u0026n=xEOJ-xI4AkgppWxS\u0026q=85\u0026s=d6dcd8eddfe23e23b59fb8addccb0758"},"favicon":"https://mintcdn.com/sketricgen/c4HlQLmBiw0POS1H/favicon.ico?fit=max\u0026auto=format\u0026n=c4HlQLmBiw0POS1H\u0026q=85\u0026s=8cc86119806d31506c2266e251c4b1c9","navbar":{"links":[{"href":"https://www.sketricgen.ai","label":"Support"}],"primary":{"type":"button","label":"Homepage","href":"https://www.sketricgen.ai"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/sketricgen","facebook":"https://www.facebook.com/profile.php?id=61574534166470","instagram":"https://www.instagram.com/sketricgen"}},"seo":{"metatags":{"canonical":"https://docs.sketricgen.ai","og:image":"https://www.sketricgen.ai/sketricgen-agentspace.png","og:image:width":"1024","og:image:height":"549","twitter:card":"summary_large_image","twitter:image":"https://www.sketricgen.ai/sketricgen-agentspace.png","og:description":"Build smart website AI chatbots with Brand Agents and internal AI automation workflows with SketricGen AI Workforce.","og:site_name":"SketricGen Documentation"}},"icons":{"library":"lucide"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"sketricgen","hasAudioNarration":false,"actualSubdomain":"sketricgen","customDomains":["docs.sketricgen.ai"],"gitSource":{"type":"github","owner":"sketricsolutions","repo":"skgen-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6ad5da67b9a0635706e6ba01","clientVersion":"0.0.4177","searchFilterCounts":[{"language":"default","tag":"Product Updates","count":28},{"language":"default","tag":"Product","count":19},{"language":"default","tag":"2026 Updates","count":17},{"language":"default","tag":"Deployment","count":11},{"language":"default","tag":"AI Workforce","count":9},{"language":"default","tag":"2025 Updates","count":8},{"language":"default","tag":"Developers","count":7},{"language":"default","tag":"Developer Guides","count":7},{"language":"default","tag":"Websites","count":6},{"language":"default","tag":"Getting Started","count":6}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"dev-guide/admin-api","slug":"/dev-guide/admin-api","pageMetadata":{"title":"Admin API","sidebarTitle":"Admin API","icon":{"name":"key","library":"fontawesome","style":"solid"},"description":"Use the SketricGen Admin API to automate projects, agents, Brand Agents, knowledge bases, conversations, usage, members, and connectors.","keywords":["SketricGen Admin API","AI agent management API","Brand Agent API","Teamspace automation","admin API key"],"href":"/dev-guide/admin-api"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Use the SketricGen Admin API to automate projects, agents, Brand Agents, knowledge bases, conversations, usage, members, and connectors.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`The SketricGen Admin API is the control plane for managing a Teamspace from your backend, CLI, automation, or custom SDK. It uses the same permissions and plan limits as the SketricGen application.`}),`\n`,_jsxs(_components.p,{children:[`Use the `,_jsx(_components.a,{href:`/dev-guide/public-api-usage`,children:`Runtime API`}),` instead when your goal is to execute an existing agent and receive its response. Use the `,_jsx(_components.a,{href:`/dev-guide/mcp-connect`,children:`MCP guide`}),` when an AI assistant should manage SketricGen conversationally.`]}),`\n`,_jsxs(_components.p,{children:[`Python applications can access the SDK-supported Admin API operations and the Runtime API through one `,_jsx(_components.code,{children:`SketricGenClient`}),`. See the `,_jsx(_components.a,{href:`/dev-guide/python-sdk`,children:`Python SDK guide`}),`; version 0.3.0 no longer exposes a separate `,_jsx(_components.code,{children:`AdminClient`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`base-url`,children:`Base URL`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://krjavjkt27.execute-api.us-east-1.amazonaws.com/dev/admin/v1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Store it as an environment variable so you can update environments without changing application code:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` SKETRICGEN_ADMIN_API_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://krjavjkt27.execute-api.us-east-1.amazonaws.com/dev/admin/v1\"`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsxs(_components.p,{children:[`Every request requires a Teamspace API key with `,_jsx(_components.strong,{children:`Manage resources`}),` access:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`Authorization`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Bearer sk_api_YOUR_KEY`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Create the key from `,_jsx(_components.strong,{children:`Teamspace settings → API keys → Create key`}),`. Enable `,_jsx(_components.strong,{children:`Manage resources`}),`, choose a Viewer, Editor, or Admin role, and set the Project scope. The plaintext `,_jsx(_components.code,{children:`sk_api_...`}),` value is shown once.`]}),`\n`,_jsxs(_components.p,{children:[`If the same key also needs to run agents through the Runtime API or an SDK, enable `,_jsx(_components.strong,{children:`Run agents`}),` during the same creation flow. A dual-capability key uses one shared Project scope; agent restrictions apply to its runtime access.`]}),`\n`,_jsx(_components.p,{children:`When creating the key, choose:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Project scope:`}),` all accessible Projects, or a selected set of Projects.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Role:`}),` Viewer, Editor, or Admin.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Expiration:`}),` 30, 90, 180, or 365 days, or a custom date within the supported maximum.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Keys with `,_jsx(_components.strong,{children:`Manage resources`}),` access expire and cannot be changed in place. Revoke and recreate a key when its role, scope, capabilities, or expiration needs to change.`]}),`\n`,_jsx(Heading,{level:`2`,id:`first-request`,children:`First request`}),`\n`,_jsx(_components.p,{children:`Confirm the Teamspace before performing any write:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SKETRICGEN_ADMIN_API_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/teamspaces\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SKETRICGEN_ADMIN_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Expected shape:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"teamspaces\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"teamspace_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"teamspace_123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"slug\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"example-team\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"display_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Example Team\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"subscription_plan\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Builder\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Never log the authorization header or include it in an error report.`}),`\n`,_jsx(Heading,{level:`2`,id:`project-and-role-behavior`,children:`Project and role behavior`}),`\n`,_jsx(Heading,{level:`3`,id:`selected-project-key`,children:`Selected-Project key`}),`\n`,_jsxs(_components.p,{children:[`A selected-Project key can only access its selected Project or Projects. Reads return resources from that scope, and writes targeting another Project return `,_jsx(_components.code,{children:`403 project_scope_mismatch`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`all-project-key`,children:`All-Project key`}),`\n`,_jsxs(_components.p,{children:[`An all-Project key can read across Projects. Write operations that create project-owned resources require a `,_jsx(_components.code,{children:`project_id`}),` in the request body when the key covers more than one Project.`]}),`\n`,_jsx(Heading,{level:`3`,id:`roles`,children:`Roles`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Viewer:`}),` Read Teamspace resources, agents, Brand Agent settings, knowledge bases, conversations, traces, usage, and connector status.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Editor:`}),` Viewer access plus agent, Brand Agent, knowledge-base, and connector changes.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Admin:`}),` Editor access plus Teamspace-level project and member management where the endpoint supports it.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`The effective permission is limited by both the key’s role and the key creator’s current membership. Removing or demoting the creator can reduce or disable the key immediately.`}),`\n`,_jsx(Heading,{level:`2`,id:`endpoint-groups`,children:`Endpoint groups`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Area`}),_jsx(_components.th,{children:`Available operations`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Teamspace`}),_jsx(_components.td,{children:`Read the Teamspace associated with the key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Projects`}),_jsx(_components.td,{children:`List, read, create, and rename projects`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Workflow agents`}),_jsx(_components.td,{children:`List, create, read, update, delete, and retrieve embed snippets`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Brand Agents`}),_jsx(_components.td,{children:`List templates; create asynchronously; read and edit identity, model, instructions, knowledge bases, and widget settings`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Knowledge bases`}),_jsx(_components.td,{children:`List, create, read, rename, delete, add text content, refresh website sources, list data sources, and delete data sources`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Conversations`}),_jsx(_components.td,{children:`List conversations, read a conversation, and list its traces`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Members`}),_jsx(_components.td,{children:`List members and change an existing member’s role with an all-Project key using the Admin role`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Usage`}),_jsx(_components.td,{children:`Read plan and credit usage`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Connectors`}),_jsx(_components.td,{children:`List connectors and tools, create hosted connection links, check status, attach, and detach`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`endpoint-directory`,children:`Endpoint directory`}),`\n`,_jsx(Heading,{level:`3`,id:`teamspace-and-projects`,children:`Teamspace and projects`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /teamspaces`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /projects`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST /projects`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /projects/{project_id}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PATCH /projects/{project_id}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Creating projects requires a key with `,_jsx(_components.strong,{children:`Manage resources`}),` access, the `,_jsx(_components.strong,{children:`Admin`}),` role, and all-Project (Teamspace-wide) scope.`]}),`\n`,_jsx(Heading,{level:`3`,id:`workflow-agents`,children:`Workflow agents`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /agents`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST /agents`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /agents/{agent_id}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PATCH /agents/{agent_id}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`DELETE /agents/{agent_id}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /agents/{agent_id}/embed-snippet`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`POST /agents`}),` expects a complete `,_jsx(_components.code,{children:`workflow_config`}),`. Use Agent Build when a human should visually edit the workflow graph.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`POST /agents/{agent_id}/run`}),` currently returns `,_jsx(_components.code,{children:`501 run_not_available`}),`. Run agents through the Runtime API at `,_jsx(_components.code,{children:`POST https://chat-v2.sketricgen.ai/api/v1/run-workflow`}),` with a key that has `,_jsx(_components.strong,{children:`Run agents`}),` access.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`brand-agents`,children:`Brand Agents`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /brand-agent-templates`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST /brand-agents`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /jobs/{job_id}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /brand-agents/{agent_id}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PATCH /brand-agents/{agent_id}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /brand-agents/{agent_id}/widget-config`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PATCH /brand-agents/{agent_id}/widget-config`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Brand Agent creation is asynchronous. The initial request returns `,_jsx(_components.code,{children:`202 Accepted`}),` and a `,_jsx(_components.code,{children:`job_id`}),`; poll the job until it reaches `,_jsx(_components.code,{children:`succeeded`}),` or `,_jsx(_components.code,{children:`failed`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`knowledge-bases`,children:`Knowledge bases`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /knowledge-bases`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST /knowledge-bases`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /knowledge-bases/{knowledge_base_id}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PATCH /knowledge-bases/{knowledge_base_id}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`DELETE /knowledge-bases/{knowledge_base_id}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST /knowledge-bases/{knowledge_base_id}/content`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST /knowledge-bases/{knowledge_base_id}/refresh`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /knowledge-bases/{knowledge_base_id}/data-sources`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`DELETE /knowledge-bases/{knowledge_base_id}/data-sources/{file_name}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`The Admin API can create an empty knowledge base. Website-based Brand Agent creation crawls content and builds a populated knowledge base. Direct file upload is not exposed; extract file text before adding it through the content endpoint.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`POST /knowledge-bases/{knowledge_base_id}/content`}),` accepts a JSON body with `,_jsx(_components.code,{children:`title`}),` of up to 120 characters and plain-text or Markdown `,_jsx(_components.code,{children:`content`}),` of up to 200,000 characters. It returns `,_jsx(_components.code,{children:`202 Accepted`}),` with `,_jsx(_components.code,{children:`status: \"processing\"`}),` while indexing runs. Changes affect every agent using the knowledge base. Storage and plan limits apply.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`POST /knowledge-bases/{knowledge_base_id}/refresh`}),` re-crawls a website already in the knowledge base. Send `,_jsx(_components.code,{children:`base_url`}),` when several websites are present. It returns `,_jsx(_components.code,{children:`202 Accepted`}),` and a `,_jsx(_components.code,{children:`job_id`}),`; poll `,_jsx(_components.code,{children:`GET /jobs/{job_id}`}),` through `,_jsx(_components.code,{children:`queued`}),`, `,_jsx(_components.code,{children:`crawling`}),`, and `,_jsx(_components.code,{children:`kb_refreshing`}),` until `,_jsx(_components.code,{children:`succeeded`}),` or `,_jsx(_components.code,{children:`failed`}),`. The result reports added, updated, deleted, unchanged, and uncrawled pages. Missing pages are deleted only after a complete crawl within the plan’s page limit; background indexing can continue after success.`]}),`\n`,_jsxs(_components.p,{children:[`Content additions and refreshes return `,_jsx(_components.code,{children:`409 kb_not_ready`}),` while the knowledge base is processing another change. Knowledge-base deletion returns `,_jsx(_components.code,{children:`409 kb_in_use`}),` while a live agent uses it. Supply `,_jsx(_components.code,{children:`expected_name`}),` as a query parameter for a name-checked deletion; a mismatch returns `,_jsx(_components.code,{children:`409 kb_name_mismatch`}),`. Accepted deletion returns `,_jsx(_components.code,{children:`202 Accepted`}),` with `,_jsx(_components.code,{children:`status: \"deleting\"`}),` while cleanup runs.`]}),`\n`,_jsx(Heading,{level:`3`,id:`conversations-traces-members-and-usage`,children:`Conversations, traces, members, and usage`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /conversations`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /conversations/{conversation_id}?agent_id={agent_id}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /conversations/{conversation_id}/traces?agent_id={agent_id}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /members`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`PATCH /members/{user_uuid}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /usage`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Conversation and trace endpoints are read-only. `,_jsx(_components.code,{children:`GET /conversations/{conversation_id}`}),` requires `,_jsx(_components.code,{children:`agent_id`}),` and returns the conversation plus a `,_jsx(_components.code,{children:`messages`}),` transcript in chronological order. Pass `,_jsx(_components.code,{children:`limit`}),` and `,_jsx(_components.code,{children:`next_token`}),` to read the remaining messages. Member endpoints require a key with `,_jsx(_components.strong,{children:`Manage resources`}),` access, the `,_jsx(_components.strong,{children:`Admin`}),` role, and all-Project (Teamspace-wide) scope.`]}),`\n`,_jsx(Heading,{level:`3`,id:`connectors`,children:`Connectors`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /connectors`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /connectors/{app_slug}/tools`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST /connectors/{app_slug}/connect-link`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /connectors/{app_slug}/connection`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST /agents/{agent_id}/connectors`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`DELETE /agents/{agent_id}/connectors/{app_slug}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`External-app authorization remains human-in-the-loop. The API returns a short-lived hosted connection URL for the user to open; it never returns the external provider’s OAuth token to your integration.`}),`\n`,_jsx(Heading,{level:`2`,id:`example-list-agents`,children:`Example: list agents`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SKETRICGEN_ADMIN_API_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/agents?limit=50\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SKETRICGEN_ADMIN_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Response:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"agents\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"agent_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"agent_123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Growth Research Agent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"agent_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"workflow\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"agent_status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"active\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"project_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"project_123\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"next_token\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`example-create-a-brand-agent`,children:`Example: create a Brand Agent`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SKETRICGEN_ADMIN_API_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/brand-agents\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SKETRICGEN_ADMIN_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"Example Brand Agent\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"seed_url\": \"https://example.com\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"publish_widget\": false,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"project_id\": \"project_123\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`project_id`}),` field is required for a Teamspace-scoped key and optional for a project-scoped key.`]}),`\n`,_jsx(_components.p,{children:`Initial response:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"agent_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"skbrand_123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"job_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"job_123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"queued\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"poll_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/admin/v1/jobs/job_123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"publish_widget\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Poll the job:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SKETRICGEN_ADMIN_API_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/jobs/job_123\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SKETRICGEN_ADMIN_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Do not treat `,_jsx(_components.code,{children:`queued`}),`, `,_jsx(_components.code,{children:`crawling`}),`, `,_jsx(_components.code,{children:`crawled`}),`, `,_jsx(_components.code,{children:`kb_processing`}),`, or `,_jsx(_components.code,{children:`agent_finalizing`}),` as completion. Only `,_jsx(_components.code,{children:`succeeded`}),` and `,_jsx(_components.code,{children:`failed`}),` are terminal states.`]}),`\n`,_jsx(Heading,{level:`2`,id:`example-update-a-brand-agent-safely`,children:`Example: update a Brand Agent safely`}),`\n`,_jsx(_components.p,{children:`Read the current settings first:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SKETRICGEN_ADMIN_API_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/brand-agents/skbrand_123\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SKETRICGEN_ADMIN_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Then patch only the intended fields:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` PATCH`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SKETRICGEN_ADMIN_API_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/brand-agents/skbrand_123\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$SKETRICGEN_ADMIN_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"instructions\": \"Help website visitors choose the right plan. Ask before collecting personal information.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Brand Agent patches can change the display name, primary agent name, instructions, model, and assigned knowledge bases. They cannot add, remove, or rewire arbitrary workflow nodes.`}),`\n`,_jsx(Heading,{level:`2`,id:`example-connect-an-app`,children:`Example: connect an app`}),`\n`,_jsx(_components.p,{children:`Connector permissions are a grant to the agent. Use the exact tools published for the connector:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`GET /connectors`}),` to choose an app.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`GET /connectors/{app_slug}/tools`}),` to inspect grantable actions.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`POST /connectors/{app_slug}/connect-link`}),` to create a hosted authorization URL.`]}),`\n`,_jsx(_components.li,{children:`Give that URL to the intended user. Do not log or persist it.`}),`\n`,_jsxs(_components.li,{children:[`Poll `,_jsx(_components.code,{children:`GET /connectors/{app_slug}/connection`}),` until `,_jsx(_components.code,{children:`connected`}),` is `,_jsx(_components.code,{children:`true`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`POST /agents/{agent_id}/connectors`}),` with the approved `,_jsx(_components.code,{children:`allowed_tools`}),`.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Omitting `,_jsx(_components.code,{children:`allowed_tools`}),`, or sending an empty list for some external connectors, can grant every available tool. Enumerate the connector tools and obtain explicit approval for write-capable actions.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`pagination`,children:`Pagination`}),`\n`,_jsx(_components.p,{children:`Most list endpoints use cursor pagination:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`?limit=50\u0026next_token=OPAQUE_TOKEN`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`limit`}),` accepts 1 through 200 and defaults to 50.`]}),`\n`,_jsxs(_components.li,{children:[`Continue while `,_jsx(_components.code,{children:`next_token`}),` is a string.`]}),`\n`,_jsxs(_components.li,{children:[`Stop only when `,_jsx(_components.code,{children:`next_token`}),` is `,_jsx(_components.code,{children:`null`}),`.`]}),`\n`,_jsx(_components.li,{children:`Treat the token as opaque; do not decode or modify it.`}),`\n`,_jsx(_components.li,{children:`A short page does not guarantee the listing is complete.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The template and connector-tool catalogs use their documented `,_jsx(_components.code,{children:`limit`}),` and `,_jsx(_components.code,{children:`offset`}),` behavior instead of cursor pagination.`]}),`\n`,_jsx(Heading,{level:`2`,id:`error-format`,children:`Error format`}),`\n`,_jsxs(_components.p,{children:[`Errors use a stable machine-readable `,_jsx(_components.code,{children:`code`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Human-readable explanation\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"project_scope_mismatch\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Handle the `,_jsx(_components.code,{children:`code`}),` in application logic. The human-readable message may become clearer without changing the code.`]}),`\n`,_jsx(_components.p,{children:`Common errors:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`HTTP`}),_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`missing_token`})}),_jsx(_components.td,{children:`No bearer token was supplied`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_key`})}),_jsx(_components.td,{children:`The key could not be verified`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`key_expired`})}),_jsx(_components.td,{children:`The key is past its expiration`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`key_revoked`})}),_jsx(_components.td,{children:`The key was revoked`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`project_scope_mismatch`})}),_jsx(_components.td,{children:`The request targets a different project`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`insufficient_role`})}),_jsx(_components.td,{children:`The key or its creator lacks the required permission`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`plan_downgraded`})}),_jsx(_components.td,{children:`The active plan no longer includes API keys`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`409`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`workflow_not_ready`})}),_jsx(_components.td,{children:`The Brand Agent has not finished provisioning`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`501`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`run_not_available`})}),_jsx(_components.td,{children:`Use the Runtime API to execute the agent`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`operations-the-admin-api-does-not-expose`,children:`Operations the Admin API does not expose`}),`\n`,_jsx(_components.p,{children:`The Admin API intentionally does not provide:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`API-key creation, rotation, or revocation. A signed-in human manages keys in the app.`}),`\n`,_jsx(_components.li,{children:`Billing changes, credit purchases, or subscription cancellation.`}),`\n`,_jsx(_components.li,{children:`Owner transfer or owner-role grants.`}),`\n`,_jsx(_components.li,{children:`New member invitations or member removal.`}),`\n`,_jsx(_components.li,{children:`Direct file upload into a knowledge base.`}),`\n`,_jsx(_components.li,{children:`Provider passwords or raw connector OAuth credentials.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`related-guides`,children:`Related guides`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/dev-guide/mcp-connect`,children:`Connect AI Agents with SketricGen MCP`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/dev-guide/public-api-usage`,children:`Runtime API`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/dev-guide/python-sdk`,children:`Python SDK`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/dev-guide/node-sdk`,children:`Node.js SDK`})}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Admin API","sidebarTitle":"Admin API","icon":{"name":"key","library":"fontawesome","style":"solid"},"description":"Use the SketricGen Admin API to automate projects, agents, Brand Agents, knowledge bases, conversations, usage, members, and connectors.","keywords":["SketricGen Admin API","AI agent management API","Brand Agent API","Teamspace automation","admin API key"],"href":"/dev-guide/admin-api"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Base URL","slug":"base-url","depth":2,"children":[]},{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"First request","slug":"first-request","depth":2,"children":[]},{"title":"Project and role behavior","slug":"project-and-role-behavior","depth":2,"children":[{"title":"Selected-Project key","slug":"selected-project-key","depth":3,"children":[]},{"title":"All-Project key","slug":"all-project-key","depth":3,"children":[]},{"title":"Roles","slug":"roles","depth":3,"children":[]}]},{"title":"Endpoint groups","slug":"endpoint-groups","depth":2,"children":[]},{"title":"Endpoint directory","slug":"endpoint-directory","depth":2,"children":[{"title":"Teamspace and projects","slug":"teamspace-and-projects","depth":3,"children":[]},{"title":"Workflow agents","slug":"workflow-agents","depth":3,"children":[]},{"title":"Brand Agents","slug":"brand-agents","depth":3,"children":[]},{"title":"Knowledge bases","slug":"knowledge-bases","depth":3,"children":[]},{"title":"Conversations, traces, members, and usage","slug":"conversations-traces-members-and-usage","depth":3,"children":[]},{"title":"Connectors","slug":"connectors","depth":3,"children":[]}]},{"title":"Example: list agents","slug":"example-list-agents","depth":2,"children":[]},{"title":"Example: create a Brand Agent","slug":"example-create-a-brand-agent","depth":2,"children":[]},{"title":"Example: update a Brand Agent safely","slug":"example-update-a-brand-agent-safely","depth":2,"children":[]},{"title":"Example: connect an app","slug":"example-connect-an-app","depth":2,"children":[]},{"title":"Pagination","slug":"pagination","depth":2,"children":[]},{"title":"Error format","slug":"error-format","depth":2,"children":[]},{"title":"Operations the Admin API does not expose","slug":"operations-the-admin-api-does-not-expose","depth":2,"children":[]},{"title":"Related guides","slug":"related-guides","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/sketricgen/d206191bcdc5bc7e/widget.js","/_mintlify/custom/sketricgen/f02a1176f831416a/clarity.js"],"subdomain":"sketricgen","siteName":"SketricGen Docs","title":"Admin API - SketricGen Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-19T08:53:01.759Z","originalFileLocation":"dev-guide/admin-api.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Use the SketricGen Admin API to automate projects, agents, Brand Agents, knowledge bases, conversations, usage, members, and connectors.\">\u003cmeta data-mint-head name=\"application-name\" content=\"SketricGen Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/sketricgen/MD2gT67kzVN7ly92/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/sketricgen/MD2gT67kzVN7ly92/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/sketricgen/MD2gT67kzVN7ly92/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/sketricgen/MD2gT67kzVN7ly92/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/sketricgen/MD2gT67kzVN7ly92/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/sketricgen/MD2gT67kzVN7ly92/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/sketricgen/MD2gT67kzVN7ly92/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/sketricgen/MD2gT67kzVN7ly92/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/sketricgen/MD2gT67kzVN7ly92/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Admin API - SketricGen Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Build smart website AI chatbots with Brand Agents and internal AI automation workflows with SketricGen AI Workforce.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"SketricGen Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.sketricgen.ai/dev-guide/admin-api\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://www.sketricgen.ai/sketricgen-agentspace.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Admin API - SketricGen Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Build smart website AI chatbots with Brand Agents and internal AI automation workflows with SketricGen AI Workforce.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://www.sketricgen.ai/sketricgen-agentspace.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/sketricgen/MD2gT67kzVN7ly92/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"SketricGen Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#7D4AEA\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.sketricgen.ai/dev-guide/admin-api\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/dev-guide/admin-api.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.sketricgen.ai/#organization\",\"name\":\"SketricGen Docs\",\"url\":\"https://docs.sketricgen.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/sketricgen/xEOJ-xI4AkgppWxS/logo/light.png?fit=max\u0026auto=format\u0026n=xEOJ-xI4AkgppWxS\u0026q=85\u0026s=5aaa568bd8a521722da44b684e1aacc8\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.sketricgen.ai#website\",\"name\":\"SketricGen Docs\",\"url\":\"https://docs.sketricgen.ai\",\"publisher\":{\"@id\":\"https://docs.sketricgen.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.sketricgen.ai/dev-guide/admin-api#webpage\",\"url\":\"https://docs.sketricgen.ai/dev-guide/admin-api\",\"name\":\"Admin API\",\"description\":\"Use the SketricGen Admin API to automate projects, agents, Brand Agents, knowledge bases, conversations, usage, members, and connectors.\",\"dateModified\":\"2026-10-19T08:53:01.759Z\",\"isPartOf\":{\"@id\":\"https://docs.sketricgen.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.sketricgen.ai/dev-guide/admin-api#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.sketricgen.ai/dev-guide/admin-api#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Developer Guides\",\"item\":\"https://docs.sketricgen.ai/dev-guide/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Admin API\",\"item\":\"https://docs.sketricgen.ai/dev-guide/admin-api\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.sketricgen.ai/dev-guide/admin-api#article\",\"headline\":\"Admin API\",\"name\":\"Admin API\",\"description\":\"Use the SketricGen Admin API to automate projects, agents, Brand Agents, knowledge bases, conversations, usage, members, and connectors.\",\"url\":\"https://docs.sketricgen.ai/dev-guide/admin-api\",\"mainEntityOfPage\":{\"@id\":\"https://docs.sketricgen.ai/dev-guide/admin-api#webpage\"},\"image\":\"https://www.sketricgen.ai/sketricgen-agentspace.png\",\"dateModified\":\"2026-10-19T08:53:01.759Z\",\"keywords\":\"SketricGen Admin API, AI agent management API, Brand Agent API, Teamspace automation, admin API key\",\"publisher\":{\"@id\":\"https://docs.sketricgen.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.sketricgen.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"SketricGen Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"SketricGen Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/dev-guide/admin-api.md","siteName":"SketricGen Docs","nav":{"global":null,"tabs":[{"tab":"Product","icon":"boxes","pages":[{"title":"Product","href":"/getting-started/overview"}]},{"tab":"Deployment","icon":"cloud-upload","pages":[{"title":"Deployment","href":"/deploy/custom-website"}]},{"tab":"Developers","icon":{"style":"solid","name":"code","library":"fontawesome"},"groups":[{"group":"Developer Guides","icon":{"style":"solid","name":"code","library":"fontawesome"},"pages":[{"title":"Developer Platform Overview","sidebarTitle":"Developer Overview","icon":{"name":"code","library":"fontawesome","style":"solid"},"href":"/dev-guide/overview"},{"title":"Connect AI Agents with SketricGen MCP","sidebarTitle":"Connect with MCP","icon":{"name":"plug","library":"fontawesome","style":"solid"},"description":"Connect Claude, ChatGPT, Codex, and other MCP clients to manage Brand Agents, knowledge bases, connectors, and visitor conversations.","href":"/dev-guide/mcp-connect"},{"title":"Admin API","sidebarTitle":"Admin API","icon":{"name":"key","library":"fontawesome","style":"solid"},"href":"/dev-guide/admin-api"},{"title":"Runtime API","sidebarTitle":"Runtime API","icon":{"name":"play","library":"fontawesome","style":"solid"},"description":"Use the SketricGen Runtime API to execute existing AI agents, stream responses, continue conversations, attach files, and resume human input.","href":"/dev-guide/public-api-usage"},{"title":"Structured Output for Developers","sidebarTitle":"Structured output","icon":"brackets","href":"/dev-guide/structured-output-tools"},{"title":"Python SDK","sidebarTitle":"Python SDK","icon":{"name":"python","library":"fontawesome","style":"brands"},"href":"/dev-guide/python-sdk"},{"title":"Node.js SDK","sidebarTitle":"Node.js SDK","icon":{"name":"node-js","library":"fontawesome","style":"brands"},"href":"/dev-guide/node-sdk"}]}]},{"tab":"Product Updates","icon":"sparkles","pages":[{"title":"Product Updates","href":"/changelog/v3.0.0"}]}]},"basePath":"","title":"Admin API - SketricGen Docs","deploymentId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","buildId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","dynamics":[],"chunks":[]}