Skip to main content
POST
/
api-keys
Create API key
curl --request POST \
  --url https://app2.freyavoice.ai/api/v2/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "workspaceId": "<string>",
  "userId": "<string>",
  "expiresAt": "<string>",
  "rateLimit": {
    "requestsPerMinute": 123,
    "requestsPerDay": 123
  }
}
'
{
  "success": true,
  "data": {
    "message": "<string>",
    "result": {
      "apiKey": {
        "id": "<string>",
        "key": "<string>",
        "workspaceId": "<string>",
        "userId": "<string>",
        "name": "<string>",
        "isActive": true,
        "createdAt": "<string>",
        "lastUsedAt": "<string>",
        "expiresAt": "<string>",
        "rateLimit": {
          "requestsPerMinute": 123,
          "requestsPerDay": 123
        },
        "creator": {
          "id": "<string>",
          "email": "[email protected]",
          "displayName": "<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

Name for the API key

Minimum string length: 1
workspaceId
string
required

Workspace ID

Minimum string length: 1
userId
string
required

User ID creating the key

Minimum string length: 1
expiresAt
string

Expiration date (ISO format)

rateLimit
object

Rate limit configuration

Response

API key created (includes the key value)

success
enum<boolean>
required
Available options:
true,
false
data
object
required