API 키 발급
하위 조직의 API 키를 발급합니다. 하위 조직의 키로 본인 조직에 키를 발급하고, 상위 조직의 키로 직속 하위 조직에 키를 발급할 수 있습니다. 상위 조직의 키로 자기 조직의 키를 관리할 수 없으며 403을 반환합니다. 평문 api_key는 이 응답에서 한 번만 반환하며 다시 조회할 수 없습니다. 즉시 안전한 곳에 저장하세요. key_name은 필수입니다. 키를 폐기할 때는 key_name과 secret_key_suffix 쌍으로 식별하며 내부 키 ID는 노출하지 않습니다. 하위 조직당 API 키는 최대 20개까지 발급할 수 있습니다.
curl --request POST \
--url https://client-api.tryvox.co/v3/organizations/{organization_id}/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key_name": "<string>"
}
'import requests
url = "https://client-api.tryvox.co/v3/organizations/{organization_id}/api-keys"
payload = { "key_name": "<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({key_name: '<string>'})
};
fetch('https://client-api.tryvox.co/v3/organizations/{organization_id}/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://client-api.tryvox.co/v3/organizations/{organization_id}/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([
'key_name' => '<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://client-api.tryvox.co/v3/organizations/{organization_id}/api-keys"
payload := strings.NewReader("{\n \"key_name\": \"<string>\"\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://client-api.tryvox.co/v3/organizations/{organization_id}/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://client-api.tryvox.co/v3/organizations/{organization_id}/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 \"key_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"secret_key_suffix": "<string>",
"created_at": 123,
"api_key": "<string>",
"key_name": "<string>",
"last_used_at": 123
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed.",
"details": {
"field": "name",
"reason": "must not be blank"
}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication is required.",
"details": {}
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied.",
"details": {}
}
}{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Resource not found.",
"details": {
"resource": "agent"
}
}
}{
"error": {
"code": "CONFLICT",
"message": "The requested operation conflicts with current state.",
"details": {
"current_status": "draft"
}
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests.",
"details": {
"limit": 5,
"window_seconds": 1
}
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error.",
"details": {}
}
}{
"error": {
"code": "SERVICE_UNAVAILABLE",
"message": "Service temporarily unavailable.",
"details": {}
}
}Authorizations
조직 API 키를 Authorization: Bearer <token> 형식으로 보냅니다.
Path Parameters
API 키를 발급할 조직 ID입니다. 본인 조직 또는 직속 하위 조직을 지정합니다.
Body
API 키 발급 옵션입니다. key_name은 필수입니다.
하위 조직 API 키 발급 요청입니다. key_name은 필수입니다. 내부 키 ID를 응답에 노출하지 않으므로 폐기할 키는 key_name과 secret_key_suffix 쌍으로 식별합니다.
키를 식별할 이름입니다. 앞뒤 공백은 제거합니다. 공백만 입력하면 400을 반환합니다. secret_key_suffix와 함께 폐기할 키를 식별하므로 필수입니다.
1 - 255Response
성공 응답
API 키 발급 응답입니다. 평문 키는 이 응답에서 한 번만 제공하며 다시 조회할 수 없습니다.
평문 키의 끝 4자리입니다. key_name과 함께 폐기할 키를 식별합니다.
리소스 생성 시각입니다. unix milliseconds 형식입니다.
평문 API 키입니다. 다시 조회할 수 없으므로 즉시 안전한 곳에 저장하세요.
secret_key_suffix와 함께 폐기할 키를 식별하는 이름입니다.
이 키로 마지막으로 인증에 성공한 시각입니다. unix milliseconds 형식입니다. 한 번도 사용하지 않았다면 null입니다. 비동기로 기록하므로 최대 1분가량 지연될 수 있습니다.
Was this page helpful?
curl --request POST \
--url https://client-api.tryvox.co/v3/organizations/{organization_id}/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key_name": "<string>"
}
'import requests
url = "https://client-api.tryvox.co/v3/organizations/{organization_id}/api-keys"
payload = { "key_name": "<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({key_name: '<string>'})
};
fetch('https://client-api.tryvox.co/v3/organizations/{organization_id}/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://client-api.tryvox.co/v3/organizations/{organization_id}/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([
'key_name' => '<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://client-api.tryvox.co/v3/organizations/{organization_id}/api-keys"
payload := strings.NewReader("{\n \"key_name\": \"<string>\"\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://client-api.tryvox.co/v3/organizations/{organization_id}/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://client-api.tryvox.co/v3/organizations/{organization_id}/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 \"key_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"secret_key_suffix": "<string>",
"created_at": 123,
"api_key": "<string>",
"key_name": "<string>",
"last_used_at": 123
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Request validation failed.",
"details": {
"field": "name",
"reason": "must not be blank"
}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication is required.",
"details": {}
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Permission denied.",
"details": {}
}
}{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Resource not found.",
"details": {
"resource": "agent"
}
}
}{
"error": {
"code": "CONFLICT",
"message": "The requested operation conflicts with current state.",
"details": {
"current_status": "draft"
}
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests.",
"details": {
"limit": 5,
"window_seconds": 1
}
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error.",
"details": {}
}
}{
"error": {
"code": "SERVICE_UNAVAILABLE",
"message": "Service temporarily unavailable.",
"details": {}
}
}