Skip to main content
GET
/
auth
/
token
Obtain Bearer Token
curl --request GET \
  --url https://api.central.consent/v1/auth/token \
  --header 'Authorization: Basic <encoded-value>'
import requests

url = "https://api.central.consent/v1/auth/token"

headers = {"Authorization": "Basic <encoded-value>"}

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

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};

fetch('https://api.central.consent/v1/auth/token', 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.central.consent/v1/auth/token",
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: Basic <encoded-value>"
],
]);

$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.central.consent/v1/auth/token"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Basic <encoded-value>")

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.central.consent/v1/auth/token")
.header("Authorization", "Basic <encoded-value>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.central.consent/v1/auth/token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'

response = http.request(request)
puts response.read_body
{
  "bearer-token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expires": 7200
}
{
"response": {
"resource": "/v1/access-records/ak_691df0c788ca043403b7fa90",
"timestamp": "2026-03-11T12:00:00Z",
"transaction-id": "tid_691df0c788ca043403b7fa90"
},
"errors": [
{
"error-code": "VAL001",
"message": "Field 'mpxn' does not match the required pattern."
}
]
}
{
"response": {
"resource": "/v1/access-records/ak_691df0c788ca043403b7fa90",
"timestamp": "2026-03-11T12:00:00Z",
"transaction-id": "tid_691df0c788ca043403b7fa90"
},
"errors": [
{
"error-code": "VAL001",
"message": "Field 'mpxn' does not match the required pattern."
}
]
}

Authorizations

Authorization
string
header
required

Base64-encode account_id:secret_key. Used only on GET /auth/token.

Response

Token issued successfully.

bearer-token
string
required
Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

expires
integer
required

Token lifetime in seconds from issue.

Example:

7200

Last modified on March 25, 2026