---
title: "Generate A Token"
method: POST
path: "/web_component_tokens"
tags: ["Web Component Tokens"]
---

# Generate A Token

`POST /web_component_tokens`

## Request

- Base URL: `https://api.justifi.ai/v1`
- URL: `https://api.justifi.ai/v1/web_component_tokens`
- Auth: none declared. Required headers: `Authorization`
- TypeScript: <https://skmtc.dev/justifi/apis/justifi-api-documentation/docs/web_component_tokens/post.ts> (a function with typed inputs; its response is checked against the schema)

The web component token provides permission to render a web component on your frontend. 
To get a web component token post your [access token](https://docs.justifi.tech/api-spec#tag/API-Credentials/operation/CreateAccessToken) in the header and the `business_id` or `account_id` as part of the `resources` array in the body.
For a list of resources needed for each web component please refer to [Roles need for each component](https://docs.justifi.tech/infrastructure/webComponentTokens#roles-need-for-each-component).
The token will be valid for 60 minutes.

## Headers

- `Authorization` string, required

## Request body

- object
  - `resources` string[]: Build an array of concatenated role (read/write), resource (account/business) and resource id which you need the web component to access. For example ["write:business:biz_123"]

## Response `200`

A web component token has been created

- object
  - `access_token` string: Use this field in the `auth-token` parameter of the web component you would like to render
  - `expires_in` number: The amount of seconds until the token expires
  - `token_type` string: Type of token, this will always return Bearer

---

[API](https://skmtc.dev/justifi/apis/justifi-api-documentation.md) - [All operations](https://skmtc.dev/justifi/apis/justifi-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/justifi/apis/justifi-api-documentation/revisions/dd9f3fed7e46?raw)
