Skip to content

Get the current team

GET/teams/context

Overview

Returns the current team, its owner, your role and permissions under active. teams lists the teams you can access, with owned teams first. The remaining fields count owned teams, memberships and teams other than the current one. Leaving or deleting a team selects the account's default team.

Permissions

Requires the account permission teams.read (View teams).

curl --request GET \
  --url 'https://console.advinservers.com/api/v1/client/teams/context' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json'
{
  "active": {
    "id": "fbb31f5f-bd6f-4019-a3ed-1062a28f56f7",
    "name": "Anomalous Materials",
    "is_owner": true,
    "owner": {
      "name": "Gordon Freeman",
      "email": "gordon.freeman@blackmesa.example.com"
    },
    "role": null,
    "permissions": [
      "team.read",
      "team.manage",
      "alert.read",
      "alert.manage",
      "server.read",
      "server.power",
      "server.console",
      "server.update",
      "server.credentials",
      "server.reinstall",
      "server.transfer",
      "backup.read",
      "backup.create",
      "backup.restore",
      "backup.download",
      "backup.delete",
      "snapshot.read",
      "snapshot.create",
      "snapshot.restore",
      "snapshot.delete",
      "snapshot.update",
      "snapshot.transfer",
      "firewall.read",
      "firewall.update",
      "firewall.delete",
      "network.read",
      "network.update",
      "network.transfer",
      "network.delete",
      "sshkey.read",
      "sshkey.update",
      "sshkey.delete",
      "script.read",
      "script.update",
      "script.delete",
      "iso.read",
      "iso.update",
      "iso.delete",
      "measured_boot.read",
      "measured_boot.update",
      "measured_boot.delete",
      "billing.read",
      "billing.manage",
      "billing.purchase"
    ]
  },
  "teams": [
    {
      "id": "fbb31f5f-bd6f-4019-a3ed-1062a28f56f7",
      "name": "Anomalous Materials",
      "is_owner": true,
      "is_default": true,
      "is_active": true,
      "role": null
    },
    {
      "id": "48454223-c5ac-461f-bead-ba8dda13eea9",
      "name": "Lambda Complex",
      "is_owner": true,
      "is_default": false,
      "is_active": false,
      "role": null
    }
  ],
  "owned_team_count": 2,
  "membership_count": 0,
  "other_team_count": 1
}

Authorization

Authorizationstringheaderrequired

Your API key, sent as a bearer token. Create one in the control panel under API Keys, give it only the permissions the integration needs, and copy it when it is created. It cannot be shown again. Each key is restricted to one owned team. The key determines the team for every request.

Send it as Bearer <token>.

Response 200

application/json

The record, as a JSON object. There is no envelope.

activeobjectrequired

The team this request is working in.

Show child attributes
idstringrequired

The team's id.

namestringrequired

What the team is called.

is_ownerbooleanrequired

True when the account owns this team rather than having been invited into it.

ownerobjectrequired

The account the team belongs to. Both fields are null if that account has gone.

Show child attributes
namestring | nullrequired

The name shown to customers.

emailstring | nullrequired

The email address.

roleobject | nullrequired

The role you hold here, or null when you own the team: ownership is not a role.

Show child attributes
idstringrequired

The id ID.

namestringrequired

The name shown to customers.

permissionsstring[]required

The permission keys you hold here. An account holder holds every key there is.

teamsobject[]required

Every team the account can work in, the ones it owns first and its default first among those.

Show child attributes
idstringrequired

The team's UUID.

namestringrequired

What the team is called.

is_ownerbooleanrequired

True when the account owns this team rather than having been invited into it.

is_defaultbooleanrequired

True for the account's default team, which is where anything created without naming a team lands.

is_activebooleanrequired

True for the team this request is working in.

roleobject | nullrequired

The role held here, or null when the account owns the team: ownership is not a role.

Show child attributes
idstringrequired

The id ID.

namestringrequired

The name shown to customers.

owned_team_countintegerrequired

How many teams the account owns.

membership_countintegerrequired

How many teams the account has been invited into.

other_team_countintegerrequired

Those two added together, less the one this request is in.

Errors

401
The key was missing, malformed, revoked, or belongs to an account that no longer exists.
403
Access denied. Check the key's team, permissions and allowed IP addresses. Some actions, such as managing API keys, require a browser session. The response message explains the reason.
429
Too many requests. The Retry-After header says how many seconds to wait. Limits are per account, so several keys on one account share them.