API and MCP

Users

The signed-in user's own profile and settings

Get your profile

GET /api/v1/user

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

Your own profile: your user id, email and name. Only a dashboard session may call this, never an API token.

Responses

Status Description Body
200 Your id, email and name. UserProfile
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" \
  -H "Authorization: Bearer $SPICE_API_TOKEN"

Update your profile

PUT /api/v1/user

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

Changes your own display name. Your email cannot be changed here. Only a dashboard session may call this, never an API token.

Request body

application/json (required)

UpdateUser

Responses

Status Description Body
200 Your id, email and new name. UserProfile
400 name is missing or blank. Error
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 PUT "https://api.spicelabs.io/api/v1/user" \
  -H "Authorization: Bearer $SPICE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '<JSON body>'

Get your preferences

GET /api/v1/user/preference

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

Your own preferences: the timezone dates are shown in, and last_context, the organization and project you were last in, which a fresh sign-in lands on. A preference you have never set is left out. Only a dashboard session may call this, never an API token.

Responses

Status Description Body
200 Your preferences. UserPreferences
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/preference" \
  -H "Authorization: Bearer $SPICE_API_TOKEN"

Change your preferences

PATCH /api/v1/user/preference

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

Changes any subset of your preferences. A field you leave out is unchanged; a field sent as null is cleared. timezone must be an IANA zone name such as America/Los_Angeles; last_context must name your organization and a project in it. The answer is your preferences as they now stand. Only a dashboard session may call this, never an API token.

Request body

application/json (required)

UpdateUserPreferences

Responses

Status Description Body
200 Your preferences after the change. UserPreferences
400 timezone is not a known zone, or last_context names an organization that is not yours or a project that is not in it. Error
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 PATCH "https://api.spicelabs.io/api/v1/user/preference" \
  -H "Authorization: Bearer $SPICE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '<JSON body>'