Get Token
Exchanges a credential pair (client_id + client_secret) for a signed JWT. The client_id is a credential_id obtained from /internal/credentials/create. Optional expires_in controls the JWT lifetime in seconds (default: 86400 = 24 hours).
POST
/
auth
/
get_token
Get Token
curl --request POST \
--url https://api.svantic.com/auth/get_token \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "string",
"client_secret": "string",
"agent_type": "credential",
"expires_in": 0
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: 'string',
client_secret: 'string',
agent_type: 'credential',
expires_in: 0
})
};
fetch('https://api.svantic.com/auth/get_token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.svantic.com/auth/get_token"
payload = {
"client_id": "string",
"client_secret": "string",
"agent_type": "credential",
"expires_in": 0
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.svantic.com/auth/get_token"
payload := strings.NewReader("{\n \"client_id\": \"string\",\n \"client_secret\": \"string\",\n \"agent_type\": \"credential\",\n \"expires_in\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJjcmVkX2V4YW1wbGUiLCJ0ZW5hbnRfaWQiOiJ0ZW5fMDEifQ.signature"
}{
"error": "Invalid request body",
"code": "BAD_REQUEST"
}{
"error": "Invalid or expired token",
"code": "unauthorized"
}{
"error": "JWT does not include the required scope for this operation",
"code": "forbidden"
}{
"error": "Not found",
"code": "NOT_FOUND",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Request timeout",
"code": "REQUEST_TIMEOUT"
}{
"error": "Internal server error",
"code": "INTERNAL_ERROR",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Bad gateway",
"code": "BAD_GATEWAY"
}{
"error": "Service temporarily unavailable",
"code": "SERVICE_UNAVAILABLE"
}Body
application/json
Credential ID obtained from /internal/credentials/create.
Client secret paired with the credential.
Logical agent type encoded into the JWT claims. Defaults to "credential" when omitted.
Optional JWT lifetime in seconds (default 86400 = 24 hours).
Response
Token issued.
Signed JWT. Decode the payload to inspect claims: tenant_id, agent_type, scopes (array of "read" | "admin" | "full"), sub, iat, exp, and credential_id identifying the credential used.
⌘I
Get Token
curl --request POST \
--url https://api.svantic.com/auth/get_token \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "string",
"client_secret": "string",
"agent_type": "credential",
"expires_in": 0
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: 'string',
client_secret: 'string',
agent_type: 'credential',
expires_in: 0
})
};
fetch('https://api.svantic.com/auth/get_token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.svantic.com/auth/get_token"
payload = {
"client_id": "string",
"client_secret": "string",
"agent_type": "credential",
"expires_in": 0
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.svantic.com/auth/get_token"
payload := strings.NewReader("{\n \"client_id\": \"string\",\n \"client_secret\": \"string\",\n \"agent_type\": \"credential\",\n \"expires_in\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJjcmVkX2V4YW1wbGUiLCJ0ZW5hbnRfaWQiOiJ0ZW5fMDEifQ.signature"
}{
"error": "Invalid request body",
"code": "BAD_REQUEST"
}{
"error": "Invalid or expired token",
"code": "unauthorized"
}{
"error": "JWT does not include the required scope for this operation",
"code": "forbidden"
}{
"error": "Not found",
"code": "NOT_FOUND",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Request timeout",
"code": "REQUEST_TIMEOUT"
}{
"error": "Internal server error",
"code": "INTERNAL_ERROR",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Bad gateway",
"code": "BAD_GATEWAY"
}{
"error": "Service temporarily unavailable",
"code": "SERVICE_UNAVAILABLE"
}