---
search:
  tags:
    - Account
    - POST
seo:
  description: >-
    Exchanges a Privy access token, verified by the API, for an INVICTUS session
    in an HttpOnly… Reference for the POST /v1/session endpoint in the INVICTUS
    API.
sidebar:
  label: Exchange a verified Privy token for a revocable session cookie.
  badge: POST
title: Exchange a verified Privy token for a revocable session cookie.
type: openapi-operation
---
Exchanges a Privy access token, verified by the API, for an INVICTUS session in an HttpOnly cookie, and answers the account. 403 when the account may not sign in.

`POST /v1/session`

**Request body** (`application/json`, required)

- `privyToken` (string, required) — The Privy access token of the signed-in user; the API verifies it with Privy.
- `turnstileToken` (string, required) — The Cloudflare Turnstile token of the sign-in form.
- `inviteCode` (string) — An invitation code, while sign-up is by invitation.

Request body example:

```json
{
  "privyToken": "string",
  "turnstileToken": "string",
  "inviteCode": "string"
}
```

**Responses**

- `201` — Success.
- `400` — Invalid input; \`errors\` names the fields.
- `403` — Not allowed for this account.
- `429` — Too many requests; \`retryAfterSeconds\` says when to ask again.
- `500` — Server error.

Response example, 201:

```json
{
  "id": "Xq3v9Kp2LmN8RtY4",
  "username": "string",
  "picture": "../dictionary",
  "identities": [
    {
      "method": "google",
      "label": "string",
      "linkedAt": 1793145600
    }
  ],
  "wallets": [
    {
      "id": "evm:0x4200000000000000000000000000000000000006",
      "family": "evm",
      "address": "string",
      "kind": "embedded",
      "name": "string",
      "privyWalletId": "string"
    }
  ],
  "consents": [
    {
      "kind": "terms",
      "version": "string",
      "acceptedAt": 1793145600
    }
  ],
  "requiredConsents": [
    {
      "kind": "terms",
      "version": "string",
      "url": "string"
    }
  ],
  "mfa": {
    "enrolled": true,
    "methods": [
      "passkey"
    ]
  },
  "createdAt": 1793145600,
  "asOf": 1793145600
}
```
