# Authentication

Open <https://t.me/apmfun_bot?start=connect> in your browser and follow the instructions to obtain your Access Code.

Send the Access Code to the follwing endpoint to receive a JWT token.

## Login with Access Code

> Authenticate user with access code and return JWT token

```json
{"openapi":"3.0.3","info":{"title":"Bitbot Authentication API","version":"1.0.0"},"tags":[{"name":"Authentication","description":"User authentication and session management operations"}],"servers":[{"url":"https://api.apm-api.com","description":"Production Environment"}],"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT access token authentication"},"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"System API key authentication"}}},"paths":{"/login/access-code":{"post":{"tags":["Authentication"],"summary":"Login with Access Code","description":"Authenticate user with access code and return JWT token","operationId":"loginWithAccessCode","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"Access code"}}}}}},"responses":{"200":{"description":"Login successful","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"token":{"type":"string","description":"JWT access token"},"tokenType":{"type":"string"},"user":{"type":"object","properties":{"user_id":{"type":"integer"},"email":{"type":"string"},"username":{"type":"string"}}}}},"msg":{"type":"string"}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"msg":{"type":"string"}}}}}}}}}}}
```
