> For the complete documentation index, see [llms.txt](https://mobile-calendar.gitbook.io/v1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mobile-calendar.gitbook.io/v1/rest-api/auth.md).

# Auth

Authentication (JWT).

## Get access token (JWT)

> Requires valid user credentials. Returns \`access\_token\` of type Bearer. Token expires after \*\*3600 seconds (60 minutes)\*\*. You must obtain a new token after expiration.

```json
{"openapi":"3.0.0","info":{"title":"Public REST API v1 – mobile-calendar.com","version":"1.0.0"},"tags":[{"name":"auth","description":"Authentication (JWT)."}],"servers":[{"url":"https://api.mobile-calendar.com/v1/public","description":"Production"}],"paths":{"/auth/token":{"post":{"tags":["auth"],"summary":"Get access token (JWT)","description":"Requires valid user credentials. Returns `access_token` of type Bearer. Token expires after **3600 seconds (60 minutes)**. You must obtain a new token after expiration.","operationId":"createToken","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}}},"responses":{"200":{"description":"Token generated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProblem400"}}}},"401":{"description":"Invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProblem401"}}}}}}}},"components":{"schemas":{"TokenRequest":{"description":"Client credentials for obtaining JWT. `scope` is optional.","required":["clientId","clientSecret"],"properties":{"clientId":{"type":"string"},"clientSecret":{"type":"string"}},"type":"object"},"TokenResponse":{"description":"JWT token for use in Authorization header.","required":["access_token","token_type","expires_in"],"properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"expires_in":{"type":"integer"},"scope":{"type":"array","items":{"type":"string"}}},"type":"object"},"ApiProblem400":{"description":"Request syntax/format error.","allOf":[{"$ref":"#/components/schemas/ApiProblemBase"},{"properties":{"type":{"description":"400 Bad Request","type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"type":"object"}]},"ApiProblemBase":{"description":"RFC 7807 Problem Details (base schema).","required":["type","title","status","detail","instance"],"properties":{"type":{"description":"RFC 7807 base — DO NOT use directly in endpoints.\nIn endpoints reference ApiProblem400/401/403/409/422/429/500.","type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"type":"object"},"ApiProblem401":{"description":"Missing authentication or invalid credentials.","allOf":[{"$ref":"#/components/schemas/ApiProblemBase"},{"properties":{"type":{"description":"401 Unauthorized","type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"type":"object"}]}}}}
```
