Retrieves the current account for the token accessing the API
client.Account.Get(ctx) (*Account, error)
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
package main
import (
"context"
"fmt"
"github.com/cadenya/cadenya-go"
"github.com/cadenya/cadenya-go/option"
)
func main() {
client := cadenya.NewClient(
option.WithAPIKey("My API Key"),
)
account, err := client.Account.Get(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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"
}
}
]
}
}