---
title: "Create an accesstoken for a xs2a.api bank user"
method: PUT
path: "/api/users/{user-id}/accesstokens"
tags: ["XS2A.api.users"]
---

# Create an accesstoken for a xs2a.api bank user

`PUT /api/users/{user-id}/accesstokens`

The generated access token is valid for one hour before it expires by default.  It is possible to set a specific expiration-date using the `valid_until` parameter.

## Path parameters

- `user-id` string, required

## Request body

- Xs2aApiUsersAccesstokens
  - `valid_until` string — The accesstoken is valid until the given date (Format: YYYY-MM-DD hh:mm:ss).

## Response `200`

Request successfully processed

- AccessToken
  - `id` string — access Token ID
  - `token` string — The Access Token
  - `valid_until` string — The date-time this token expires. Note that the access token is valid for one hour. After one hour you have to refresh the token, to be valid another hour.
  - `created_at` string — Date of creation
  - `object` string — The value bank_user_access_token

## Other responses

- `401` — Authentication failed API key missing or not valid
- `403` — Forbidden Access blocked
- `404` — Product not enabled or Not found The requested object does not exist on the server
- `422` — Validation failed Something is wrong with the user input
- `500` — An internal server problem occurred

---

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