[Go to site: main page, start]

REST APIGET

Workspaces

List the workspaces an API key or OAuth sign-in can act in, pick one per request with the X-Workspace-Id header, and create or delete workspaces of your organization.

GEThttps://post.adaptlypost.com/post/api/v1/workspaces

Lists the workspaces the calling key or OAuth sign-in can act in, with your role and what you can do in each. Any valid key can call it, whatever its role.

API Key (Bearer token)
Permission:any valid keyRoles and permissions

When to call it

Call it when an integration starts, before it reads or writes anything. An OAuth connection, such as the Claude or ChatGPT connector, reaches every workspace its member belongs to, across organizations. An API key reaches only its own workspace, so the list has one entry.

If you are an agent: when the list has more than one workspace and the user has not named one, ask which to use. Then send its id in X-Workspace-Id on every call, and read its can before you offer to schedule or publish.

Response fields

FieldDescription
idThe workspace ID. Send it in the X-Workspace-Id header to act in this workspace.
nameThe workspace name.
organizationThe organization that owns the workspace, with its id and name.
roleYour role in this workspace: key is one of admin, editor, contributor, viewer; name is the label in your language. For an API key, the key's role.
permissionsEvery permission you hold in this workspace. For an API key, the key's permissions after its creator's current role is applied.
isDefaultTrue for the workspace a call lands in when it sends no X-Workspace-Id header.
currentTrue for the workspace this call landed in.
canThree booleans, draft, schedule and publish, for what your role allows with posts in this workspace.

Choose a workspace with X-Workspace-Id

Every endpoint accepts an optional X-Workspace-Id header. Set it to an id from this list and the call runs in that workspace, with your role there. Without it the call lands in the default workspace.

Request headerBash
1X-Workspace-Id: ag_02k7m

A workspace the caller cannot reach answers 403 with code workspace_access_denied and the workspaceId it refused. An API key belongs to one workspace, so it gets the same 403 for any other workspace's id: send the key's own workspace id or leave the header out.

403 Forbidden: workspace access deniedJSON
1{2  "statusCode": 403,3  "error": "Forbidden",4  "code": "workspace_access_denied",5  "workspaceId": "ag_03p4r",6  "message": "You have no access to workspace ag_03p4r. Call GET /workspaces to list the workspaces you can use, and send one of those ids in the X-Workspace-Id header."

Create a workspace

POSThttps://post.adaptlypost.com/post/api/v1/workspaces

Creates a workspace in your organization. Every organization owner and admin becomes its admin.

API Key (Bearer token)
Permission:workspace.manageRoles and permissions

The key's creator must also be an organization owner or admin when the call is made. Otherwise it answers 403 permission_denied.

Request body

ParameterTypeDescription
nameREQUIREDstring1 to 100 characters, without < or >. No other workspace in the organization may have this name.
descriptionstringUp to 500 characters, without < or >.
connectionLimitnumber0 to 10000. The most social accounts the workspace may connect. Leave it out for no limit.

Answers 201 with the new workspace. An invalid body, or a name another workspace in the organization already has, answers 400. A plan with no room for another workspace answers 403 subscription_required.

Response 201JSON
1{2  "id": "ag_04q8s",3  "name": "Client C",4  "description": "Retail client",5  "organizationId": "org_01hzq",6  "isDefault": false,
FieldDescription
idThe new workspace ID. Send it in X-Workspace-Id to act in the workspace.
nameThe workspace name.
descriptionThe description, or null.
organizationIdThe organization that owns the workspace.
isDefaultWhether this is the organization's default workspace.
connectionLimitThe most social accounts the workspace may connect, or null for no limit.
createdAtWhen the workspace was created.

Delete a workspace

DELETEhttps://post.adaptlypost.com/post/api/v1/workspaces/:id

Deletes a workspace of your organization with everything it holds: posts, feeds, inbox items, API keys and connect links. It cannot be undone.

API Key (Bearer token)
Permission:workspace.manageRoles and permissions

The key's creator must also be an organization owner or admin when the call is made. Otherwise it answers 403 permission_denied.

Answers 200 with { "success": true }. The default workspace, the last workspace of the organization and a workspace that still has connected social accounts cannot be deleted, and each answers 400. Remove the accounts first. An id that is not a workspace of your organization answers 404.

If you are an agent: name the workspace and get the user's yes before you delete it. A deleted workspace cannot be restored.

Refusals

403 with code permission_denied means the key's role lacks the permission, or the key's creator is not an organization owner or admin where the call needs one. The answer is final, so do not retry. Ask the user to have an organization admin make the change.

403 with code subscription_required means the plan is not active or has reached a limit: no room for another workspace, or no team seat left for an invitation. The body also carries errorCode, limitKey, limit and currentUsage. Tell the user to upgrade the plan, and do not retry.

403 Forbidden: plan limit reachedJSON
1{2  "statusCode": 403,3  "error": "Forbidden",4  "code": "subscription_required",5  "errorCode": "LIMIT_EXCEEDED",6  "limitKey": "max_workspaces",

A 429 means you hit the rate limit. Wait for the time in Retry-After before you call again.

Example
1curl --request GET \2  --url https://post.adaptlypost.com/post/api/v1/workspaces \3  --header 'Authorization: Bearer <api-key>'

3 lines