PUT
/
users
/
api-keys
Create new API key
curl --request PUT \
  --url https://api.wirespeed.co/users/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "role": "ADMIN",
  "expirationDays": 123
}'
{
  "id": "<string>",
  "teamId": "<string>",
  "userId": "<string>",
  "expiration": "<string>",
  "lastUsed": "<string>",
  "role": "ADMIN",
  "name": "<string>",
  "createdAt": "<string>",
  "token": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Name for the API key (1-100 characters)

role
enum<string>
required

Role permissions to assign to the API key

Available options:
ADMIN,
ANALYST,
VIEWER
expirationDays
number
required

Number of days until the API key expires

Response

id
string
required

Unique identifier for the API key

teamId
string
required

ID of the team this API key belongs to

userId
string
required

ID of the user who created this API key

expiration
string
required

Expiration date and time for the API key

role
enum<string>
required

Role permissions assigned to this API key

Available options:
ADMIN,
ANALYST,
VIEWER
name
string
required

Name assigned to the API key

createdAt
string
required

Timestamp when the API key was created

lastUsed
string | null

Timestamp when the API key was last used

token
string

The generated API key token (only returned once upon creation)