---
title: "Generate business token"
method: POST
path: "/portal/businesses/{business_id}/token/"
tags: ["Direct SME Portal"]
---

# Generate business token

`POST /portal/businesses/{business_id}/token/`

## Request

- Base URL: `https://docs.thredfi.com` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.thredfi.com/portal/businesses/{business_id}/token/`
- Auth: one of:
  - API key in cookie `sessionid`
  - HTTP basic
  - HTTP bearer
  - HTTP bearer

Generate a JWT token scoped to a specific business for SDK access. The business must belong to the authenticated user's partner.

## Path parameters

- `business_id` string, required

## Request body

- DirectSMEBusinessTokenResponseRequest: Serializer for business token response in Direct SME Portal.
  - `access_token` string, required: JWT access token for SDK
  - `expires_in` integer, required: Token expiry in seconds
  - `token_type` string, required: Token type (Bearer)
  - `business_id` string, uuid, required: Business ID the token is scoped to

## Response `200`

- DirectSMEBusinessTokenResponse: Serializer for business token response in Direct SME Portal.
  - `access_token` string, required: JWT access token for SDK
  - `expires_in` integer, required: Token expiry in seconds
  - `token_type` string, required: Token type (Bearer)
  - `business_id` string, uuid, required: Business ID the token is scoped to

## Other responses

- `400`: Validation errors in request data
- `401`: Authentication required - missing or invalid API key
- `403`: Permission denied - insufficient privileges
- `404`: Resource not found
- `409`: Conflict - resource already exists or invalid state transition
- `422`: Unprocessable entity - business logic validation failed
- `500`: Internal server error

---

[API](https://skmtc.dev/thredfi/apis/thredfi-accounting-platform-api.md) - [All operations](https://skmtc.dev/thredfi/apis/thredfi-accounting-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/thredfi/apis/thredfi-accounting-platform-api/revisions/0c1918254db3?raw)
