---
title: "Create Component Token"
method: POST
path: "/auth/component-token"
tags: ["1. Authentication"]
---

# Create Component Token

`POST /auth/component-token`

Authenticate on behalf of an end user by supplying their external user ID.

This endpoint is used by authenticated API clients to create a user-scoped access token for a specific end user (referenced by their external ID) in the API client's organisation. If no such end user exists, one will be created on demand.

Returns a bearer access token scoped to this end user upon success.

This token is site-scoped and valid for 24 hours, longer-lived than the standard organisation token (1 hour) as it is intended for end-user sessions.

## Response `200`

Successfully authenticated with a user-scoped access token

- ComponentToken — Organisation scoped token. Includes internal user ID so clients can make futher API requests regarding this user if needed.
  - `id` string, uuid, required
  - `access_token` string, required
  - `token_type` string, required

## Other responses

- `404` — Error trying to find organisation
- `422` — Validation Error
- `500` — Server error when trying to find or create the user

---

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