Skip to main content
The Workspace API gives external systems access to workspace-level and per-agent data, plus the administrative writes a workspace admin can do from Agent Management — the same information and actions available through the Workspace Explorer and Workspace Manager capabilities, but accessible over HTTP.
Every endpoint on this page is backed by a capability: reads by Workspace Explorer, writes by Workspace Manager. The same data and actions are reachable two ways: over HTTP with a workspace API key, or by giving an agent the capability and asking it in plain language. Both routes hit the same code and apply the same access rules and redaction. Asking an agent is usually faster for exploring or one-off changes; the HTTP API is for systems that work on a schedule.
This page is the guide. For the machine-readable spec — every endpoint with its parameters, response fields, and error codes — see the API Reference tab in the top navigation.

Base URL

All requests go to the Abundly service host:
Enterprise customers on a dedicated deployment have their own service host, in the form https://<your-tenant>.service.abundly.ai.

Authentication

Requests are authenticated with workspace API keys (wk_...). GET endpoints require the Workspace read API scope; the write endpoints (POST, PUT, PATCH and DELETE) require the Workspace write API scope. The scopes are independent — enable both on a key that should read and write. Include the key as a Bearer token:

Enabling workspace API access

The Workspace API is an enterprise feature that Abundly enables per workspace. If the API Keys tab says the Workspace API is not enabled for your workspace, contact us — until it is, no new workspace keys can be created and existing ones are rejected.
  1. Go to Workspace Settings → API Keys
  2. Create a new key (or edit an existing one)
  3. Check the Workspace read API and/or Workspace write API scope
  4. Save and copy the key
Workspace API keys grant access to all workspace data including chat histories, messages, member information, and agent configurations — and, with the write scope, the power to pause agents, change their models and limits, move them between teams, and create teams and change who is in them. Keep them secure and rotate them regularly.

Workspace endpoints

Read endpoints are GET requests under /workspaceapi/. No workspace ID is needed in the URL — the key identifies the workspace.

Reading the agent list

/workspaceapi/agents returns one entry per agent. id, name, groupId, adminOnly, enabled, capabilities, tags, updatedAt and isPrivate are always present; description, imageUrl, adminRestriction, agentDiscoverability, dailyCreditLimit, valueStatement (the owner’s one-or-two-sentence statement of why the agent exists), criticality (critical, high, medium or low) and keyMetrics appear when they are set. valueEntries may also appear; it is deprecated (data from the retired value capture feature) and will be removed in a later release. capabilities is a mixed array: plain strings for capabilities with no settings, and { name, settings } objects for those that have them. Normalise to the name before counting or comparing:
Adding ?includeOverview=true attaches an overview object with lastUsageByAgent (a map of agent id to timestamp) and reducedAgents, which carries an entry for every agent — restricted and personal ones included — with its access, capabilities, hasInstructions (whether it has instructions—not the text itself), llmPreferences, httpApis, mcpServers, and the exposure flags (mcpServerExposed, httpApiExposed, webhooksExposed, widgetExposed, documentApiExposed).

Who owns an agent

There is no createdBy field. Ownership is expressed through the access object on each agent: To attribute an agent to the person who built it, take the access.users[] entry with level admin. A single ?includeOverview=true call covers the whole workspace, including restricted and personal agents, so builder attribution needs no per-agent requests.

Per-agent endpoints

Drill into a specific agent’s data. The agent must belong to the workspace and, with the single exception of its promotion review history, not be restricted or personal — see Restricted and personal agents below.

Promotion reviews

In workspaces where promotion to production goes through review (lifecycle phases), /workspaceapi/promotion-requests returns every request in the workspace — restricted and personal agents included — with each review step, the decisions taken so far, and who the outstanding steps are waiting for. Pass ?agentId= or use the per-agent endpoint for one agent’s history.
The API reads the review; it does not take part in it. Approving and rejecting stay in the portal, where the decision is recorded against the person who made it — a workspace API key belongs to the workspace rather than to any one person, so it cannot stand in for a reviewer.

Change history

Two endpoints tell you what changed on an agent and when — for example, to flag a production agent that has drifted since its promotion was approved and send it back for review.
  • /action-log returns the same rows as Usage → User action log in the portal: every change to an agent, team or workspace setting, with who made it and when, newest first. Narrow it with ?agentId= and ?from=, or by ?eventType= (comma-separated, for example agent.instructions_changed,agent.capabilities_changed). Restricted, personal and deleted agents are included, as they are in the portal.
  • /agents/:agentId/instruction-versions returns the agent’s instruction history, newest first: who made each change, when, and the length of each version’s text. The first entry is the live instructions. With ?since=, you get the version in effect at that time plus every later one — enough to diff the instructions as approved against the current ones. Add ?includeContent=true for the text, or ?version= for a single version. Only the latest 100 superseded versions are kept.
The action log never contains instruction or prompt text. Changed values appear as «redacted:…» tokens that show a value changed but not what it is — use /instruction-versions for the text itself. Changes made by Abundly staff show the actor as “Abundly staff”.

Write endpoints

Write endpoints mirror the Workspace Manager capability — the administrative changes a workspace admin can make from Agent Management without opening an agent, plus creating teams and managing their members. They require the Workspace write API scope. The endpoints below are batch POST requests:

Batch semantics

Each of the endpoints above is a batch operation: the JSON body carries an ids array plus the values to apply, and each id gets its own result. A bad id never fails the rest of the batch — the request returns 200 as long as it was well-formed, so always check the per-id results:
A write that would not change anything is reported with unchanged: true and skipped in the audit log, so re-running a bulk update is safe and quiet.

Tag rules

The three tag endpoints apply the same rules as the portal, so tags written through the API match what the web UI produces. Tags are trimmed, lowercased and deduplicated on the way in — sending "Sales" stores sales. A tag can be at most 50 characters and cannot contain line breaks; a body that breaks either rule is rejected with 400. Each agent, team or member can carry at most 50 tags. An entity already above that keeps its tags and can still have tags removed; only ids that would grow past the limit come back with success: false.

Previewing team moves

Moving an agent changes who can reach it and can flip team-scoped capabilities on or off. Send "dryRun": true to /workspaceapi/agents/team-moves first: nothing moves, and each result carries an impact object naming the members who gain or lose access and the capabilities that flip. /workspaceapi/teams/tags and /workspaceapi/agents/team-moves return 400 when team settings are not enabled for the workspace.

Teams and team members

These endpoints act on one team or one membership and answer with standard status codes rather than batch results:
  • Roles are the team roles the read endpoints return: admin, member or guest.
  • Membership writes are idempotent. Repeating a PUT leaves one membership and answers 200. A DELETE for someone who isn’t in the team answers 404, which you can treat as already removed.
  • Members must already belong to the workspace. Adding someone who doesn’t returns 404; invite them to the workspace first.
  • Creating a team is not idempotent. Team names don’t have to be unique, so a create retried after a timeout can leave a duplicate. Create teams with a tag you own, and look the team up with /workspaceapi/teams?tag= before retrying.
  • Teams can’t be deleted through the API. Delete them in the portal.
All four return 400 when team settings are not enabled for the workspace.

Audit trail

Every successful write is recorded in the workspace’s User action log (on the Usage page), attributed to the user who created the API key, with source Workspace API. Team membership changes are the exception: like the same changes made in the portal, they are logged but don’t appear in the User action log.
Unlike the read endpoints, writes can target restricted and personal agents — matching the portal, where a workspace admin can pause or retag an agent they cannot open.

Restricted and personal agents

An agent whose default access is Nothing (access.customer is none) is restricted to a specific list of users. The Workspace API has no calling user to check that list against, so it treats every restricted and personal agent as off-limits for content reads.
Restricted and personal agents appear in /agents, in overview.reducedAgents, in overview.lastUsageByAgent, in /agent-usage and in /credits agentUsage — but every /agents/:agentId route and subresource returns 403 for them, apart from /agents/:agentId/promotion-requests. Workspace-wide endpoints still include them: their changes appear in /action-log and their review requests in /promotion-requests. A loop that lists agents and then fetches each one’s detail will silently skip them, and any count built that way will be too low.
The 403 says exactly what happened:
The reliable pattern for workspace-wide reporting is to take everything from one /agents?includeOverview=true call — which already contains access, capabilities, integrations and usage timestamps for every agent — and to treat the per-agent endpoints as a drill-down for individual agents that aren’t restricted or personal rather than something to iterate. Check isPrivate before requesting detail for an agent.

Pagination

Only three endpoints paginate: Every other endpoint returns its complete set in one response, and page/pageSize are ignored there.

Credits are a live snapshot

/workspaceapi/credits reports the current state only: creditsUsedToday per agent and creditsUsedThisMonth per team, alongside the workspace balances. It accepts no date parameters and there is no historical endpoint — if you need a time series, snapshot the response yourself on a schedule. agentUsage is keyed by agent id and covers every agent in the workspace, including disabled, restricted and personal ones. groupUsage is keyed by team id.

Documents and response size

/workspaceapi/agents/:agentId/documents inlines the complete textContent of every document in the list response. That is deliberate — it makes one call enough for an audit or a backup — but on an agent with many large documents the response gets big. Add ?excludeContent=true to get metadata only. textContent and data are dropped from every entry; names, mime types, scopes, and folder structure stay. Use it to enumerate documents cheaply, then fetch the ones you need individually from /documents/:docId.

Tool usage

/workspaceapi/agents/:agentId/tool-usage/:toolName counts how often one specific tool was called by one agent, across both chat conversations and trigger runs. /workspaceapi/agents/:agentId/key-metrics returns the agent’s key metrics for a period: per metric the count, for measured metrics the aggregate (the average or total, as measurement.aggregation says), the same two figures for the period of equal length before (previousCount, previousAggregate), and up to recentLimit recent records with their refs (default 0, maximum 500). The definitions themselves are on the agent object as keyMetrics. See Choosing a period.

Tools are not capabilities

A capability is a bundle of tools that you switch on for an agent. A tool is a single action the agent can take. :toolName expects the tool name, which is always lowercase with underscores — for example code_execution, send_email, get_document, query_document_data. Capability names such as codeExecution or readDocuments are not tool names and will never match. A capability like readDocuments contains a dozen or more tools, so there is no single usage number for it — query the individual tools and add them up.

Finding the tool names

The quickest way is to ask an agent. Every agent knows the names of its own tools, so “What tools do you have, and what are they called?” gets you the exact strings to query. To ask about a different agent — “Which tools has Buggsy used this month, and how often?” — use an agent with the Workspace Explorer capability, which can read across the workspace. To do it over the API, read the steps of an activity log entry. Each step with a toolName gives you a name you can query directly:
Steps of type thinking and text have no toolName, so expect null in that list.

Reading the response

Unknown tool names

A name that does not exist returns 404, so a typo or a capability id fails loudly instead of looking like an idle tool:
200 with totalCount: 0 therefore means something specific: this is a real tool, and this agent has not called it in the window.
Existence is checked against the platform’s tools plus the MCP tools your agent has discovered — not against the capabilities the agent has enabled. Asking about a real tool the agent doesn’t have returns 200 with a zero count, not 404. A tool that already has usage recorded never returns 404, even if the MCP server behind it has since been renamed, disabled, or removed.
totalCount is the complete count over the window. recentCalls is only the most recent calls, and it is not paginated: For a complete call history rather than the latest few, page through /activity-log with ?page= and ?pageSize= to find the runs, then read each one with ?entryId= to get its steps. List pages don’t include steps.

Choosing a period

The two period endpoints, /agent-usage and /agents/:agentId/key-metrics, take either a lookback or a fixed period: Daily series use UTC day boundaries.

Agent usage

/workspaceapi/agent-usage returns one row per agent for a period, restricted and personal agents included and marked with isPrivate: the agent’s key metrics (count, and for measured metrics the aggregate), its triggers & chats with a daily series, and the credits it used. Every figure comes with the same figure for the period of equal length immediately before (previousCount, previousUsed, previousAggregate), as raw values rather than percentages, so you can apply your own rule for what counts as a trend. The portal shows a percentage only when the previous value is at least 10, and marks an agent created inside the period as new instead (createdAt is on the row). Rows also carry the team, effective lifecycle phase, criticality, value statement, tags, owners and whether the agent is enabled (a disabled agent’s figures for the period still count), which is what the portal’s Usage → Agent usage table filters on and shows in the agent hover card. The rows are what a workspace admin sees on that table, and the portal’s JSON export of it carries the same rows, filtered as shown on screen. A restricted or personal agent’s row is figures only: its /agents/:agentId endpoints still return 403.
Key metrics are defined per agent, so compare an agent with itself over time rather than ranking agents against each other.

Example

Status codes

Every response from /workspaceapi/, including errors, is JSON. Errors carry a single error field with a human-readable message:

Rate limits

There is no enforced rate limit on the Workspace API today, and responses carry no rate-limit headers. Keep request rates reasonable — roughly one request per second is plenty for reporting and sync workloads, and the workspace-wide endpoints are designed so that most jobs need only a handful of calls. Limits may be introduced later, so avoid building anything that depends on unlimited throughput.

Data redaction

Credential values, API keys, and secret values are automatically stripped from all responses — the same redaction rules applied by the Workspace Explorer capability. Secret names and metadata are included so you can see what’s configured without exposing sensitive values.

API key scopes

Workspace API keys support three scopes that can be enabled independently; every key needs at least one: Existing keys default to Agent API endpoints only. Enable the read and/or write scope explicitly to use the endpoints documented on this page.

Learn more

API Access

Expose agents as HTTP APIs, MCP servers, webhooks, or chat widgets

Access Control

Workspace roles, team permissions, and agent access levels