Retrieves the current account for the token accessing the API
client.account.retrieve(RequestOptionsoptions?): Account { info, metadata, spec }
GET/v1/account
Retrieves the current account for the token accessing the API. Useful to check if the credentials are valid.
Retrieves the current account for the token accessing the API
import Cadenya from '@cadenya/cadenya';
const client = new Cadenya({
apiKey: process.env['CADENYA_API_KEY'], // This is the default and can be omitted
});
const account = await client.account.retrieve();
console.log(account.info);{
"info": {
"webhookEventsHmacSecret": "webhookEventsHmacSecret"
},
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"billingEmail": "billingEmail",
"description": "description",
"domain": "domain",
"workspaces": [
{
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"description": "description"
}
}
]
}
}Returns Examples
{
"info": {
"webhookEventsHmacSecret": "webhookEventsHmacSecret"
},
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"billingEmail": "billingEmail",
"description": "description",
"domain": "domain",
"workspaces": [
{
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"description": "description"
}
}
]
}
}