Skip to main content
POST
/
api-keys
Create API key
curl --request POST \
  --url https://app.freyavoice.ai/api/v2/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "userId": "<string>",
  "expiresAt": "<string>",
  "permissions": []
}
'
{
  "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
        },
        "permissions": [],
        "creator": {
          "id": "<string>",
          "email": "jsmith@example.com",
          "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
userId
string
required

User ID creating the key

Minimum string length: 1
expiresAt
string

Expiration date (ISO format)

rateLimit
object

Rate limit configuration

permissions
enum<string>[]

Frozen subset of the creator's permissions. Defaults to the creator's full set when omitted.

Available options:
agents:read,
agents:write,
agents:delete,
agents:sync,
agents:test,
workflows:read,
workflows:write,
workflows:delete,
workflows:sync,
workflows:test,
calls:read,
calls:write,
calls:delete,
calls:import,
calls:export,
calls:recording-download,
calls:metrics-read,
calls:logs-read,
calls:web-token,
calls:chat-message,
calls:cdr-read,
campaign:read,
campaign:write,
campaign:delete,
campaign:execute,
feedbacks:read,
feedbacks:write,
feedbacks:delete,
feedbacks:comment,
feedbacks:assign,
feedbacks:config,
reviews:read,
reviews:write,
reviews:delete,
reviews:assign,
insights:read,
insights:write,
insights:delete,
insights:assign,
assertions:read,
assertions:write,
assertions:delete,
assertions:assign,
personas:read,
personas:write,
personas:delete,
simulations:read,
simulations:write,
simulations:delete,
simulations:execute,
solutions:read,
solutions:write,
solutions:delete,
solutions:generate,
solutions:accept,
kb:read,
kb:write,
kb:delete,
kb:upload,
kb:sync,
kb:articles-write,
phone-numbers:read,
phone-numbers:write,
phone-numbers:delete,
phone-numbers:import,
phone-aliases:read,
phone-aliases:write,
phone-aliases:delete,
integrations:read,
integrations:write,
integrations:delete,
integrations:webhook,
analytics:read,
analytics:widgets-write,
analytics:widgets-delete,
api-keys:read,
api-keys:write,
api-keys:delete,
api-keys:manage-others,
members:read,
members:invite,
members:remove,
members:role-change,
members:mfa-reset,
roles:read,
roles:write,
roles:delete,
billing:read,
billing:manage,
workspace:read,
workspace:settings-write,
workspace:delete,
workspace:logs-read,
versions:read,
versions:publish,
models:read,
inbound:write,
chat:read,
custom:abbreviations-read,
custom:abbreviations-write,
speech-filter:preview

Response

API key created (includes the key value)

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