Create an Admin API key with a subset of your permissions (`value` is returned once)
curl --request POST \
--url https://api.antarah.dev/v1/organization/admin_api_keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"permissions": [],
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.antarah.dev/v1/organization/admin_api_keys"
payload = {
"name": "<string>",
"permissions": [],
"expires_at": "2023-11-07T05:31:56Z"
}
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>', permissions: [], expires_at: '2023-11-07T05:31:56Z'})
};
fetch('https://api.antarah.dev/v1/organization/admin_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.antarah.dev/v1/organization/admin_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>',
'permissions' => [
],
'expires_at' => '2023-11-07T05:31:56Z'
]),
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.antarah.dev/v1/organization/admin_api_keys"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"permissions\": [],\n \"expires_at\": \"2023-11-07T05:31:56Z\"\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.antarah.dev/v1/organization/admin_api_keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"permissions\": [],\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.antarah.dev/v1/organization/admin_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 \"permissions\": [],\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "key_0193a6c2e7b47c3d9f1e2a4b5c6d7e8f",
"object": "organization.admin_api_key",
"name": "<string>",
"redacted_value": "ak_admin_…x9Qe",
"owner": {
"type": "organization",
"id": "org_0193a6c2e7b47c3d9f1e2a4b5c6d7e8f"
},
"status": "active",
"permissions": [
"organization:read"
],
"created_at": 1793750400,
"last_used_at": 1793750400,
"expires_at": 1793750400,
"value": "ak_admin_Jd3…x9Qe"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "<string>",
"request_id": "<string>",
"param": "<string>",
"errors": [
{
"pointer": "<string>",
"detail": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "<string>",
"request_id": "<string>",
"param": "<string>",
"errors": [
{
"pointer": "<string>",
"detail": "<string>"
}
]
}Create an Admin API key
POST
/
v1
/
organization
/
admin_api_keys
Create an Admin API key with a subset of your permissions (`value` is returned once)
curl --request POST \
--url https://api.antarah.dev/v1/organization/admin_api_keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"permissions": [],
"expires_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.antarah.dev/v1/organization/admin_api_keys"
payload = {
"name": "<string>",
"permissions": [],
"expires_at": "2023-11-07T05:31:56Z"
}
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>', permissions: [], expires_at: '2023-11-07T05:31:56Z'})
};
fetch('https://api.antarah.dev/v1/organization/admin_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.antarah.dev/v1/organization/admin_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>',
'permissions' => [
],
'expires_at' => '2023-11-07T05:31:56Z'
]),
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.antarah.dev/v1/organization/admin_api_keys"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"permissions\": [],\n \"expires_at\": \"2023-11-07T05:31:56Z\"\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.antarah.dev/v1/organization/admin_api_keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"permissions\": [],\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.antarah.dev/v1/organization/admin_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 \"permissions\": [],\n \"expires_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "key_0193a6c2e7b47c3d9f1e2a4b5c6d7e8f",
"object": "organization.admin_api_key",
"name": "<string>",
"redacted_value": "ak_admin_…x9Qe",
"owner": {
"type": "organization",
"id": "org_0193a6c2e7b47c3d9f1e2a4b5c6d7e8f"
},
"status": "active",
"permissions": [
"organization:read"
],
"created_at": 1793750400,
"last_used_at": 1793750400,
"expires_at": 1793750400,
"value": "ak_admin_Jd3…x9Qe"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "<string>",
"request_id": "<string>",
"param": "<string>",
"errors": [
{
"pointer": "<string>",
"detail": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "<string>",
"request_id": "<string>",
"param": "<string>",
"errors": [
{
"pointer": "<string>",
"detail": "<string>"
}
]
}Authorizations
adminKeysession
ak_admin_… Admin API key
Body
application/json
1–120 Unicode code points, trimmed
Maximum string length:
120A subset of the caller's own permissions (02 §6)
Required array length:
1 - 20 elementsAvailable options:
organization:read, projects:read, projects:create, project_api_keys:read, project_api_keys:create, project_api_keys:revoke, admin_api_keys:read, admin_api_keys:create, admin_api_keys:revoke, billing:read, spend_limits:read, spend_limits:write, policies:read, policies:write RFC 3339, in the future. Omit for a key that never expires
Response
Created
Pattern:
^key_[0-9a-f]{32}$Example:
"key_0193a6c2e7b47c3d9f1e2a4b5c6d7e8f"
Available options:
organization.admin_api_key Prefix + … + last 4
Example:
"ak_admin_…x9Qe"
Show child attributes
Show child attributes
Available options:
active, revoked, expired, suspended Available options:
organization:read, projects:read, projects:create, project_api_keys:read, project_api_keys:create, project_api_keys:revoke, admin_api_keys:read, admin_api_keys:create, admin_api_keys:revoke, billing:read, spend_limits:read, spend_limits:write, policies:read, policies:write Unix seconds
Example:
1793750400
Unix seconds
Example:
1793750400
Unix seconds
Example:
1793750400
ak_admin_ + 43 base64url chars. Returned only by create
Example:
"ak_admin_Jd3…x9Qe"
