Get a service account token
Returns one token of a service account, without its value.
Only the organization owner can call this endpoint. Its action is service_account_tokens.read. Other users and service account tokens get 403.
GET
/
iam
/
service_accounts
/
{id}
/
tokens
/
{token_id}
Get a service account token
curl --request GET \
--url https://api.telnyx.com/v2/iam/service_accounts/{id}/tokens/{token_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.telnyx.com/v2/iam/service_accounts/{id}/tokens/{token_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.telnyx.com/v2/iam/service_accounts/{id}/tokens/{token_id}', 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.telnyx.com/v2/iam/service_accounts/{id}/tokens/{token_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.telnyx.com/v2/iam/service_accounts/{id}/tokens/{token_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.telnyx.com/v2/iam/service_accounts/{id}/tokens/{token_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telnyx.com/v2/iam/service_accounts/{id}/tokens/{token_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "SAT01A1D0299A618C233DCFFB31B8490913",
"service_account_id": "e6cd1ff6-6e3a-4ff3-88d5-2234142c1df2",
"name": "release-pipeline",
"tags": [
"ci"
],
"status": "active",
"expires_at": "2027-05-24T00:00:00.000000Z",
"last_used_at": null,
"record_type": "service_account_token",
"created_at": "2026-11-24T10:06:40.551902Z",
"updated_at": "2026-11-24T10:06:40.551902Z"
}
}Authorizations
Path Parameters
Was this page helpful?
Get a service account token
curl --request GET \
--url https://api.telnyx.com/v2/iam/service_accounts/{id}/tokens/{token_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.telnyx.com/v2/iam/service_accounts/{id}/tokens/{token_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.telnyx.com/v2/iam/service_accounts/{id}/tokens/{token_id}', 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.telnyx.com/v2/iam/service_accounts/{id}/tokens/{token_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.telnyx.com/v2/iam/service_accounts/{id}/tokens/{token_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.telnyx.com/v2/iam/service_accounts/{id}/tokens/{token_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telnyx.com/v2/iam/service_accounts/{id}/tokens/{token_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "SAT01A1D0299A618C233DCFFB31B8490913",
"service_account_id": "e6cd1ff6-6e3a-4ff3-88d5-2234142c1df2",
"name": "release-pipeline",
"tags": [
"ci"
],
"status": "active",
"expires_at": "2027-05-24T00:00:00.000000Z",
"last_used_at": null,
"record_type": "service_account_token",
"created_at": "2026-11-24T10:06:40.551902Z",
"updated_at": "2026-11-24T10:06:40.551902Z"
}
}