Skip to content
Banklink API

Report external usage

POST
/usage/report
curl --request POST \
--url https://api.banklink.co.za/v1/usage/report \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "endpoint": "/v1/accounts", "method": "GET", "response_code": 200, "invocation_type": "external", "invocation_source": "my-service" }'

Records an external API call for reporting and analytics. Intended for use by external services acting on the organisation’s behalf. This endpoint is not billed.

Media typeapplication/json
object
endpoint
required

The API endpoint that was called

string

Example

/v1/accounts
method
required

HTTP method used

string

Example

GET
response_code
required

HTTP response code returned to the caller

integer

Example

200
invocation_type

How the call was invoked (defaults to “external”)

string

Example

external
invocation_source

Identifier for the originating service or integration

string

Example

my-service

Usage recorded

Media typeapplication/json
object
data
required
object
success
required
boolean

Example

{
"data": {
"success": true
}
}

Missing required fields

Media typeapplication/json
object
error
required
object
code
required

Machine-readable error code

string
message
required

Human-readable error description

string

Example

{
"error": {
"code": "not_found",
"message": "Account not found"
}
}

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"
}
}