> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/omnitron-openapis/auth-totp.md).

# Auth TOTP

## Verify TOTP

> Verify TOTP code and complete the login process. This endpoint is used after initial login when TOTP is required.

```json
{"openapi":"3.0.3","info":{"title":"Omnitron API","version":"1.0.0"},"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"TOTPVerify":{"type":"object","required":["temp_token","token"],"properties":{"temp_token":{"type":"string","description":"Temporary token received from initial login"},"token":{"type":"string","description":"TOTP verification code"}}},"TOTPVerifyResponse":{"type":"object","properties":{"key":{"type":"string","description":"Login token"}}}},"responses":{"400":{"description":"Required field(s) are missing, data is invalid, or the action is not allowed.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"field":{"oneOf":[{"type":"array","description":"Indicates that no value was provided for the {field} field in the request.","items":{"type":"string"}},{"type":"array","description":"Indicates usage of a non-existent object for {field} in the request.","items":{"type":"string"}}]},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"non_field_errors":{"description":"Indicates invalid data or action usage in the request.","type":"array","items":{"type":"string"}},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"detail":{"description":"Provides a detailed message for the given error.","type":"string"},"code":{"type":"string","description":"Represents the server-side error code."}}}]}}}},"401":{"description":"Unauthorized Access","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string","description":"Contains a detailed description of the error."},"code":{"type":"string","description":"Represents the server-side error code."}}}}}},"403":{"description":"Forbidden"}}},"paths":{"/api/v1/auth/totp/verify/":{"post":{"summary":"Verify TOTP","description":"Verify TOTP code and complete the login process. This endpoint is used after initial login when TOTP is required.","tags":["AuthTOTP"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TOTPVerify"}}}},"responses":{"200":{"description":"The TOTP verification was successful and login is completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TOTPVerifyResponse"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"}}}}}}
```

## Setup TOTP

> Setup TOTP authentication.

```json
{"openapi":"3.0.3","info":{"title":"Omnitron API","version":"1.0.0"},"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"TOTPSetup":{"type":"object","properties":{"secret_key":{"type":"string","description":"TOTP secret key"},"provisioning_uri":{"type":"string","description":"TOTP provisioning URI"}}}},"responses":{"400":{"description":"Required field(s) are missing, data is invalid, or the action is not allowed.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"field":{"oneOf":[{"type":"array","description":"Indicates that no value was provided for the {field} field in the request.","items":{"type":"string"}},{"type":"array","description":"Indicates usage of a non-existent object for {field} in the request.","items":{"type":"string"}}]},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"non_field_errors":{"description":"Indicates invalid data or action usage in the request.","type":"array","items":{"type":"string"}},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"detail":{"description":"Provides a detailed message for the given error.","type":"string"},"code":{"type":"string","description":"Represents the server-side error code."}}}]}}}},"403":{"description":"Forbidden"}}},"paths":{"/api/v1/auth/totp/setup/":{"post":{"summary":"Setup TOTP","description":"Setup TOTP authentication.","tags":["AuthTOTP"],"responses":{"201":{"description":"The TOTP setup was successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TOTPSetup"}}}},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"}}}}}}
```

## Activate TOTP

> Activate TOTP authentication by verifying the TOTP code.

```json
{"openapi":"3.0.3","info":{"title":"Omnitron API","version":"1.0.0"},"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"TOTPActivate":{"type":"object","required":["token"],"properties":{"token":{"type":"string","description":"TOTP verification code"}}},"TOTPActivateResponse":{"type":"object","properties":{"recovery_codes":{"type":"array","description":"Recovery codes","items":{"type":"string"}}}}},"responses":{"400":{"description":"Required field(s) are missing, data is invalid, or the action is not allowed.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"field":{"oneOf":[{"type":"array","description":"Indicates that no value was provided for the {field} field in the request.","items":{"type":"string"}},{"type":"array","description":"Indicates usage of a non-existent object for {field} in the request.","items":{"type":"string"}}]},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"non_field_errors":{"description":"Indicates invalid data or action usage in the request.","type":"array","items":{"type":"string"}},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"detail":{"description":"Provides a detailed message for the given error.","type":"string"},"code":{"type":"string","description":"Represents the server-side error code."}}}]}}}},"403":{"description":"Forbidden"}}},"paths":{"/api/v1/auth/totp/activate/":{"post":{"summary":"Activate TOTP","description":"Activate TOTP authentication by verifying the TOTP code.","tags":["AuthTOTP"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TOTPActivate"}}}},"responses":{"200":{"description":"The TOTP activation was successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TOTPActivateResponse"}}}},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"}}}}}}
```

## Deactivate TOTP

> Deactivate TOTP authentication for the current user.

```json
{"openapi":"3.0.3","info":{"title":"Omnitron API","version":"1.0.0"},"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"apiKey","in":"header","name":"Authorization"}},"responses":{"400":{"description":"Required field(s) are missing, data is invalid, or the action is not allowed.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"field":{"oneOf":[{"type":"array","description":"Indicates that no value was provided for the {field} field in the request.","items":{"type":"string"}},{"type":"array","description":"Indicates usage of a non-existent object for {field} in the request.","items":{"type":"string"}}]},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"non_field_errors":{"description":"Indicates invalid data or action usage in the request.","type":"array","items":{"type":"string"}},"code":{"type":"string","description":"Represents the server-side error code."}}},{"type":"object","properties":{"detail":{"description":"Provides a detailed message for the given error.","type":"string"},"code":{"type":"string","description":"Represents the server-side error code."}}}]}}}},"403":{"description":"Forbidden"}}},"paths":{"/api/v1/auth/totp/deactivate/":{"post":{"summary":"Deactivate TOTP","description":"Deactivate TOTP authentication for the current user.","tags":["AuthTOTP"],"responses":{"200":{"description":"The TOTP deactivation was successful."},"400":{"$ref":"#/components/responses/400"},"403":{"$ref":"#/components/responses/403"}}}}}}
```


---

# 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://apidocs.akinon.com/omnitron-openapis/auth-totp.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.
