---
title: "Create a session token"
method: POST
path: "/api/session_token/"
tags: ["Bearer Tokens"]
---

# Create a session token

`POST /api/session_token/`

> 📘 Authentication Guide
>
> For comprehensive details about authenticating with the Forage API, refer to the [authentication guide](https://docs.joinforage.app/docs/authentication).

> 📘 Session Token Length
>
> Session tokens are short-lived and expire after fifteen minutes.


> ⚠️ Authentication Token Required
>
> You need to create an [authentication token](https://docs.joinforage.app/reference/create-authentication-token) before you can generate a session token.


A `POST` request to `/session_token/` creates a new session token. The token is returned as the `token` value in the response body.


A session token is a temporary OAuth 2.0 bearer token that expires after 15 minutes.


Session tokens are used in client-side requests. For example, `POST`s to [create a Payment Method](https://docs.joinforage.app/reference/create-payment-method) require session tokens in the `Authorization` header, and session tokens are passed as parameters to [SDK methods](https://docs.joinforage.app/docs/authentication#sdk-methods-that-require-session-tokens) that submit customer data.

## Response `201`

__Created__ - Success

- object
  - `token` string — The authentication token to include as the bearer token in the `Authorization` header of client-side requests and as a parameter to SDK methods.
  - `expiration_date` string — A UTC timestamp that indicates when the token expires, represented as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) date-time string.

## Other responses

- `401` — __Unauthorized__

---

[API](https://skmtc.dev/joinforage/apis/forage-payments-api.md) · [All operations](https://skmtc.dev/joinforage/apis/forage-payments-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/joinforage/forage-payments-api/revisions/4b7212706fae/schema)
