Create a new API key
curl --request POST \
--url https://api.g-tateth.com/api/tenant/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Production API Key",
"permissions": [
"read:conversations",
"write:customers"
],
"environment": "production",
"expiresAt": "2023-11-07T05:31:56Z",
"rotationPolicy": {
"enabled": true,
"intervalDays": 123,
"notifyDaysBefore": 123
},
"rateLimit": {
"requests": 123
},
"ipWhitelist": [
"<string>"
]
}
'import requests
url = "https://api.g-tateth.com/api/tenant/api-keys"
payload = {
"name": "Production API Key",
"permissions": ["read:conversations", "write:customers"],
"environment": "production",
"expiresAt": "2023-11-07T05:31:56Z",
"rotationPolicy": {
"enabled": True,
"intervalDays": 123,
"notifyDaysBefore": 123
},
"rateLimit": { "requests": 123 },
"ipWhitelist": ["<string>"]
}
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: 'Production API Key',
permissions: ['read:conversations', 'write:customers'],
environment: 'production',
expiresAt: '2023-11-07T05:31:56Z',
rotationPolicy: {enabled: true, intervalDays: 123, notifyDaysBefore: 123},
rateLimit: {requests: 123},
ipWhitelist: ['<string>']
})
};
fetch('https://api.g-tateth.com/api/tenant/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://api.g-tateth.com/api/tenant/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' => 'Production API Key',
'permissions' => [
'read:conversations',
'write:customers'
],
'environment' => 'production',
'expiresAt' => '2023-11-07T05:31:56Z',
'rotationPolicy' => [
'enabled' => true,
'intervalDays' => 123,
'notifyDaysBefore' => 123
],
'rateLimit' => [
'requests' => 123
],
'ipWhitelist' => [
'<string>'
]
]),
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://api.g-tateth.com/api/tenant/api-keys"
payload := strings.NewReader("{\n \"name\": \"Production API Key\",\n \"permissions\": [\n \"read:conversations\",\n \"write:customers\"\n ],\n \"environment\": \"production\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"rotationPolicy\": {\n \"enabled\": true,\n \"intervalDays\": 123,\n \"notifyDaysBefore\": 123\n },\n \"rateLimit\": {\n \"requests\": 123\n },\n \"ipWhitelist\": [\n \"<string>\"\n ]\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://api.g-tateth.com/api/tenant/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production API Key\",\n \"permissions\": [\n \"read:conversations\",\n \"write:customers\"\n ],\n \"environment\": \"production\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"rotationPolicy\": {\n \"enabled\": true,\n \"intervalDays\": 123,\n \"notifyDaysBefore\": 123\n },\n \"rateLimit\": {\n \"requests\": 123\n },\n \"ipWhitelist\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.g-tateth.com/api/tenant/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\": \"Production API Key\",\n \"permissions\": [\n \"read:conversations\",\n \"write:customers\"\n ],\n \"environment\": \"production\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"rotationPolicy\": {\n \"enabled\": true,\n \"intervalDays\": 123,\n \"notifyDaysBefore\": 123\n },\n \"rateLimit\": {\n \"requests\": 123\n },\n \"ipWhitelist\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"key": "<string>",
"keyPrefix": "<string>"
}
}API Keys
Create a new API key
POST
/
api
/
tenant
/
api-keys
Create a new API key
curl --request POST \
--url https://api.g-tateth.com/api/tenant/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Production API Key",
"permissions": [
"read:conversations",
"write:customers"
],
"environment": "production",
"expiresAt": "2023-11-07T05:31:56Z",
"rotationPolicy": {
"enabled": true,
"intervalDays": 123,
"notifyDaysBefore": 123
},
"rateLimit": {
"requests": 123
},
"ipWhitelist": [
"<string>"
]
}
'import requests
url = "https://api.g-tateth.com/api/tenant/api-keys"
payload = {
"name": "Production API Key",
"permissions": ["read:conversations", "write:customers"],
"environment": "production",
"expiresAt": "2023-11-07T05:31:56Z",
"rotationPolicy": {
"enabled": True,
"intervalDays": 123,
"notifyDaysBefore": 123
},
"rateLimit": { "requests": 123 },
"ipWhitelist": ["<string>"]
}
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: 'Production API Key',
permissions: ['read:conversations', 'write:customers'],
environment: 'production',
expiresAt: '2023-11-07T05:31:56Z',
rotationPolicy: {enabled: true, intervalDays: 123, notifyDaysBefore: 123},
rateLimit: {requests: 123},
ipWhitelist: ['<string>']
})
};
fetch('https://api.g-tateth.com/api/tenant/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://api.g-tateth.com/api/tenant/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' => 'Production API Key',
'permissions' => [
'read:conversations',
'write:customers'
],
'environment' => 'production',
'expiresAt' => '2023-11-07T05:31:56Z',
'rotationPolicy' => [
'enabled' => true,
'intervalDays' => 123,
'notifyDaysBefore' => 123
],
'rateLimit' => [
'requests' => 123
],
'ipWhitelist' => [
'<string>'
]
]),
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://api.g-tateth.com/api/tenant/api-keys"
payload := strings.NewReader("{\n \"name\": \"Production API Key\",\n \"permissions\": [\n \"read:conversations\",\n \"write:customers\"\n ],\n \"environment\": \"production\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"rotationPolicy\": {\n \"enabled\": true,\n \"intervalDays\": 123,\n \"notifyDaysBefore\": 123\n },\n \"rateLimit\": {\n \"requests\": 123\n },\n \"ipWhitelist\": [\n \"<string>\"\n ]\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://api.g-tateth.com/api/tenant/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production API Key\",\n \"permissions\": [\n \"read:conversations\",\n \"write:customers\"\n ],\n \"environment\": \"production\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"rotationPolicy\": {\n \"enabled\": true,\n \"intervalDays\": 123,\n \"notifyDaysBefore\": 123\n },\n \"rateLimit\": {\n \"requests\": 123\n },\n \"ipWhitelist\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.g-tateth.com/api/tenant/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\": \"Production API Key\",\n \"permissions\": [\n \"read:conversations\",\n \"write:customers\"\n ],\n \"environment\": \"production\",\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"rotationPolicy\": {\n \"enabled\": true,\n \"intervalDays\": 123,\n \"notifyDaysBefore\": 123\n },\n \"rateLimit\": {\n \"requests\": 123\n },\n \"ipWhitelist\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"key": "<string>",
"keyPrefix": "<string>"
}
}Authorizations
JWT session token authentication. Use for user-context requests. The token is returned by the login endpoint and expires after 15 minutes.
Body
application/json
Required string length:
1 - 100Example:
"Production API Key"
Example:
["read:conversations", "write:customers"]
Available options:
production, staging Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I