API and MCP

Organizations

Your organization: its details, its members and its settings

Get the organization

GET /api/v1/org/{orgId}

Credentials: API token or dashboard sign-in.

The organization this credential belongs to: its id, name, slug and retentionDays, how long a deleted project can be restored. Requires org:view.

Parameters

Name In Type Description
orgId required path string (uuid)

Responses

Status Description Body
200 The organization. Organization
401 The token is missing, expired, revoked or of the wrong kind. Error
403 The orgId in the path is not the organization this credential belongs to. Error
500 A fault on our side. Error

Example

curl -X GET "https://api.spicelabs.io/api/v1/org/<orgId>" \
  -H "Authorization: Bearer $SPICE_API_TOKEN"

Update the organization

PUT /api/v1/org/{orgId}

Credentials: Dashboard sign-in only. API tokens are refused.

Changes the organization's name (at most 255 characters) or retentionDays (1 to 365), the number of days a deleted project can still be restored. A field you leave out is left as it is. The answer is the updated organization. Only a dashboard session may call this, never an API token. Requires org:manage_org.

Parameters

Name In Type Description
orgId required path string (uuid)

Request body

application/json (required)

UpdateOrganization

Responses

Status Description Body
200 The updated organization. Organization
400 name is longer than 255 characters, or retentionDays is outside 1 to 365. Error
401 The token is missing, expired, revoked or of the wrong kind. Error
403 The token is valid but not allowed to do this. Error
500 A fault on our side. Error

Example

curl -X PUT "https://api.spicelabs.io/api/v1/org/<orgId>" \
  -H "Authorization: Bearer $SPICE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '<JSON body>'

Delete the organization

DELETE /api/v1/org/{orgId}

What it changes: The organization and all its projects become unreachable for every member. Restoring it is a support request.

Credentials: Dashboard sign-in only. API tokens are refused.

Deletes the organization together with every project in it and every membership. It disappears immediately; after its retention period, 90 days unless changed with retentionDays, it may be removed for good. There is no API call to restore it. Only a dashboard session may call this, never an API token. Requires org:manage_org.

Parameters

Name In Type Description
orgId required path string (uuid)

Responses

Status Description Body
204 The organization is deleted.
401 The token is missing, expired, revoked or of the wrong kind. Error
403 The orgId in the path is not the organization this credential belongs to. Error
500 A fault on our side. Error

Example

curl -X DELETE "https://api.spicelabs.io/api/v1/org/<orgId>" \
  -H "Authorization: Bearer $SPICE_API_TOKEN"

List members

GET /api/v1/org/{orgId}/user

Credentials: API token or dashboard sign-in.

Every person who is a member of this organization, in users, each with their id, email and name. Requires org:view.

Parameters

Name In Type Description
orgId required path string (uuid) The organization's id.

Responses

Status Description Body
200 The organization's members. MemberList
401 The token is missing, expired, revoked or of the wrong kind. Error
403 The orgId in the path is not the organization this credential belongs to. Error
500 A fault on our side. Error

Example

curl -X GET "https://api.spicelabs.io/api/v1/org/<orgId>/user" \
  -H "Authorization: Bearer $SPICE_API_TOKEN"

Remove a member

DELETE /api/v1/org/{orgId}/user/{userId}

What it changes: This person loses access to the organization and its projects and their sign-ins end immediately; API tokens and Spice Passes they created keep working until canceled.

Credentials: Dashboard sign-in only. API tokens are refused.

Removes a person from this organization and from all of its teams, and ends their sign-ins to it immediately. API tokens and Spice Passes they created keep working until canceled from the project's credentials. The last member of an organization cannot be removed. Only a dashboard session may call this, never an API token. Requires org:remove_user.

Parameters

Name In Type Description
orgId required path string (uuid) The organization's id.
userId required path string (uuid)

Responses

Status Description Body
204 The person is removed.
400 This is the last member of the organization. Error
401 The token is missing, expired, revoked or of the wrong kind. Error
403 The token is valid but not allowed to do this. Error
404 No person with this id is a member of your organization. Error
500 A fault on our side. Error

Example

curl -X DELETE "https://api.spicelabs.io/api/v1/org/<orgId>/user/<userId>" \
  -H "Authorization: Bearer $SPICE_API_TOKEN"