> For the complete documentation index, see [llms.txt](https://docs.denvrdata.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.denvrdata.com/docs/api-reference/authentication.md).

# 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.4","info":{"title":"DenvrCloud API","version":"v1"},"tags":[{"name":"TokenAuth"}],"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":{"schema":{"$ref":"#/components/schemas/AuthenticateModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/AuthenticateModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/AuthenticateModel"}}}},"responses":{"200":{"description":"OK","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.4","info":{"title":"DenvrCloud API","version":"v1"},"tags":[{"name":"TokenAuth"}],"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":"OK","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.4","info":{"title":"DenvrCloud API","version":"v1"},"tags":[{"name":"TokenAuth"}],"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":"OK"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.denvrdata.com/docs/api-reference/authentication.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
