---
title: "Request a new REST API token for sub-account"
method: POST
path: "/api/v2/subaccounts/tokens"
tags: ["User Subaccounts"]
---

# Request a new REST API token for sub-account

`POST /api/v2/subaccounts/tokens`

<a class="try-sandbox-link" href="https://sandbox.textmagic.com/#/Sub-Accounts/requestNewSubaccountToken" target="_blank">Try in sandbox</a><br>Returning user object, key and app name.

## Request body

- object
  - `userId` integer, required — Sub-account ID.
  - `password` string, required — Your account password.
  - `appName` string — Application name.

## Response `200`

Created Sub-account data returned with success.

- User, nullable
  - `id` integer, required — User ID.
  - `displayTimeFormat` '12h' | '24h' — User's preferred format of time display: * *12h* - AM/PM format; * *24h* - 24-hour clock format.
  - `username` string, required — Username.
  - `firstName` string, required — Account first name.
  - `lastName` string, required — Account last name.
  - `email` string, required — User email address.
  - `status` 'A' | 'T', required — Current account status: * **A** for Active; * **T** for Trial.
  - `balance` number, required — Account balance (in account currency).
  - `phone` string, nullable, required — User's phone number.
  - `company` string, nullable, required — Account company name.
  - `currency` Currency, required
    - `id` string, required — The 3-letter ISO currency ID.
    - `unicodeSymbol` string, required — Unicode-compatible currency symbol.
    - `htmlSymbol` string, required — HTML-compatible currency symbol.
  - `country` Country, nullable, required
    - `id` string, required — The 2-letter ISO country ID.
    - `name` string, required — Full country name.
  - `timezone` Timezone, required
    - `id` integer, required — Internal timezone ID.
    - `area` string, required — Timezone area.
    - `dst` integer, required — Is daylight saving time used in this timezone?
    - `offset` integer, required — Offset from UTC time in seconds. In this example, it is 21600/60/60=6 hours.
    - `timezone` string, required — User-friendly timezone name (with spaces replaced by underscores).
  - `subaccountType` 'P' | 'A' | 'U', required — Type of account: * **P** for Parent User; * **A** for Administrator Sub-Account; * **U** for Regular User.
  - `emailAccepted` boolean, required — Does the account have a confirmed email?
  - `phoneAccepted` boolean, required — Does the account have a confirmed phone number?
  - `avatar` UserImage, nullable, required
    - `href` string, required — The URI of a user avatar.

## Other responses

- `400` — Bad request.
- `401` — Unauthorized request.
- `403` — Returned when the user does not have rights to perform this action.

---

[API](https://skmtc.net/textmagic/apis/textmagic-api.md) · [All operations](https://skmtc.net/textmagic/apis/textmagic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/textmagic/textmagic-api/revisions/3e4029d19684/schema)
