> For the complete documentation index, see [llms.txt](https://documentation.atempo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.atempo.com/miria-4.6/reference-documentation/rest-api-reference/auth.md). Agents can also search and read this documentation through its [MCP server](https://documentation.atempo.com/~gitbook/mcp).

# Auth

## POST /auth/change-password/

> set a new password if the authentified user must change password.\
> \
> \*\*this endpoint should be called only on authentication phase if the connection attempt returns expected="newpassword" in response\*\*\
> \
> \*\*if it is called with an unrestricted access token, then there is no response body\*\*<br>

```json
{"openapi":"3.0.3","info":{"title":"Miria REST API","version":"1.0.0"},"servers":[{"url":"/restapi/"}],"security":[{"jwtAuth":[]}],"components":{"securitySchemes":{"jwtAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/auth/change-password/":{"post":{"operationId":"authChangePasswordCreate","description":"set a new password if the authentified user must change password.\n\n**this endpoint should be called only on authentication phase if the connection attempt returns expected=\"newpassword\" in response**\n\n**if it is called with an unrestricted access token, then there is no response body**\n","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"description":""}}},"description":""}}}}}}
```

## GET /auth/logout/

>

```json
{"openapi":"3.0.3","info":{"title":"Miria REST API","version":"1.0.0"},"servers":[{"url":"/restapi/"}],"paths":{"/auth/logout/":{"get":{"operationId":"authLogoutList","parameters":[{"name":"limit","required":false,"in":"query","description":"Number of results to return per page.","schema":{"type":"integer"}},{"name":"offset","required":false,"in":"query","description":"The initial index from which to return the results.","schema":{"type":"integer"}}],"tags":["auth"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedAuthLogoutList"}}},"description":""}}}}},"components":{"schemas":{"PaginatedAuthLogoutList":{"type":"object","required":["count","results"],"properties":{"count":{"type":"integer"},"next":{"type":"string","nullable":true,"format":"uri"},"previous":{"type":"string","nullable":true,"format":"uri"},"results":{"type":"array","items":{"$ref":"#/components/schemas/AuthLogout"}}}},"AuthLogout":{"type":"object","properties":{"refresh":{"type":"string"}},"required":["refresh"]}}}}
```

## POST /auth/logout/

> \
> Logout the current user. Invalidates the current bearer token and the refresh token passed in payload.\
> \
> An authorization bearer token is optional. If a valid bearer token is passed in authorization header, it will be invalidated as well.\
> \
> \*\*Input payload with:\*\*\
> \
> \*\*refresh\*\*: a valid refresh token\
> &#x20;      &#x20;

```json
{"openapi":"3.0.3","info":{"title":"Miria REST API","version":"1.0.0"},"servers":[{"url":"/restapi/"}],"paths":{"/auth/logout/":{"post":{"operationId":"authLogoutCreate","description":"\nLogout the current user. Invalidates the current bearer token and the refresh token passed in payload.\n\nAn authorization bearer token is optional. If a valid bearer token is passed in authorization header, it will be invalidated as well.\n\n**Input payload with:**\n\n**refresh**: a valid refresh token\n        ","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"description":""}}},"description":""}}}}}}
```

## GET /auth/saml/

> \*\*Authenticate through SAML\*\*\
> \
> This endpoint is intended for use with product Web UI only\
> &#x20;              &#x20;

```json
{"openapi":"3.0.3","info":{"title":"Miria REST API","version":"1.0.0"},"servers":[{"url":"/restapi/"}],"paths":{"/auth/saml/":{"get":{"operationId":"adaAuthSaml","description":"**Authenticate through SAML**\n\nThis endpoint is intended for use with product Web UI only\n                ","parameters":[{"in":"query","name":"dbName","schema":{"type":"string"},"description":"Database name to connect to","required":true},{"in":"query","name":"superUser","schema":{"type":"boolean"},"description":"State of user to be connected"}],"tags":["auth"],"responses":{"302":{"content":{"application/json":{"schema":{"description":"redirection host response"}}},"description":""}}}}}}
```

## GET /auth/saml-metadata/

> Generate SP XML Metadata object for IDP registration

```json
{"openapi":"3.0.3","info":{"title":"Miria REST API","version":"1.0.0"},"servers":[{"url":"/restapi/"}],"paths":{"/auth/saml-metadata/":{"get":{"operationId":"adaAuthSamlMetadata","description":"Generate SP XML Metadata object for IDP registration","parameters":[{"in":"query","name":"dbName","schema":{"type":"string"},"description":"Database name to connect to","required":true}],"tags":["auth"],"responses":{"200":{"content":{"application/json":{"schema":{"description":""}}},"description":""}}}}}}
```

## POST /auth/setup2fa/disable/

> \
> Disables two factor authentication for the current user or for another user by an administrator.\
> \
> \*\*Input payload with:\*\*\
> \
> \*\*twoFaCode\*\*: (current user only) a valid two factor authentication code (TOTP or recover code)\
> \
> \*\*user\*\*: (admin only) disable two factor authentication for the specified user name\<br>\
> \
> \*-- Endpoint compatible with MaxDB --\*\
> &#x20;      &#x20;

```json
{"openapi":"3.0.3","info":{"title":"Miria REST API","version":"1.0.0"},"servers":[{"url":"/restapi/"}],"security":[{"jwtAuth":[]}],"components":{"securitySchemes":{"jwtAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/auth/setup2fa/disable/":{"post":{"operationId":"authSetup2faDisableCreate","description":"\nDisables two factor authentication for the current user or for another user by an administrator.\n\n**Input payload with:**\n\n**twoFaCode**: (current user only) a valid two factor authentication code (TOTP or recover code)\n\n**user**: (admin only) disable two factor authentication for the specified user name<br>\n\n*-- Endpoint compatible with MaxDB --*\n        ","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"description":""}}},"description":""}}}}}}
```

## POST /auth/setup2fa/enable/

> \
> Enables two factor authentication for the current user or for another user by an administrator.\
> The secret is sent back only if called by current user. If called by admin, the secret will be sent to user at next\
> &#x20;login.\
> \
> \*\*Input payload with:\*\*\
> \
> \*\*user\*\*: (admin only) enable two factor authentication for the specified user name\<br>\
> \
> \*-- Endpoint compatible with MaxDB --\*\
> &#x20;      &#x20;

```json
{"openapi":"3.0.3","info":{"title":"Miria REST API","version":"1.0.0"},"servers":[{"url":"/restapi/"}],"security":[{"jwtAuth":[]}],"components":{"securitySchemes":{"jwtAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/auth/setup2fa/enable/":{"post":{"operationId":"authSetup2faEnableCreate","description":"\nEnables two factor authentication for the current user or for another user by an administrator.\nThe secret is sent back only if called by current user. If called by admin, the secret will be sent to user at next\n login.\n\n**Input payload with:**\n\n**user**: (admin only) enable two factor authentication for the specified user name<br>\n\n*-- Endpoint compatible with MaxDB --*\n        ","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"description":""}}},"description":""}}}}}}
```

## POST /auth/setup2fa/new-recover-codes/

> \
> Generate new two factor authentication recover codes for the current user.\
> \
> \*\*Input payload with:\*\*\
> \
> \*\*twoFaCode\*\*: a valid two factor authentication code (TOTP or recover code)\
> \
> \*-- Endpoint compatible with MaxDB --\*\
> &#x20;      &#x20;

```json
{"openapi":"3.0.3","info":{"title":"Miria REST API","version":"1.0.0"},"servers":[{"url":"/restapi/"}],"security":[{"jwtAuth":[]}],"components":{"securitySchemes":{"jwtAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/auth/setup2fa/new-recover-codes/":{"post":{"operationId":"authSetup2faNewRecoverCodesCreate","description":"\nGenerate new two factor authentication recover codes for the current user.\n\n**Input payload with:**\n\n**twoFaCode**: a valid two factor authentication code (TOTP or recover code)\n\n*-- Endpoint compatible with MaxDB --*\n        ","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"description":""}}},"description":""}}}}}}
```

## POST /auth/setup2fa/reset/

> \
> Reset two factor authentication for the current user or for another user by an administrator.\
> \
> \*\*Input payload with:\*\*\
> \
> \*\*twoFaCode\*\*: (current user only) a valid two factor authentication code (TOTP or recover code)\
> \
> \*\*user\*\*: (admin only) disable two factor authentication for the specified user name\<br>\
> \
> \*-- Endpoint compatible with MaxDB --\*\
> &#x20;      &#x20;

```json
{"openapi":"3.0.3","info":{"title":"Miria REST API","version":"1.0.0"},"servers":[{"url":"/restapi/"}],"security":[{"jwtAuth":[]}],"components":{"securitySchemes":{"jwtAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/auth/setup2fa/reset/":{"post":{"operationId":"authSetup2faResetCreate","description":"\nReset two factor authentication for the current user or for another user by an administrator.\n\n**Input payload with:**\n\n**twoFaCode**: (current user only) a valid two factor authentication code (TOTP or recover code)\n\n**user**: (admin only) disable two factor authentication for the specified user name<br>\n\n*-- Endpoint compatible with MaxDB --*\n        ","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"description":""}}},"description":""}}}}}}
```

## POST /auth/token/

> Get authentication token

```json
{"openapi":"3.0.3","info":{"title":"Miria REST API","version":"1.0.0"},"servers":[{"url":"/restapi/"}],"security":[{"jwtAuth":[]}],"components":{"securitySchemes":{"jwtAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/auth/token/":{"post":{"operationId":"authTokenCreate","description":"Get authentication token","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"description":""}}},"description":""}}}}}}
```

## POST /auth/token/refresh/

> get a new freshed access token

```json
{"openapi":"3.0.3","info":{"title":"Miria REST API","version":"1.0.0"},"servers":[{"url":"/restapi/"}],"paths":{"/auth/token/refresh/":{"post":{"operationId":"authTokenRefreshCreate","description":"get a new freshed access token","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"description":""}}},"description":""}}}}}}
```

## POST /auth/token/time/

> Get token time information for requested token type

```json
{"openapi":"3.0.3","info":{"title":"Miria REST API","version":"1.0.0"},"servers":[{"url":"/restapi/"}],"security":[{"jwtAuth":[]}],"components":{"securitySchemes":{"jwtAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/auth/token/time/":{"post":{"operationId":"authTokenTimeCreate","description":"Get token time information for requested token type","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"description":""}}},"description":""}}}}}}
```

## POST /auth/token/verify/

> verify the HMAC validity of the token

```json
{"openapi":"3.0.3","info":{"title":"Miria REST API","version":"1.0.0"},"servers":[{"url":"/restapi/"}],"paths":{"/auth/token/verify/":{"post":{"operationId":"authTokenVerifyCreate","description":"verify the HMAC validity of the token","tags":["auth"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"description":""}}},"description":""}}}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.atempo.com/miria-4.6/reference-documentation/rest-api-reference/auth.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
