---
title: "Create a new authentication token to use with the 'renterd_auth' cookie"
method: POST
path: "/auth"
tags: ["authentication"]
---

# Create a new authentication token to use with the 'renterd_auth' cookie

`POST /auth`

Creates a new authentication token with the specified 'validity' duration. The token can be attached to a request as the `renterd_auth` cookie as an alternative way to Basic Auth for the API.`

## Query parameters

- `validity` integer, required

## Response `200`

Successfully created a new token

- object
  - `token` string — A hex-encoded string representing the token

## Other responses

- `400` — Bad request

## Changes

- **2025-01-10** `443ed9c0ba5a` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/siafoundation/apis/renterd-api/changes/auth/post.md)

---

[API](https://skmtc.dev/siafoundation/apis/renterd-api.md) · [All operations](https://skmtc.dev/siafoundation/apis/renterd-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/siafoundation/renterd-api/revisions/443ed9c0ba5a/schema)
