Skip to main content
POST
https://api.tensormesh.ai
/
v1
/
users
/
api-keys
Create User API Key
curl --request POST \
  --url https://api.tensormesh.ai/v1/users/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "userId": "<string>",
  "name": "<string>",
  "scopes": [
    "<string>"
  ],
  "expiresAt": "2023-11-07T05:31:56Z"
}
'
{
  "apiKey": {
    "id": "<string>",
    "name": "<string>",
    "scopes": [
      "<string>"
    ],
    "createdAt": "2023-11-07T05:31:56Z",
    "expiresAt": "2023-11-07T05:31:56Z",
    "deletedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication using an access token. Format: Bearer <access_token>

Body

application/json

CreateUserApiKeyRequest is the request to create a user API key.

userId
string

The user ID that owns this key.

name
string

Optional key name.

scopes
string[]

Optional scopes.

expiresAt
string<date-time>

Optional expiration.

Response

A successful response.

CreateUserApiKeyResponse is the response after creating an API key.

apiKey
object

ApiKey represents an API key object owned by a user.