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

# Auth

## Login

> Processa a solicitação de login e retorna o resultado.

```json
{"openapi":"3.0.3","info":{"title":"API v4 - Fortics SZ4","version":"4.0"},"servers":[{"url":"/api","description":"Base da API"}],"paths":{"/v4/auth/login":{"post":{"tags":["Auth"],"summary":"Login","description":"Processa a solicitação de login e retorna o resultado.","operationId":"postV4AuthLogin","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthLoginRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/AuthLoginSuccess"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/ServerError"}}}}},"components":{"schemas":{"AuthLoginRequest":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","description":"E-mail do usuário."},"password":{"type":"string","description":"Senha do usuário."},"device_token":{"type":"string"},"accept_token_service":{"type":"boolean"},"is_contact_center":{"type":"boolean"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"status":{"type":"boolean"},"code":{"type":"string"}}}},"responses":{"AuthLoginSuccess":{"description":"Login realizado.","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"user":{"type":"object","additionalProperties":true}}}}}},"Unauthorized":{"description":"Não autorizado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"Proibido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServerError":{"description":"Erro interno.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}
```

## Login v2

> Processa a solicitação de login v2 e retorna o resultado.

```json
{"openapi":"3.0.3","info":{"title":"API v4 - Fortics SZ4","version":"4.0"},"servers":[{"url":"/api","description":"Base da API"}],"paths":{"/v4/auth/login-v2":{"post":{"tags":["Auth"],"summary":"Login v2","description":"Processa a solicitação de login v2 e retorna o resultado.","operationId":"postV4AuthLoginV2","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthLoginRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/AuthLoginSuccess"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/ServerError"}}}}},"components":{"schemas":{"AuthLoginRequest":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","description":"E-mail do usuário."},"password":{"type":"string","description":"Senha do usuário."},"device_token":{"type":"string"},"accept_token_service":{"type":"boolean"},"is_contact_center":{"type":"boolean"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"status":{"type":"boolean"},"code":{"type":"string"}}}},"responses":{"AuthLoginSuccess":{"description":"Login realizado.","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"user":{"type":"object","additionalProperties":true}}}}}},"Unauthorized":{"description":"Não autorizado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"Proibido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServerError":{"description":"Erro interno.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}
```

## Logout

> Processa a solicitação de logout e retorna o resultado.

```json
{"openapi":"3.0.3","info":{"title":"API v4 - Fortics SZ4","version":"4.0"},"servers":[{"url":"/api","description":"Base da API"}],"security":[{"JwtAuth":[]}],"components":{"securitySchemes":{"JwtAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Token JWT no header Authorization."}},"responses":{"GenericSuccess":{"description":"Sucesso.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericSuccessResponse"}}}},"BadRequest":{"description":"Requisição inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Não autorizado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServerError":{"description":"Erro interno.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"GenericSuccessResponse":{"type":"object","additionalProperties":true},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"status":{"type":"boolean"},"code":{"type":"string"}}}}},"paths":{"/v4/auth/logout":{"get":{"tags":["Auth"],"summary":"Logout","description":"Processa a solicitação de logout e retorna o resultado.","operationId":"getV4AuthLogout","parameters":[{"in":"query","name":"type","schema":{"type":"string","enum":["api"]},"description":"Tipo de autenticação.","required":false}],"responses":{"200":{"$ref":"#/components/responses/GenericSuccess"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## Atualizar token

> Atualiza token conforme os dados enviados.

```json
{"openapi":"3.0.3","info":{"title":"API v4 - Fortics SZ4","version":"4.0"},"servers":[{"url":"/api","description":"Base da API"}],"security":[{"JwtAuth":[]}],"components":{"securitySchemes":{"JwtAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Token JWT no header Authorization."}},"responses":{"Unauthorized":{"description":"Não autorizado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServerError":{"description":"Erro interno.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"status":{"type":"boolean"},"code":{"type":"string"}}}}},"paths":{"/v4/auth/refresh":{"get":{"tags":["Auth"],"summary":"Atualizar token","description":"Atualiza token conforme os dados enviados.","operationId":"getV4AuthRefresh","responses":{"200":{"description":"Token renovado.","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## Obter usuário autenticado

> Recupera usuário autenticado.

```json
{"openapi":"3.0.3","info":{"title":"API v4 - Fortics SZ4","version":"4.0"},"servers":[{"url":"/api","description":"Base da API"}],"security":[{"JwtAuth":[]}],"components":{"securitySchemes":{"JwtAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Token JWT no header Authorization."}},"schemas":{"AuthMeResponse":{"type":"object","properties":{"_id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"session_agent":{"type":"object","nullable":true},"keep_alive":{"type":"integer"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"status":{"type":"boolean"},"code":{"type":"string"}}}},"responses":{"Unauthorized":{"description":"Não autorizado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/v4/auth/me":{"get":{"tags":["Auth"],"summary":"Obter usuário autenticado","description":"Recupera usuário autenticado.","operationId":"getV4AuthMe","responses":{"200":{"description":"Dados do usuário atual.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthMeResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```

## Listar IDPs remotos

> Retorna iDPs remotos conforme filtros enviados.

```json
{"openapi":"3.0.3","info":{"title":"API v4 - Fortics SZ4","version":"4.0"},"servers":[{"url":"/api","description":"Base da API"}],"paths":{"/v4/remote-auth-idps":{"get":{"tags":["Auth"],"summary":"Listar IDPs remotos","description":"Retorna iDPs remotos conforme filtros enviados.","operationId":"getV4RemoteAuthIdps","responses":{"200":{"$ref":"#/components/responses/GenericSuccess"}}}}},"components":{"responses":{"GenericSuccess":{"description":"Sucesso.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericSuccessResponse"}}}}},"schemas":{"GenericSuccessResponse":{"type":"object","additionalProperties":true}}}}
```

## Desbloquear por confiança

> Libera por confiança após validação dos dados enviados.

```json
{"openapi":"3.0.3","info":{"title":"API v4 - Fortics SZ4","version":"4.0"},"servers":[{"url":"/api","description":"Base da API"}],"paths":{"/v4/unlock_for_trust":{"post":{"tags":["Auth"],"summary":"Desbloquear por confiança","description":"Libera por confiança após validação dos dados enviados.","operationId":"postV4UnlockForTrust","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"$ref":"#/components/responses/GenericSuccess"}}}}},"components":{"responses":{"GenericSuccess":{"description":"Sucesso.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericSuccessResponse"}}}}},"schemas":{"GenericSuccessResponse":{"type":"object","additionalProperties":true}}}}
```


---

# 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.fortics.com.br/chat-center-api-reference/reference/auth.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.
