> 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/session.md).

# Session

## Iniciar sessão

> Inicia sessão com os dados informados.

```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":{"SessionInitRequest":{"type":"object","required":["contact_id","platform","channel_id","attendance","agent_id","agent_name"],"properties":{"contact_id":{"type":"string"},"platform":{"type":"string"},"channel_id":{"type":"string"},"attendance":{"type":"string"},"agent_id":{"type":"string"},"agent_name":{"type":"string"}}},"GenericSuccessResponse":{"type":"object","additionalProperties":true},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"status":{"type":"boolean"},"code":{"type":"string"}}},"ValidationErrorResponse":{"type":"object","properties":{"status":{"type":"boolean"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"GenericSuccess":{"description":"Sucesso.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericSuccessResponse"}}}},"Unauthorized":{"description":"Não autorizado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ValidationError":{"description":"Erro de validação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"ServerError":{"description":"Erro interno.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/v4/session/initSession":{"post":{"tags":["Session"],"summary":"Iniciar sessão","description":"Inicia sessão com os dados informados.","operationId":"postV4SessionInitSession","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionInitRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/GenericSuccess"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationError"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## Próximo atendimento

> Processa a solicitação de próximo atendimento 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"}}}},"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/session/nextAttendance":{"post":{"tags":["Session"],"summary":"Próximo atendimento","description":"Processa a solicitação de próximo atendimento e retorna o resultado.","operationId":"postV4SessionNextAttendance","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"$ref":"#/components/responses/GenericSuccess"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## Verificar sessão

> Verifica sessão e retorna o estado atual.

```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"}}}},"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/session/check":{"post":{"tags":["Session"],"summary":"Verificar sessão","description":"Verifica sessão e retorna o estado atual.","operationId":"postV4SessionCheck","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"$ref":"#/components/responses/GenericSuccess"},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```


---

# 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/session.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.
