Skip to main content
GET
/
service_accounts
/
{clientId}
/
api_keys
List service account API keys
curl --request GET \
  --url https://api.blaxel.ai/v0/service_accounts/{clientId}/api_keys \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.blaxel.ai/v0/service_accounts/{clientId}/api_keys"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.blaxel.ai/v0/service_accounts/{clientId}/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.blaxel.ai/v0/service_accounts/{clientId}/api_keys",
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.blaxel.ai/v0/service_accounts/{clientId}/api_keys"

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.blaxel.ai/v0/service_accounts/{clientId}/api_keys")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.blaxel.ai/v0/service_accounts/{clientId}/api_keys")

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
[
  {
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "createdBy": "<string>",
    "updatedBy": "<string>",
    "apiKey": "<string>",
    "expires_in": "30d",
    "id": "ak_abc123def456",
    "name": "CI/CD Pipeline Key",
    "sub": "<string>",
    "sub_type": "user"
  }
]

Authorizations

Authorization
string
header
required

OAuth2 authentication with JWT tokens

Path Parameters

clientId
string
required

Service account client ID

Response

200 - application/json

successful operation

createdAt
string
read-only

The date and time when the resource was created

updatedAt
string
read-only

The date and time when the resource was updated

createdBy
string
read-only

The user or service account who created the resource

updatedBy
string
read-only

The user or service account who updated the resource

apiKey
string
read-only

Api key

expires_in
string

Duration until expiration. Supports formats like '30d' (30 days), '24h' (24 hours), '1w' (1 week). If not set, the API key never expires.

Example:

"30d"

id
string
read-only

Api key id, to retrieve it from the API

Example:

"ak_abc123def456"

name
string

Name for the API key

Example:

"CI/CD Pipeline Key"

sub
string
read-only

User subject identifier

sub_type
string

Subject type (user or service_account)

Example:

"user"

Last modified on July 1, 2026