Skip to main content
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.

Base URL

Store it as an environment variable so you can update environments without changing application code:

Authentication

Every request requires an Admin API key:
Create the key from Teamspace settings → API keys → Create key → Admin key. The plaintext value is shown once. When creating the key, choose:
  • Scope: one project, or the entire Teamspace.
  • Role: Viewer, Editor, or Admin.
  • Expiration: 30, 90, 180, or 365 days, or a custom date within the supported maximum.
Admin keys expire and cannot be changed in place. Revoke and recreate a key when its role, scope, or expiration needs to change.

First request

Confirm the Teamspace before performing any write:
Expected shape:
Never log the authorization header or include it in an error report.

Project and role behavior

Project-scoped key

A project-scoped key can only access its selected project. Reads return resources from that project, and writes targeting another project return 403 project_scope_mismatch.

Teamspace-scoped key

A Teamspace-scoped key can read across projects. Write operations that create project-owned resources require a project_id in the request body.

Roles

  • Viewer: Read Teamspace resources, agents, Brand Agent settings, knowledge bases, conversations, traces, usage, and connector status.
  • 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

Endpoint directory

Teamspace and projects

Creating projects requires a Teamspace-scoped Admin key with Admin permission.

Workflow agents

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 sk_runtime_ key.

Brand Agents

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

The Admin API can create an empty knowledge base but does not currently upload files into it. Website-based Brand Agent creation is the supported API flow that crawls content and builds a populated knowledge base.

Conversations, traces, members, and usage

Conversation and trace endpoints are read-only. Member endpoints require a Teamspace-scoped Admin key with Admin permission.

Connectors

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.

Example: list agents

Response:

Example: create a Brand Agent

The project_id field is required for a Teamspace-scoped key and optional for a project-scoped key. Initial response:
Poll the job:
Do not treat queued, crawling, crawled, kb_processing, or agent_finalizing as completion. Only succeeded and failed are terminal states.

Example: update a Brand Agent safely

Read the current settings first:
Then patch only the intended fields:
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:
  1. GET /connectors to choose an app.
  2. GET /connectors/{app_slug}/tools to inspect grantable actions.
  3. POST /connectors/{app_slug}/connect-link to create a hosted authorization URL.
  4. Give that URL to the intended user. Do not log or persist it.
  5. Poll GET /connectors/{app_slug}/connection until connected is true.
  6. 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 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.

Error format

Errors use a stable machine-readable code:
Handle the code in application logic. The human-readable message may become clearer without changing the code. Common errors:

Operations the Admin API does not expose

The Admin API intentionally does not provide:
  • API-key creation, rotation, or revocation. A signed-in human manages keys in the app.
  • Billing changes, credit purchases, or subscription cancellation.
  • Owner transfer or owner-role grants.
  • New member invitations or member removal.
  • Direct file upload into a knowledge base.
  • Provider passwords or raw connector OAuth credentials.