# Identity

Authentication and user management

## POST /v1/login

> Login to the API

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"tags":[{"name":"Identity","description":"Authentication and user management"}],"servers":[{"url":"http://connect2.tsanet.org","description":"Generated server url"}],"paths":{"/v1/login":{"post":{"tags":["Identity"],"summary":"Login to the API","operationId":"login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequestDTO"}}},"required":true},"responses":{"200":{"description":"Successful login","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenDTO"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/TokenDTO"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"LoginRequestDTO":{"required":["password","username"],"type":"object","properties":{"username":{"type":"string","description":"Username for authentication"},"password":{"type":"string","description":"Password for authentication"}}},"TokenDTO":{"type":"object","properties":{"accessToken":{"type":"string","description":"JWT access token"},"tokenType":{"type":"string"},"expiresIn":{"type":"integer","format":"int32"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"validationErrors":{"type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}
```

## GET /v1/me

> Get current user information

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"tags":[{"name":"Identity","description":"Authentication and user management"}],"servers":[{"url":"http://connect2.tsanet.org","description":"Generated server url"}],"security":[{"bearerAuth":[]}],"paths":{"/v1/me":{"get":{"tags":["Identity"],"summary":"Get current user information","operationId":"getCurrentUser","responses":{"200":{"description":"Current user information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserContextDTO"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/UserContextDTO"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"UserContextDTO":{"type":"object","properties":{"company":{"$ref":"#/components/schemas/CompanyDTO"},"user":{"$ref":"#/components/schemas/UserDTO"}}},"CompanyDTO":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"description":{"type":"string"},"domain":{"type":"string"}}},"UserDTO":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"phoneCountryCode":{"type":"string"},"city":{"type":"string"},"emailCheckFailData":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"validationErrors":{"type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tsanet.gitbook.io/connect/api-reference/identity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
