Validate API key
GET
/auth/validate
const url = 'https://api.banklink.co.za/v1/auth/validate';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.banklink.co.za/v1/auth/validate \ --header 'Authorization: Bearer <token>'Returns information about the authenticated API key. Does not bill a credit.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”API key details
Media typeapplication/json
object
data
required
object
valid
required
Always true for an authenticated request
boolean
key_id
required
Internal ID of the API key
string format: uuid
org_id
required
ID of the organisation the key belongs to
string format: uuid
name
required
Display name given to the API key
string
scopes
required
Permission scopes granted to this key
Array<string>
Example
{ "data": { "valid": true, "key_id": "d290f1ee-6c54-4b01-90e6-d701748f0851", "org_id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "name": "Production key", "scopes": [ "read", "write" ] }}Missing or invalid API key
Media typeapplication/json
object
error
required
object
code
required
Machine-readable error code
string
message
required
Human-readable error description
string
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key" }}