---
title: "Get delegate token for customer portal"
method: POST
path: "/portal/token"
tags: ["Customer Portal"]
---

# Get delegate token for customer portal

`POST /portal/token`

## Request

- Base URL: `https://api.togai.com`
- URL: `https://api.togai.com/portal/token`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/togaihq/apis/togai-apis/docs/portal/token/post.ts> (a function with typed inputs; its response is checked against the schema)

Get delegate token for customer portal

## Request body

- GetCustomerPortalDelegateTokenRequest: Request to get delegate token for customer portal
  - `customerId` string, required: Identifier of the customer
  - `accountIds` string[]: Identifier of the accounts under the customer for which access is requested. Maximum of 5 account ids can be provided
  - `allAccountsAccess` boolean: Flag to specify if access for every account under the customer is required
  - `expiry` integer: Expiry in seconds from the time of generation. If not provided, generated token will have the expiry of the token used for requesting.

## Response `200`

OK

- TokenResponse
  - `token` string, required

## Other responses

- `400`: Error response
- `401`: Error response
- `403`: Error response
- `404`: Error response
- `429`: Error response
- `default`: Error response

## Changes

- **2024-07-11** `5abfbfe439be`: 1 info
  - endpoint added
- **2023-09-02** `6b13f6f47735`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/togaihq/apis/togai-apis/changes/portal/token/post.md)

---

[API](https://skmtc.dev/togaihq/apis/togai-apis.md) - [All operations](https://skmtc.dev/togaihq/apis/togai-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/togaihq/apis/togai-apis/revisions/442f5d8f4aa0?raw)
