import requests
url = "http://localhost:3000/v1/api_key/"
payload = {
"name": "<string>",
"restricted": True,
"expiry_date": "2023-11-07T05:31:56Z",
"permissions": ["companies.delete"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_date": "2023-11-07T05:31:56Z",
"last_four_digits": "<string>",
"creator_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restricted": true,
"permissions": [
"companies.delete"
],
"value": "<string>"
}Create a new API key.
import requests
url = "http://localhost:3000/v1/api_key/"
payload = {
"name": "<string>",
"restricted": True,
"expiry_date": "2023-11-07T05:31:56Z",
"permissions": ["companies.delete"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_date": "2023-11-07T05:31:56Z",
"last_four_digits": "<string>",
"creator_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restricted": true,
"permissions": [
"companies.delete"
],
"value": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The name of the API key
Whether the API key is restricted to a set of specific permissions
The date and time when the API key will expire. If not provided, the API key will not expire.
A list of permissions associated with the API key. Do not include this field if the key is unrestricted.
App permissions.
companies.delete, companies.update, calls.create, calls.delete, calls.update, calls.view, messages.view, agents.view, agents.create, agents.update, agents.delete, phones.view, phones.purchase, phones.delete, phones.update, tools.view, tools.create, tools.delete, tools.update, contacts.view, contacts.delete, conversational_paths.view, conversational_paths.create, conversational_paths.delete, conversational_paths.update, knowledge_bases.view, knowledge_bases.create, knowledge_bases.delete, knowledge_bases.update, webhooks.view, webhooks.create, webhooks.delete, webhooks.update, members.view, members.create, members.delete, members.update, billing.view, billing.update, api_keys.view, api_keys.create, api_keys.delete, api_keys.update, voices.view, transcriptions.view, recordings.view, stats.view, notifications.view, notifications.update, integrations.view, integrations.create, integrations.update, integrations.delete Successful Response
The unique identifier for the API key
The name of the API key
The date and time when the API key was created
The last four digits of the API key
The ID of the user who created the API key
Whether the API key is restricted to a set of specific permissions
The permissions associated with the API key
App permissions.
companies.delete, companies.update, calls.create, calls.delete, calls.update, calls.view, messages.view, agents.view, agents.create, agents.update, agents.delete, phones.view, phones.purchase, phones.delete, phones.update, tools.view, tools.create, tools.delete, tools.update, contacts.view, contacts.delete, conversational_paths.view, conversational_paths.create, conversational_paths.delete, conversational_paths.update, knowledge_bases.view, knowledge_bases.create, knowledge_bases.delete, knowledge_bases.update, webhooks.view, webhooks.create, webhooks.delete, webhooks.update, members.view, members.create, members.delete, members.update, billing.view, billing.update, api_keys.view, api_keys.create, api_keys.delete, api_keys.update, voices.view, transcriptions.view, recordings.view, stats.view, notifications.view, notifications.update, integrations.view, integrations.create, integrations.update, integrations.delete The value of the API key. This will only be returned at the time of creation. Note that this field is not present in the response for other operations.