Skip to content

Accounts ​

List the accounts you belong to, rename one, and manage its members and workspaces. Roles are owner, admin, and billing. See the accounts guide.

An account id is the id of that account's primary workspace. Publishable keys cannot call these routes.

List accounts ​

GET/v1/accounts

A signed-in person receives every account they belong to, including an account they reach only through a workspace role (role is null). An account key receives only its own account, with role null. A workspace key is refused.

Response 200 ​

json
{
  "accounts": [
    {
      "id": "3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11",
      "name": "Rymi",
      "role": "owner"
    }
  ]
}
FieldTypeDescription
idstringAccount id. Same value as the primary workspace id.
namestringAccount name.
rolestring or nullYour account role: owner, admin, billing, or null when you only have a workspace role.

Example ​

bash
curl https://api.rymi.live/v1/accounts \
  -H "Authorization: Bearer $RYMI_API_KEY"
ts
const { accounts } = await rymi.accounts.list();
python
accounts = rymi.accounts.list()["accounts"]

Errors ​

StatusCodeWhen
401Missing or invalid authentication.
403A publishable key. The error is Publishable keys cannot list accounts.
403role_forbiddenA workspace key.

Get an account ​

GET/v1/accounts/:id

Path parameters ​

FieldTypeRequiredDescription
idstringYesAccount id.

Response 200 ​

json
{
  "account": {
    "id": "3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11",
    "name": "Rymi",
    "role": "owner"
  }
}

A secret key can read its own account. role is your account role, or null for a key.

Example ​

bash
curl https://api.rymi.live/v1/accounts/3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11 \
  -H "Authorization: Bearer $RYMI_API_KEY"
ts
const { account } = await rymi.accounts.get("3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11");
python
account = rymi.accounts.get("3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11")["account"]

Errors ​

StatusCodeWhen
403A publishable key.
403workspace_forbiddenYou do not belong to that account, or a secret key names a different account.
404not_foundThe id is not an account.

Rename an account ​

PATCH/v1/accounts/:id

Owner or Admin. A secret key for this account is treated as Admin.

Body ​

FieldTypeRequiredDescription
namestringYes1 to 80 characters after trimming spaces.

Example ​

bash
curl -X PATCH https://api.rymi.live/v1/accounts/3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11 \
  -H "Authorization: Bearer $RYMI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Rymi" }'
ts
await rymi.accounts.update("3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11", { name: "Rymi" });
python
rymi.accounts.update("3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11", "Rymi")

Response 200 ​

json
{ "ok": true }

Errors ​

StatusCodeWhen
400name is empty or longer than 80 characters.
403A publishable key.
403role_forbiddenYou are not Owner or Admin of this account. Billing is refused.
403scope_missingThe key lacks workspaces:write. required_scope is workspaces:write.

List members ​

GET/v1/accounts/:id/members

Owner or Admin. A secret key for this account is treated as Admin. Adding an Owner still requires a signed-in Owner.

Response 200 ​

json
{
  "members": [
    {
      "user_id": "550e8400-e29b-41d4-a716-446655440000",
      "email": "ada@example.com",
      "role": "owner"
    }
  ]
}
FieldTypeDescription
user_idstringUser id. Send this to change or remove the member.
emailstring or nullTheir sign-in email, when Rymi can read it.
rolestringowner, admin, or billing.

Example ​

bash
curl https://api.rymi.live/v1/accounts/3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11/members \
  -H "Authorization: Bearer $RYMI_API_KEY"
ts
const { members } = await rymi.accounts.members.list("3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11");
python
members = rymi.accounts.list_members("3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11")["members"]

Errors ​

StatusCodeWhen
403A publishable key.
403role_forbiddenYou are not Owner or Admin. Billing receives this.
403scope_missingThe key lacks account_members:read.

Add a member ​

POST/v1/accounts/:id/members

Owner or Admin. Only an Owner can grant owner or billing, because both can spend the account's money. A key acts as an Admin, so it can't grant either. Someone without a Rymi account gets an invite email.

Body ​

FieldTypeRequiredDescription
emailstringYesTheir email address.
rolestringYesowner, admin, or billing.

Example ​

bash
curl -X POST https://api.rymi.live/v1/accounts/3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11/members \
  -H "Authorization: Bearer $RYMI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "email": "arvind@example.com", "role": "billing" }'
ts
const { member } = await rymi.accounts.members.add(
  "3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11",
  { email: "arvind@example.com", role: "billing" },
);
python
member = rymi.accounts.add_member(
    "3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11",
    "arvind@example.com",
    "billing",
)["member"]

Response 201 ​

json
{
  "member": {
    "user_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "email": "arvind@example.com",
    "role": "billing"
  }
}

Errors ​

StatusCodeWhen
400invalid_emailThe email address is not valid.
400role_not_allowedrole is not owner, admin, or billing.
403A publishable key.
403role_forbiddenYou are not Owner or Admin, or an Admin tried to add an Owner. A secret key cannot add an Owner.
403scope_missingThe key lacks account_members:write.
409already_memberThat person is already a member.

Change a member's role ​

PATCH/v1/accounts/:id/members/:userId

Owner or Admin. Only an Owner can change an Owner, or grant owner or billing. Demoting the last Owner returns 400 last_owner.

Body ​

FieldTypeRequiredDescription
rolestringYesowner, admin, or billing.

Path parameters ​

FieldTypeRequiredDescription
idstringYesAccount id.
userIdstringYesuser_id from the members list.

Example ​

bash
curl -X PATCH https://api.rymi.live/v1/accounts/3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11/members/6ba7b810-9dad-11d1-80b4-00c04fd430c8 \
  -H "Authorization: Bearer $RYMI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "role": "admin" }'
ts
await rymi.accounts.members.update(
  "3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11",
  "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
  { role: "admin" },
);
python
rymi.accounts.update_member(
    "3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11",
    "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "admin",
)

Response 200 ​

json
{
  "member": {
    "user_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
    "role": "admin"
  }
}

Errors ​

StatusCodeWhen
400role_not_allowedrole is not owner, admin, or billing.
400last_ownerThis change would leave the account with no Owner.
403A publishable key.
403role_forbiddenYou are not Owner or Admin, or an Admin tried to change an Owner or grant owner.
403scope_missingThe key lacks account_members:write.
404not_a_memberThat person is not a member.

Remove a member ​

DELETE/v1/accounts/:id/members/:userId

Owner or Admin. Only an Owner can remove an Owner. Removing the last Owner returns 400 last_owner.

Path parameters ​

FieldTypeRequiredDescription
idstringYesAccount id.
userIdstringYesuser_id from the members list.

Example ​

bash
curl -X DELETE https://api.rymi.live/v1/accounts/3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11/members/6ba7b810-9dad-11d1-80b4-00c04fd430c8 \
  -H "Authorization: Bearer $RYMI_API_KEY"
ts
await rymi.accounts.members.remove(
  "3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11",
  "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
);
python
rymi.accounts.remove_member(
    "3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11",
    "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
)

Response 200 ​

json
{ "ok": true }

Errors ​

StatusCodeWhen
400last_ownerThe account would have no Owner.
403A publishable key.
403role_forbiddenYou are not Owner or Admin, or an Admin tried to remove an Owner.
403scope_missingThe key lacks account_members:write.
404not_a_memberThat person is not a member.

List workspaces ​

GET/v1/accounts/:id/workspaces

Owner or Admin. Each workspace includes this calendar month's calls, minutes, and credits (UTC), from workspace_month_usage. Billing receives 403 role_forbidden.

Response 200 ​

json
{
  "workspaces": [
    {
      "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "name": "Sarang Stay Homes",
      "calls": 41,
      "minutes": 96.5,
      "credits": 579,
      "spend_cap_cents_monthly": 5000
    }
  ]
}
FieldTypeDescription
idstringWorkspace id.
namestringDisplay name.
callsnumberCalls in the current month (UTC).
minutesnumberBilled minutes that month, to one decimal.
creditsnumberCredits used that month. 1 credit = $0.01.
spend_cap_cents_monthlynumber or nullMonthly spend cap in credits, or null.

Example ​

bash
curl https://api.rymi.live/v1/accounts/3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11/workspaces \
  -H "Authorization: Bearer $RYMI_API_KEY"
ts
const { workspaces } = await rymi.accounts.workspaces("3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11");
python
workspaces = rymi.accounts.workspaces("3f1c0a2e-6b4d-4e1a-9c77-2a6e0b9d4f11")["workspaces"]

Errors ​

StatusCodeWhen
403A publishable key.
403role_forbiddenYou are not Owner or Admin. Billing receives this on the workspaces list.
403scope_missingThe key lacks workspaces:read.