List tokens for OAuth application
curl --request GET \
--url https://api.example.com/oauth/apps/{clientId}/tokens \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/oauth/apps/{clientId}/tokens"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/oauth/apps/{clientId}/tokens', 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.example.com/oauth/apps/{clientId}/tokens",
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.example.com/oauth/apps/{clientId}/tokens"
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.example.com/oauth/apps/{clientId}/tokens")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/oauth/apps/{clientId}/tokens")
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_bodyOAuth
List OAuth Tokens
⚠️ SECURITY: Lists all active tokens for an OAuth application. Only OWNERS and ADMINS can view tokens. Useful for auditing and token management.
GET
/
oauth
/
apps
/
{clientId}
/
tokens
List tokens for OAuth application
curl --request GET \
--url https://api.example.com/oauth/apps/{clientId}/tokens \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/oauth/apps/{clientId}/tokens"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/oauth/apps/{clientId}/tokens', 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.example.com/oauth/apps/{clientId}/tokens",
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.example.com/oauth/apps/{clientId}/tokens"
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.example.com/oauth/apps/{clientId}/tokens")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/oauth/apps/{clientId}/tokens")
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_bodyLists all active tokens for an OAuth application. Only OWNERS and ADMINS can view tokens.
Permissions
Only OWNERS and ADMINS can list tokens for OAuth applications.Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
clientId | string | Yes | OAuth application client ID |
Example Request
curl -X GET https://api.timbrix.mx/oauth/apps/app_1234567890abcdef/tokens \
-H "Authorization: Bearer <token>"
import { Timbrix } from "@timbrix/sdk"
const client = new Timbrix({ bearerToken: "<token>" })
const tokens = await client.oauth.listTokens("app_1234567890abcdef")
console.log(tokens)
Example Response
[
{
"id": "token_1234567890abcdef",
"userId": "550e8400-e29b-41d4-a716-446655440000",
"scopes": ["read:user", "read:organization"],
"expiresAt": "2025-01-27T10:00:00Z",
"createdAt": "2025-01-26T10:00:00Z",
"lastUsedAt": "2025-01-26T15:30:00Z"
}
]
Use Cases
- Audit active tokens for security
- Monitor token usage
- Identify unused tokens for cleanup
- Track token expiration dates