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": []
}
'import requests
url = "https://app.freyavoice.ai/api/v2/api-keys"
payload = {
"name": "<string>",
"userId": "<string>",
"expiresAt": "<string>",
"permissions": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', userId: '<string>', expiresAt: '<string>', permissions: []})
};
fetch('https://app.freyavoice.ai/api/v2/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.freyavoice.ai/api/v2/api-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'userId' => '<string>',
'expiresAt' => '<string>',
'permissions' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.freyavoice.ai/api/v2/api-keys"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"userId\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"permissions\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.freyavoice.ai/api/v2/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"userId\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"permissions\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.freyavoice.ai/api/v2/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"userId\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"permissions\": []\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "<string>",
"result": {
"apiKey": {
"id": "<string>",
"key": "<string>",
"workspaceId": "<string>",
"userId": "<string>",
"name": "<string>",
"isActive": true,
"createdAt": "<string>",
"expiresAt": "<string>",
"lastUsedAt": "<string>",
"rateLimit": {
"requestsPerMinute": 123,
"requestsPerDay": 123
},
"permissions": [],
"creator": {
"id": "<string>",
"email": "jsmith@example.com",
"displayName": "<string>"
}
},
"key": "<string>"
}
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}API Keys
Create API key
Creates a new API key. The key value is only returned in this response. Every key expires: expiresAt defaults to 90 days from now and may be at most 365 days out. It cannot be changed after creation.
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": []
}
'import requests
url = "https://app.freyavoice.ai/api/v2/api-keys"
payload = {
"name": "<string>",
"userId": "<string>",
"expiresAt": "<string>",
"permissions": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', userId: '<string>', expiresAt: '<string>', permissions: []})
};
fetch('https://app.freyavoice.ai/api/v2/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.freyavoice.ai/api/v2/api-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'userId' => '<string>',
'expiresAt' => '<string>',
'permissions' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.freyavoice.ai/api/v2/api-keys"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"userId\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"permissions\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.freyavoice.ai/api/v2/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"userId\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"permissions\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.freyavoice.ai/api/v2/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"userId\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"permissions\": []\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "<string>",
"result": {
"apiKey": {
"id": "<string>",
"key": "<string>",
"workspaceId": "<string>",
"userId": "<string>",
"name": "<string>",
"isActive": true,
"createdAt": "<string>",
"expiresAt": "<string>",
"lastUsedAt": "<string>",
"rateLimit": {
"requestsPerMinute": 123,
"requestsPerDay": 123
},
"permissions": [],
"creator": {
"id": "<string>",
"email": "jsmith@example.com",
"displayName": "<string>"
}
},
"key": "<string>"
}
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Name for the API key
Minimum string length:
1User ID creating the key
Minimum string length:
1Expiration date (ISO 8601). Defaults to 90 days from now; must be in the future and at most 365 days out. Immutable once set.
Rate limit configuration
Show child attributes
Show child attributes
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:web-token, calls:chat-message, calls:cdr-read, calls:pii, calls:share, calls:register, calls:recording-upload, calls:transfer, calls:resume, calls:status-read, calls:webhook-payload, campaign:read, campaign:write, campaign:delete, campaign:execute, bes:read, bes:write, 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, suppression-list:read, suppression-list:write, suppression-list: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, agents:resolve, campaign:resolve-contact, retention:purge, simulations:verdict-callback