Org API Tokens
Mansar uses API Tokens to authenticate incoming requests. You can create API Tokens through Mansar's Dashboard, or programmatically through an API call.
Create Org API Token
Creates an Org API token.
Verb
POST
Url
https://api.s.usemansar.xyz/users/:userId/api-tokens
Data Type
apiToken
Timeout (Seconds)
5
Attributes
description
string
A description of the Org API token.
scope
string
list of Scopes separated by spaces.
expiration
RFC3339 Date string
Expiration date of the Org API token.
sourceIp
string
Optional. A comma separated list of IP addresses that are allowed to use the Org API token (no spaces allowed).
resources
Array of RestrictedResource
Optional. Restrict token to one or more specific resources. To one or many cards and/or to one or many accounts (cards under it, payments, transactions).
curl -X POST 'https://api.s.usemansar.xyz/users/2/api-tokens'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "apiToken",
"attributes": {
"description": "Production token",
"scope": "customers applications",
"expiration": "2024-02-01T13:47:17.000Z"
}
}
}'Response
Response is a JSON:API document.
201 Created
data
APIToken
A The newly created resource.
Example Response:
List
List Org API Token resources.
Verb
GET
Url
https://api.s.usemansar.xyz/users/:userId/api-tokens
Timeout (Seconds)
5
Response
Response is a JSON:API document.
200 OK
data
Array of APIToken
Array of org api token resources.
Example Response:
Revoke
Revoke an Org API Token.
Verb
DELETE
Url
https://api.s.usemansar.xyz/users/:userId/api-tokens/:tokenId
Timeout (Seconds)
5
Response
Response is a JSON:API document.
200 OK
data
APIToken
The requested resource after the operation was completed.
Last updated