API and MCP
Projects
The projects in your organization: create, rename, delete, restore and configure them
Invite a person
POST /api/v1/org/{orgId}/invite
Credentials: Dashboard sign-in only. API tokens are refused.
Gives the person at email access to a project in this organization and sends them an invitation email. teamIds is required and names at least one team: a new member joins the organization in those teams, and an existing member is added to any of them they are not in yet. A former member is instead brought back into the teams they were in before, and teamIds is not applied to them. projectUuid names the project; when it is omitted, the project this session is scoped to is used. The answer says whether it worked (Ok) with a message; a person who already had access to the project is reported with status already_exists. Only a dashboard session may call this, never an API token. Requires org:invite_user.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
orgId required | path | string (uuid) |
Request body
application/json (required)
Responses
| Status | Description | Body |
|---|---|---|
200 | Whether the person was added, and why not if not. | InviteResult |
400 | email is missing or not an email address, or teamIds is empty or has a malformed id. | 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 | The project in projectUuid, or a team in teamIds, does not exist in your organization. | Error |
500 | A fault on our side. | Error |
Example
curl -X POST "https://api.spicelabs.io/api/v1/org/<orgId>/invite" \
-H "Authorization: Bearer $SPICE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '<JSON body>' List projects
GET /api/v1/org/{orgId}/project
Credentials: API token or dashboard sign-in.
Every project in this organization that is not deleted. The answer names the organization (org_uuid, org_name) and gives each project's name and uuid. Requires org:view.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
orgId required | path | string (uuid) |
Responses
| Status | Description | Body |
|---|---|---|
200 | The organization's projects. | ProjectList |
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>/project" \
-H "Authorization: Bearer $SPICE_API_TOKEN" Create a project
POST /api/v1/org/{orgId}/project
Credentials: Dashboard sign-in only. API tokens are refused.
Creates a project in this organization with the name you give, and makes you a member of it. The answer holds the new project's uuid, its name in project, and a session token for it in jwt. Only a dashboard session may call this, never an API token. Requires org:create_project.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
orgId required | path | string (uuid) |
Request body
application/json (required)
Responses
| Status | Description | Body |
|---|---|---|
200 | The new project and a session for it. | NewProject |
400 | name is missing or blank. | 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 POST "https://api.spicelabs.io/api/v1/org/<orgId>/project" \
-H "Authorization: Bearer $SPICE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '<JSON body>' List deleted projects
GET /api/v1/org/{orgId}/project/deleted
Credentials: API token or dashboard sign-in.
The deleted projects in this organization that can still be restored. The answer names the organization (org_uuid, org_name) and gives each project's name, uuid and deletedAt. Requires org:view.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
orgId required | path | string (uuid) |
Responses
| Status | Description | Body |
|---|---|---|
200 | The organization's deleted projects. | ProjectList |
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>/project/deleted" \
-H "Authorization: Bearer $SPICE_API_TOKEN" Get a project
GET /api/v1/project/{projectId}
Credentials: API token or dashboard sign-in.
One project in your organization, by id. The answer holds its id, name, orgId, whether it is a demoProject, and its enabled featureFlags. A dashboard session may name any project in the organization that one of your teams reaches; an API token only its own project. Requires project:view on the project named.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
projectId required | path | string (uuid) |
Responses
| Status | Description | Body |
|---|---|---|
200 | The project. | Project |
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 project with this id exists in your organization, or none of your teams reaches it. | Error |
500 | A fault on our side. | Error |
Example
curl -X GET "https://api.spicelabs.io/api/v1/project/<projectId>" \
-H "Authorization: Bearer $SPICE_API_TOKEN" Update a project
PUT /api/v1/project/{projectId}
Credentials: Dashboard sign-in only. API tokens are refused.
Changes the project's name, the only field this call can change: it must be unique in the organization and at most 255 characters, and leaving it out leaves it as it is. Storage, memory, the artifact cutoff and feature flags are set by Spice Labs support, not through the API. The answer is the updated project. Only a dashboard session may call this, never an API token. It may name any project in the organization that one of your teams reaches. Requires project:admin on the project named.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
projectId required | path | string (uuid) |
Request body
application/json (required)
Responses
| Status | Description | Body |
|---|---|---|
200 | The updated project. | Project |
400 | name is longer than 255 characters or already used by another project. | Error |
401 | The token is missing, expired, revoked or of the wrong kind. | Error |
403 | You reach the project but lack project:admin on it. | Error |
404 | No project with this id exists in your organization, or none of your teams reaches it. | Error |
500 | A fault on our side. | Error |
Example
curl -X PUT "https://api.spicelabs.io/api/v1/project/<projectId>" \
-H "Authorization: Bearer $SPICE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '<JSON body>' Delete a project
DELETE /api/v1/project/{projectId}
What it changes: The project, its surveys, reports and portfolios become unreachable until Restore a deleted project brings them back.
Credentials: Dashboard sign-in only. API tokens are refused.
Deletes a project. It leaves the project list immediately and its signed-in sessions stop working, but it can be restored with POST /api/v1/project/{projectId}/restore for the organization's retention period, 90 days unless changed with retentionDays; after that it may be removed for good. The last project in an organization cannot be deleted. Only a dashboard session may call this, never an API token. Requires org:delete_project.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
projectId required | path | string (uuid) |
Responses
| Status | Description | Body |
|---|---|---|
204 | The project is deleted. | |
400 | This is the last project in 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 project with this id exists in your organization. | Error |
500 | A fault on our side. | Error |
Example
curl -X DELETE "https://api.spicelabs.io/api/v1/project/<projectId>" \
-H "Authorization: Bearer $SPICE_API_TOKEN" Restore a deleted project
POST /api/v1/project/{projectId}/restore
Credentials: Dashboard sign-in only. API tokens are refused.
Brings back a deleted project, within the organization's retention period. The answer is the restored project. Only a dashboard session may call this, never an API token. Requires org:delete_project.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
projectId required | path | string (uuid) |
Responses
| Status | Description | Body |
|---|---|---|
200 | The restored project. | Project |
400 | The project is not deleted. | 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 project with this id exists in your organization. | Error |
500 | A fault on our side. | Error |
Example
curl -X POST "https://api.spicelabs.io/api/v1/project/<projectId>/restore" \
-H "Authorization: Bearer $SPICE_API_TOKEN" List my projects
GET /api/v1/user/project
Credentials: Dashboard sign-in only. API tokens are refused.
The projects you, the signed-in person, can reach through your teams in your organization. The answer names the organization (org_uuid, org_name), you (user_uuid) and each project's name and uuid. Only a dashboard session may call this, never an API token.
Responses
| Status | Description | Body |
|---|---|---|
200 | The projects you can reach. | MyProjects |
401 | The token is missing, expired, revoked, or is an API token. | Error |
403 | The token is valid but not allowed to do this. | Error |
500 | A fault on our side. | Error |
Example
curl -X GET "https://api.spicelabs.io/api/v1/user/project" \
-H "Authorization: Bearer $SPICE_API_TOKEN"