---
title: "POST /v1/authentications"
method: POST
path: "/v1/authentications"
tags: ["users"]
---

# POST /v1/authentications

`POST /v1/authentications`

Returns an auth token to build basicAuth for the provided credentials

## Request body

- Authentication
  - `username` string, required
  - `password` string, required
  - `context` string
  - `device` DefaultDevice
    - `device_id` string, required
    - `ecdsa_key` ECKey, required
      - `curve` 'P-256' | 'P-384' | 'P-512', required
      - `hash` 'SHA256' | 'SHA384' | 'SHA512'
      - `x` string, required
      - `y` string, required

## Response `200`

Successful authentication

- object
  - `username` string
  - `user_id` string — the user_id makes the 'username' for basicAuth
  - `tokens` object
    - `access_token` string — the access_token makes the 'password' for basicAuth
    - `expires_in` integer
    - `expires_at` string
    - `refresh_token` string
  - `device` object
    - `device_id` string — Identifier of the device used for authentication
    - `status` string — Device status

## Other responses

- `401` — Authentication error

---

[API](https://skmtc.net/caliopen/apis/caliopen-http-rest-api.md) · [All operations](https://skmtc.net/caliopen/apis/caliopen-http-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/caliopen/caliopen-http-rest-api/revisions/f32b5d08284d/schema)
