Workspace AI resources
A workspace groups the agents and resources used for a piece of work. Start with one goal below, then follow its focused guide. Membership, policy, and plan checks apply to these operations; supplying a workspace identifier alone does not grant access.
Paths are relative to https://api.chainabit.com/api/v1. Send Authorization: Bearer $TOKEN with an interactive session token.
Workspace Agents
| Method | Path | Purpose | Success |
|---|---|---|---|
| POST | /workspaces/:workspaceId/ai/agents | Create a workspace agent | 201 |
| GET | /workspaces/:workspaceId/ai/agents/discover | Discover accessible agents | 200 |
| POST | /workspaces/:workspaceId/ai/agents/:agentId/runs | Start a run | 201 |
| GET | /workspaces/:workspaceId/ai/agents/:agentId/runs | Read run history | 200 |
Create Workspace Agent
Use the agent creation tutorial for the request fields and identifier handling. Creation accepts name, with optional description, systemPrompt, toolIds, memory_mode, and base_model.
Run Workspace Agent
Starting a run can use paid AI services. Send a prompt string and an Idempotency-Key header. Reuse the key only when retrying the same request; use a new key for a new intended run. See Idempotency.
Get a Single Run
Read the agent's run history with the GET operation above and locate the run by its returned identifier. The creation tutorial demonstrates this flow.
Workspace Twins
Twins are system-managed. Use Configure your AI Twin to resolve a Twin and review permitted preferences, or use the Twins reference for profile, evidence, timeline, and memory operations.
List Workspace Twins
For your own Twin, use the supported Twin resolution flow. Do not assume a generic collection operation is available for every resource.
Test Twin Interaction
POST /workspaces/:workspaceId/ai/twins/:twinId/test accepts a required prompt string and returns 201 with a preview in data. This preview is not evidence of a model-generated answer or of a completed production run.
Workspace Tools
GET /workspaces/:workspaceId/ai/tools returns tools available in the workspace. Use registered tool keys when configuring an agent's toolIds allowlist.
List Workspace Tools
curl --fail-with-body -sS \
"https://api.chainabit.com/api/v1/workspaces/$WORKSPACE_ID/ai/tools" \
-H "Authorization: Bearer $TOKEN"Webhook Tool Security Policy
Treat a tool's ability to call an external service as an explicit capability. Grant only the tools needed for the work. See agent tool registration and connectors for their respective contracts.
Workspace Skills
Skills provide reusable guidance. Manage skills walks through creating an identity, adding a version, and publishing it.
Create Skill
Use POST /workspaces/:workspaceId/ai/skills for metadata. The guidance belongs to a version, rather than the skill identity.
Skill Versions
Use POST /workspaces/:workspaceId/ai/skills/:skillId/versions to add guidance, then POST /workspaces/:workspaceId/ai/skills/:skillId/versions/:versionId/publish to publish it. The skill tutorial supplies the complete sequence and bundle alternatives.
Workspace Twin Policies
PUT /workspaces/:workspaceId/ai/twin-policies updates a workspace policy. Shared policies can restrict observation; they cannot grant another person's consent.
Upsert Twin Policies
Review Twin preferences before changing workspace policy. A personal Twin's settings and a workspace restriction have different owners and cannot be substituted for each other.
Prompt templates
Use Create prompt sets to create a reusable prompt and inspect its compiled preview. The Prompt Lab reference describes the supported create and test requests.