POST
/
api
/
v1
/
api-key
curl --request POST \
  --url https://prod.oneloop.ai/api/v1/api-key \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "workspaceId": "<string>",
  "prefix": "<string>",
  "expiresAt": 1,
  "scopes": [
    {
      "representation": "<string>",
      "create": true,
      "read": true,
      "update": true,
      "del": true
    }
  ],
  "enabled": true,
  "customerId": "<string>",
  "externalMeterId": "<string>",
  "metadata": {}
}'
{
  "apiKey": {
    "id": "<string>",
    "name": "<string>",
    "maskedKey": "<string>",
    "prefix": "<string>",
    "expiresAt": 1,
    "scopes": [
      {
        "id": "<string>",
        "representation": "<string>",
        "create": true,
        "read": true,
        "update": true,
        "del": true
      }
    ],
    "enabled": true,
    "customerId": "<string>",
    "deleted": true,
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "lastUsedAt": "<string>",
    "billingId": "<string>",
    "key": "<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
workspaceId
string
required
scopes
object[]
required
enabled
boolean
required
customerId
string
required
prefix
string
expiresAt
integer
Required range: x > 0
externalMeterId
string
metadata
object

Response

200
application/json
The created key
apiKey
object
required