AbuseZero

Workspaces

List the workspaces a credential can reach, and choose one for OAuth requests.

A workspace holds your benefits, policies, allow and block lists, claim history and credentials. Each workspace's data stays in that workspace. Keys, OAuth tokens and AbuseZero MCP server sessions reach only the workspaces they were granted.

Workspace IDs start with ws_.

How requests choose a workspace

curl https://api.abusezero.com/v1/benefits \
  -H "Authorization: Bearer $ABUSEZERO_ACCESS_TOKEN" \
  -H "AbuseZero-Workspace: ws_3a9c1e5b-7d2f-4b8a-a6e0-2c4f8b1d9e57"

The AbuseZero Node.js SDK sends the header for you when you pass workspace:

import { AbuseZero } from "abusezero/server";

const abusezero = new AbuseZero({
  accessToken: process.env.ABUSEZERO_ACCESS_TOKEN!,
  workspace: "ws_3a9c1e5b-7d2f-4b8a-a6e0-2c4f8b1d9e57",
  outage: "throw",
});

The AbuseZero CLI chooses its workspace with abusezero workspaces use ws_…. See AbuseZero CLI.

The workspace object

{
  "object": "workspace",
  "id": "ws_3a9c1e5b-7d2f-4b8a-a6e0-2c4f8b1d9e57",
  "name": "Acme Analytics"
}
FieldTypeDescription
object"workspace"The object type.
idstringThe workspace ID, starting with ws_.
namestring or nullThe workspace's name.

List workspaces

With an API key, returns the key's own workspace. With an OAuth token granted for one workspace, returns only that workspace. With any other OAuth token, returns every workspace the signed-in person belongs to. This request doesn't need the AbuseZero-Workspace header.

MethodPathScopeIdempotency-Key
GET/v1/workspacesworkspaces:readNot used

Also available as abusezero workspaces list in the AbuseZero CLI, abusezero_list_workspaces on the AbuseZero MCP server and workspaces() in the AbuseZero Node.js SDK.

Example

const workspaces = await abusezero.workspaces();

Response

Returns 200. Every workspace comes back in one response, so next_cursor is always null.

{
  "object": "list",
  "data": [
    {
      "object": "workspace",
      "id": "ws_3a9c1e5b-7d2f-4b8a-a6e0-2c4f8b1d9e57",
      "name": "Acme Analytics"
    },
    {
      "object": "workspace",
      "id": "ws_9e1b5d3f-2a7c-4e6b-8f0d-4a2c6e8b0d13",
      "name": "Acme Labs"
    }
  ],
  "next_cursor": null
}

Workspace errors

These errors can come back from any request made with an OAuth token.

CodeStatusMeaning
WORKSPACE_REQUIRED403The request didn't name a workspace, or the AbuseZero-Workspace value isn't a ws_ ID. Choose a workspace and retry.
WORKSPACE_ACCESS_DENIED403The token was granted for a different workspace, or the signed-in person no longer has access to this one. Choose another workspace, or ask its owner for access.

For every other code, see REST API errors.

How is this guide?

Last updated on

On this page