# Authentication

## POST /api/TokenAuth/Authenticate

> Authenticates the user's credentials and, upon successful verification, issues an access token that can be used to authorize subsequent requests made to the API

```json
{"openapi":"3.0.1","info":{"title":"DenvrCloud API","version":"v1"},"paths":{"/api/TokenAuth/Authenticate":{"post":{"tags":["TokenAuth"],"summary":"Authenticates the user's credentials and, upon successful verification, issues an access token that can be used to authorize subsequent requests made to the API","operationId":"ApiTokenauthAuthenticatePost","requestBody":{"content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/AuthenticateModel"}},"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticateModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/AuthenticateModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/AuthenticateModel"}}}},"responses":{"200":{"description":"Success","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/AuthenticateResultModel"}},"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticateResultModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/AuthenticateResultModel"}}}}}}}},"components":{"schemas":{"AuthenticateModel":{"required":["password","userNameOrEmailAddress"],"type":"object","properties":{"userNameOrEmailAddress":{"maxLength":256,"minLength":1,"type":"string"},"password":{"maxLength":128,"minLength":1,"type":"string"},"twoFactorVerificationCode":{"type":"string","nullable":true},"rememberClient":{"type":"boolean"},"twoFactorRememberClientToken":{"type":"string","nullable":true},"singleSignIn":{"type":"boolean","nullable":true},"returnUrl":{"type":"string","nullable":true},"captchaResponse":{"type":"string","nullable":true}},"additionalProperties":false},"AuthenticateResultModel":{"type":"object","properties":{"accessToken":{"type":"string","nullable":true},"encryptedAccessToken":{"type":"string","nullable":true},"expireInSeconds":{"type":"integer","format":"int32"},"shouldResetPassword":{"type":"boolean"},"passwordResetCode":{"type":"string","nullable":true},"userId":{"type":"integer","format":"int64"},"requiresTwoFactorVerification":{"type":"boolean"},"twoFactorAuthProviders":{"type":"array","items":{"type":"string"},"nullable":true},"twoFactorRememberClientToken":{"type":"string","nullable":true},"returnUrl":{"type":"string","nullable":true},"refreshToken":{"type":"string","nullable":true},"refreshTokenExpireInSeconds":{"type":"integer","format":"int32"},"c":{"type":"string","nullable":true}},"additionalProperties":false}}}}
```

## POST /api/TokenAuth/RefreshToken

> This endpoint allows for the renewal of the current access token, extending its validity period

```json
{"openapi":"3.0.1","info":{"title":"DenvrCloud API","version":"v1"},"paths":{"/api/TokenAuth/RefreshToken":{"post":{"tags":["TokenAuth"],"summary":"This endpoint allows for the renewal of the current access token, extending its validity period","operationId":"ApiTokenauthRefreshtokenPost","parameters":[{"name":"refreshToken","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/RefreshTokenResult"}},"application/json":{"schema":{"$ref":"#/components/schemas/RefreshTokenResult"}},"text/json":{"schema":{"$ref":"#/components/schemas/RefreshTokenResult"}}}}}}}},"components":{"schemas":{"RefreshTokenResult":{"type":"object","properties":{"accessToken":{"type":"string","nullable":true},"encryptedAccessToken":{"type":"string","nullable":true},"expireInSeconds":{"type":"integer","format":"int32"}},"additionalProperties":false}}}}
```

## GET /api/TokenAuth/LogOut

> Securely log out a user and invalidate the associated access token, effectively terminating the current session

```json
{"openapi":"3.0.1","info":{"title":"DenvrCloud API","version":"v1"},"paths":{"/api/TokenAuth/LogOut":{"get":{"tags":["TokenAuth"],"summary":"Securely log out a user and invalidate the associated access token, effectively terminating the current session","operationId":"ApiTokenauthLogoutGet","responses":{"200":{"description":"Success"}}}}}}
```


---

# 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://docs.denvrdata.com/docs/api-reference/authentication.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.
