Retrieves the current account for the token accessing the API
account.retrieve() -> AccountAPI { 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
require "cadenya"
cadenya = Cadenya::Client.new(api_key: "My API Key")
account = cadenya.account.retrieve
puts(account){
"info": {
"globalApiKey": {
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"token": "token",
"description": "description",
"permissions": [
"string"
],
"system": true
},
"info": {
"createdBy": {
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"type": "PROFILE_TYPE_UNSPECIFIED",
"email": "email",
"name": "name"
}
},
"workspacesPreview": [
{
"id": "id",
"name": "name"
}
],
"workspacesTotal": 0
}
},
"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"
},
"status": "STATUS_ENABLED"
}
]
}
}Returns Examples
{
"info": {
"globalApiKey": {
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"token": "token",
"description": "description",
"permissions": [
"string"
],
"system": true
},
"info": {
"createdBy": {
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"type": "PROFILE_TYPE_UNSPECIFIED",
"email": "email",
"name": "name"
}
},
"workspacesPreview": [
{
"id": "id",
"name": "name"
}
],
"workspacesTotal": 0
}
},
"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"
},
"status": "STATUS_ENABLED"
}
]
}
}