---
title: "Create Connection Session Token"
method: POST
path: "/integrations/connections/session-token"
tags: ["Integrations"]
---

# Create Connection Session Token

`POST /integrations/connections/session-token`

## Request

- Base URL: `https://be.graph8.com/api/v1`
- URL: `https://be.graph8.com/api/v1/integrations/connections/session-token`
- Auth: HTTP bearer

Mint a short-lived token for the hosted OAuth flow.

The token is what a browser hands to the connection provider to run the
consent screen; this call does not connect anything by itself. The result
of that flow comes back to `POST /integrations/connections`.

The body is optional - omit it to take the app's default provider.

## Headers

- `Authorization` string, nullable
- `X-Target-Org-Id` string, nullable

## Request body

- SessionTokenRequest: Mint a short-lived token for the hosted OAuth flow. Both fields are optional because the app's model has them optional - it falls back to its own default provider. They are NOT interchangeable spellings of one thing: `provider` is the stable graph8 name and `provider_config_key` is the key in the connection provider's own config, and the two can differ per environment.
  - `provider` string, nullable: Stable graph8 provider name.
  - `provider_config_key` string, nullable: Provider config key on the connection provider.

## Response `200`

Successful Response

- ApiResponseConnectionPayload
  - `data` ConnectionPayload, required: An open envelope for a connection, a token or a migration report. Open because the migration STATUS payload carries a per-entity progress map, a discovered-field map and a pipeline list that all grow with the providers - and because a dropped warning on a migration report reads as "nothing went wrong".
  - `pagination` PaginationMeta
    - `page` integer, required: Current page number (1-indexed)
    - `limit` integer, required: Items per page
    - `total` integer, required: Total number of items
    - `has_next` boolean, required: Whether there are more pages
    - `next_cursor` string, nullable: Opaque cursor for the next page; null when there are no more items. Pass it back as the `cursor` query param to fetch the following page without computing page numbers.
    - `total_available` integer, nullable: Search endpoints only: how many records really match, when known. Can be larger than `total`, which is capped at the 10,000 results that can be paged. For company search this is a distinct-company estimate. Null when unknown; absent outside search.
    - `total_is_lower_bound` boolean, nullable: Search endpoints only: true when more records match than `total` shows (the result set is larger than the 10,000 results that can be paged). Absent outside search.
    - `notes` string[], nullable: Search endpoints only: plain-language notes about the result, e.g. that more records match than can be paged, or that a reversed `between` range was put in order.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/graph8/apis/graph8-developer-api.md) · [All operations](https://skmtc.dev/graph8/apis/graph8-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/graph8/apis/graph8-developer-api/revisions/2e7cfa0ca921?raw)
