STAGING ENVIRONMENT
TAGBASE

API Reference

Accounts

Create subaccounts and mint their API keys.

An account owns tags and API keys. The account that owns your key is your master account; accounts you create through the API are subaccounts of it — the unit of multi-tenancy. Creating a subaccount also mints its first API key.

Fields

Field Type Notes
id string acc_-prefixed, assigned by the platform.
name string Required. 1–100 characters.

A subaccount is always created beneath the account whose key you present; you don’t pass a parent — it’s inferred from the key.

Create a subaccount

POST /api/v1/accounts

Request

{
"data": {
"type": "accounts",
"attributes": {
"name": "Metropolitan Museum — Night Watch"
}
}
}

name is the only required attribute. The request also accepts optional profile attributes if you want to store them on the account: company, vat, country, address, city, state, zip_code.

curl https://platform.tagbase.io/api/v1/accounts \
-X POST \
-H "Authorization: Bearer $TAGBASE_API_KEY" \
-H "Content-Type: application/vnd.api+json" \
-d '{ "data": { "type": "accounts", "attributes": { "name": "Metropolitan Museum — Night Watch" } } }'

Response — 201 Created

The new subaccount, plus its freshly minted API key as an included api_keys resource. The key’s secret is shown here and nowhere else — capture it now.

{
"data": {
"type": "accounts",
"id": "acc_G5aNFLDZd6es1brCrj7QFi",
"attributes": { "name": "Metropolitan Museum — Night Watch" },
"relationships": {
"api_keys": {
"data": [ { "type": "api_keys", "id": "key_PD5omomyAxXscwKde4mpUS" } ]
}
}
},
"included": [
{
"type": "api_keys",
"id": "key_PD5omomyAxXscwKde4mpUS",
"attributes": { "secret": "key_PD5omomyAxXscwKde4mpUS:MFV6n8TpDjNYfaLH7BE2W4Clyu8UOV6DqM3yFzxhhqs" }
}
]
}

Store included[].attributes.secret immediately — it’s the credential you’ll use for every request made on behalf of this subaccount.

Errors

Status When
400 The body has no data.attributes object.
401 Missing, invalid, or revoked key.
422 Validation failed — e.g. name is missing or out of length.

Notes

  • There is no endpoint to read, list, or update an account after creation. Record the returned id and key when you create it.
  • Subaccounts nest one level beneath the presenting account; deeper hierarchies aren’t exposed through the API.
TAGBASE uses cookies to keep you signed in and protect against fraud. With your permission, we also measure how the site is used. Read our cookie policy for details.
Necessary
Analytics