Skip to content

Api Tokens

Introduction

The API tokens api allows you to manage access tokens for your business.

Usage

Generate

Generate a token

Parameters

Usage

const token = await Xedi.ApiTokens.generate();

Response

{
"data": {
"tokens": {
"api_token":"[example-returned-token]",
"type":"bearer"
},
"business":"6f39ddd6-cf59-11eb-acd6-0100f1a50c6e"}
}
}

Show

Show the token for the currently authed business. Note that the returned token is partially redacted. For security reasons you will only see the first (8) characters of the returned token. If you have lost your token, you must delete and re-create a new one.

Parameters

Usage

const token = await Xedi.ApiTokens.show();

Response

{
"data": {
"tokens": {
"api_token":"[example-partially-returned-token]",
"type":"bearer"
},
"business":"6f39ddd6-cf59-11eb-acd6-0100f1a50c6e"}
}
}

Delete

Delete a token by token id

Parameters

PropertyTypeRequiredExample
token_idXUID"d1dfb302-b53d-11ea-95d2-0100f1a50c6e"

Usage

const token = await Xedi.ApiTokens.delete("d1dfb302-b53d-11ea-95d2-0100f1a50c6e");

Response

{}