---
title: "Create Csrf Token"
method: GET
path: "/api/csrf-token"
---

# Create Csrf Token

`GET /api/csrf-token`

## Request

- The document declares no server URL.
- Auth: none declared

Create or update a CSRF token for a client

## Query parameters

- `client` string, required: The client to create a CSRF token for

## Headers

- `x-prefect-api-version` string

## Response `200`

Successful Response

- CsrfToken: A PrefectBaseModel with an auto-generated UUID ID value and created / updated timestamps, intended for compatibility with our standard ORM models. The ID, created, and updated fields are reset on copy() and not included in equality comparisons.
  - `id` string, uuid
  - `created` string, date-time
  - `updated` string, date-time
  - `token` string, required: The CSRF token
  - `client` string, required: The client id associated with the CSRF token
  - `expiration` string, date-time, required: The expiration time of the CSRF token

## Other responses

- `422`: Validation Error

## Changes

- **2024-03-15** `c9eebb9d47c3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/prefecthq/apis/prefect-unreleased-api/changes/api/csrf-token/get.md)

---

[API](https://skmtc.dev/prefecthq/apis/prefect-unreleased-api.md) - [All operations](https://skmtc.dev/prefecthq/apis/prefect-unreleased-api/llms.txt) - [OpenAPI document](https://skmtc.dev/prefecthq/apis/prefect-unreleased-api/revisions/29ba6c4f8837?raw)
