---
title: "Getting an Access Token"
method: POST
path: "/user/auth"
tags: ["Authentication"]
---

# Getting an Access Token

`POST /user/auth`

## Request

- Base URL: `https://api.blog2social.com/rest/v1.0`
- URL: `https://api.blog2social.com/rest/v1.0/user/auth`
- Auth: none declared
- TypeScript: <https://skmtc.dev/blog2social/apis/blog2social-api/docs/user/auth/post.ts> (a function with typed inputs; its response is checked against the schema)

Get an access_token for a new user.<br><br><strong>Note:</strong> Access tokens currently have a fixed validity period of 10 years. Automatic token refresh is planned for a future API release but is not available at this time.

## Request body

- object
  - `service_token` string, required: The token for your service

## Response `201`

Created

- UserAuthSuccess
  - `access_token` string: The access token for the authenticated user.
  - `refresh_token` string
  - `expired_in` string: string (unix-timestamp)

## Other responses

- `500`: Internal Server Error

## Changes

- **2026-10-29** `25eaecaa1acb`: 1 breaking, 1 info
  - removed the success response with the status `200`
  - added the success response with the status `201`

[Operation history](https://skmtc.dev/blog2social/apis/blog2social-api/changes/user/auth/post.md)

---

[API](https://skmtc.dev/blog2social/apis/blog2social-api.md) - [All operations](https://skmtc.dev/blog2social/apis/blog2social-api/llms.txt) - [OpenAPI document](https://skmtc.dev/blog2social/apis/blog2social-api/revisions/25eaecaa1acb?raw)
