---
title: "Create a trace session token for a deployment"
method: POST
path: "/v1/projects/traces/session"
tags: ["projects"]
---

# Create a trace session token for a deployment

`POST /v1/projects/traces/session`

## Request

- Base URL: `https://api.vercel.com`
- URL: `https://api.vercel.com/v1/projects/traces/session`
- Auth: HTTP bearer

Mints a short-lived HS256 JWT scoped to a deployment hostname. The Vercel CLI presents this JWT to the Vercel proxy on requests it wants traced.

## Query parameters

- `teamId` string
- `slug` string

## Request body

- object
  - `projectId` string, required: The project ID the deployment belongs to.
  - `hostname` string, required: The deployment hostname to scope the trace session to.

## Response `200`

- object
  - `token` string, required

## Other responses

- `400`: One of the provided values in the request body is invalid.
- `401`: The request is not authorized.
- `403`: You do not have permission to access this resource.
- `404`
- `410`
- `422`

## Changes

- **2026-09-30** `099fbe1f521c`: 1 info
  - added the non-success response with the status `404`
- **2026-07-21** `2ae10ee9d21c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/vercel/apis/vercel-api/changes/v1/projects/traces/session/post.md)

---

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