---
title: "Request a client-side token"
method: POST
path: "/api/auth/claim"
tags: ["Auth"]
---

# Request a client-side token

`POST /api/auth/claim`

If you need to perform client-side requests, you will have to request a client-side token from you backend, and get a JWT token from this API call in return. This token will be usable on the client side. This call need your secret access token, the url of the website the client side requests will come from and optionally the client IP address.

## Request body

- object
  - `origin` string, required — The website url the API requests will come from
  - `ip` string, nullable — The client IP

## Response `200`

Success

- object
  - `expiration` string — The expiration time of the token. After this time, you'll have to request a token again
  - `token` string — The client-side access token, that you'll use instead of your access token in the `token` parameter

## Other responses

- `401` — Invalid credentials
- `422` — Missing parameters

---

[API](https://skmtc.net/treflehq/apis/trefle-api-v1.md) · [All operations](https://skmtc.net/treflehq/apis/trefle-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/treflehq/trefle-api-v1/revisions/2e0d8882f840/schema)
