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

# Messages

## Enviar mensagem (GET)

> Observação: Endpoint com efeito colateral via GET.

```json
{"openapi":"3.0.3","info":{"title":"API v4 - Fortics SZ4","version":"4.0"},"servers":[{"url":"/api","description":"Base da API"}],"security":[{"ApiTokenQuery":[]}],"components":{"securitySchemes":{"ApiTokenQuery":{"type":"apiKey","in":"query","name":"token","description":"Token simples enviado por query."}},"responses":{"MessageSendSuccess":{"description":"Mensagem enviada.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"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"}}}}},"schemas":{"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"}}}}}}},"paths":{"/v4/message/send":{"get":{"tags":["Messages"],"summary":"Enviar mensagem (GET)","description":"Observação: Endpoint com efeito colateral via GET.","operationId":"getV4MessageSend","parameters":[{"in":"query","name":"token","required":true,"schema":{"type":"string"},"description":"Token de autenticação."},{"in":"query","name":"platform_id","required":true,"schema":{"type":"string"}},{"in":"query","name":"channel_id","required":true,"schema":{"type":"string"}},{"in":"query","name":"type","required":true,"schema":{"type":"string","enum":["text","media"]}},{"in":"query","name":"message","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/MessageSendSuccess"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationError"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## Enviar mensagem

> Envia mensagem 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":{"SendMessageRequest":{"type":"object","required":["platform_id","channel_id","type"],"properties":{"contact_name":{"type":"string"},"platform_id":{"type":"string"},"channel_id":{"type":"string"},"agent_id":{"type":"string"},"type":{"type":"string","enum":["text","media"]},"message":{"type":"string"},"file":{"type":"string"},"legend":{"type":"string"},"close_session":{"type":"integer","enum":[0,1,2,3]},"agent":{"type":"string","format":"email"},"attendance_id":{"type":"string"},"is_hsm":{"type":"boolean"},"hsm_template_name":{"type":"string"},"hsm_placeholders":{"type":"array","items":{"type":"string"}},"contact_variables":{"type":"object","additionalProperties":true},"gateway":{"type":"string"},"start_conversation":{"type":"boolean"},"subject":{"type":"string"},"session_data":{"type":"object","additionalProperties":true},"user_data":{"type":"object","additionalProperties":true},"contact_data":{"type":"object","additionalProperties":true},"context_id":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"preview":{"type":"string"}}}}}},"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":{"MessageSendSuccess":{"description":"Mensagem enviada.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"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/message/send":{"post":{"tags":["Messages"],"summary":"Enviar mensagem","description":"Envia mensagem com os dados informados.","operationId":"postV4MessageSend","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/MessageSendSuccess"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationError"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## Enviar mensagem (GET) - send\_plus

> Observação: Endpoint com efeito colateral via GET.

```json
{"openapi":"3.0.3","info":{"title":"API v4 - Fortics SZ4","version":"4.0"},"servers":[{"url":"/api","description":"Base da API"}],"security":[{"ApiTokenQuery":[]}],"components":{"securitySchemes":{"ApiTokenQuery":{"type":"apiKey","in":"query","name":"token","description":"Token simples enviado por query."}},"responses":{"MessageSendSuccess":{"description":"Mensagem enviada.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"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"}}}}},"schemas":{"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"}}}}}}},"paths":{"/v4/message/send_plus":{"get":{"tags":["Messages"],"summary":"Enviar mensagem (GET) - send_plus","description":"Observação: Endpoint com efeito colateral via GET.","operationId":"getV4MessageSendPlus","parameters":[{"in":"query","name":"token","required":true,"schema":{"type":"string"},"description":"Token de autenticação."}],"responses":{"200":{"$ref":"#/components/responses/MessageSendSuccess"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationError"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## Enviar mensagem (send\_plus)

> Envia mensagem 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":{"SendMessageRequest":{"type":"object","required":["platform_id","channel_id","type"],"properties":{"contact_name":{"type":"string"},"platform_id":{"type":"string"},"channel_id":{"type":"string"},"agent_id":{"type":"string"},"type":{"type":"string","enum":["text","media"]},"message":{"type":"string"},"file":{"type":"string"},"legend":{"type":"string"},"close_session":{"type":"integer","enum":[0,1,2,3]},"agent":{"type":"string","format":"email"},"attendance_id":{"type":"string"},"is_hsm":{"type":"boolean"},"hsm_template_name":{"type":"string"},"hsm_placeholders":{"type":"array","items":{"type":"string"}},"contact_variables":{"type":"object","additionalProperties":true},"gateway":{"type":"string"},"start_conversation":{"type":"boolean"},"subject":{"type":"string"},"session_data":{"type":"object","additionalProperties":true},"user_data":{"type":"object","additionalProperties":true},"contact_data":{"type":"object","additionalProperties":true},"context_id":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"preview":{"type":"string"}}}}}},"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":{"MessageSendSuccess":{"description":"Mensagem enviada.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"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/message/send_plus":{"post":{"tags":["Messages"],"summary":"Enviar mensagem (send_plus)","description":"Envia mensagem com os dados informados.","operationId":"postV4MessageSendPlus","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/MessageSendSuccess"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationError"},"500":{"$ref":"#/components/responses/ServerError"}}}}}}
```

## Marcar mensagens como lidas

> Marca mensagens como lidas conforme os parâmetros 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":{"MessageReadRequest":{"type":"object","required":["platform_id","channel_id"],"properties":{"platform_id":{"type":"string"},"channel_id":{"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"}}}},"NotFound":{"description":"Não encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ValidationError":{"description":"Erro de validação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}}},"paths":{"/v4/message/read":{"post":{"tags":["Messages"],"summary":"Marcar mensagens como lidas","description":"Marca mensagens como lidas conforme os parâmetros informados.","operationId":"postV4MessageRead","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageReadRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/GenericSuccess"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"}}}}}}
```

## Obter quantidade de mensagens pendentes

> Recupera quantidade de mensagens pendentes.

```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":{"MessageReadRequest":{"type":"object","required":["platform_id","channel_id"],"properties":{"platform_id":{"type":"string"},"channel_id":{"type":"string"}}},"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":{"NotFound":{"description":"Não encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ValidationError":{"description":"Erro de validação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}}},"paths":{"/v4/message/pending":{"post":{"tags":["Messages"],"summary":"Obter quantidade de mensagens pendentes","description":"Recupera quantidade de mensagens pendentes.","operationId":"postV4MessagePending","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageReadRequest"}}}},"responses":{"200":{"description":"Contagem de pendentes.","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"}}}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"}}}}}}
```

## Substituir variáveis de mensagem

> Processa a solicitação de substituir variáveis de mensagem 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":{"NotFound":{"description":"Não encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ValidationError":{"description":"Erro de validação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"schemas":{"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"}}}}}}},"paths":{"/v4/message/replace_vars":{"post":{"tags":["Messages"],"summary":"Substituir variáveis de mensagem","description":"Processa a solicitação de substituir variáveis de mensagem e retorna o resultado.","operationId":"postV4MessageReplaceVars","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"session_id":{"type":"string"}},"required":["message","session_id"]}}}},"responses":{"200":{"description":"Mensagem com variáveis substituídas.","content":{"application/json":{"schema":{"type":"string"}}}},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationError"}}}}}}
```

## Criar anotação de mensagem

> Cria anotação de mensagem com 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."}},"schemas":{"AnnotationMessageRequest":{"type":"object","required":["annotation"],"properties":{"annotation":{"type":"string","maxLength":255}}},"GenericSuccessResponse":{"type":"object","additionalProperties":true},"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"}}}},"ValidationError":{"description":"Erro de validação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}}},"paths":{"/v4/message/{messageId}/annotation":{"post":{"tags":["Messages"],"summary":"Criar anotação de mensagem","description":"Cria anotação de mensagem com os dados enviados.","operationId":"postV4MessageAnnotation","parameters":[{"in":"path","name":"messageId","required":true,"schema":{"type":"string"},"description":"Identificador da mensagem."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnotationMessageRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/GenericSuccess"},"422":{"$ref":"#/components/responses/ValidationError"}}}}}}
```

## Remover anotação de mensagem

> Remove anotação de mensagem identificado no caminho.

```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"}}}},"NotFound":{"description":"Não encontrado.","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/message/{messageId}/annotation":{"delete":{"tags":["Messages"],"summary":"Remover anotação de mensagem","description":"Remove anotação de mensagem identificado no caminho.","operationId":"deleteV4MessageAnnotation","parameters":[{"in":"path","name":"messageId","required":true,"schema":{"type":"string"},"description":"Identificador da mensagem."}],"responses":{"200":{"$ref":"#/components/responses/GenericSuccess"},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
```

## Listar mensagens predefinidas

> Retorna mensagens predefinidas conforme filtros 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":{"GenericSuccess":{"description":"Sucesso.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericSuccessResponse"}}}}},"schemas":{"GenericSuccessResponse":{"type":"object","additionalProperties":true}}},"paths":{"/v4/predefined_messages":{"get":{"tags":["Messages"],"summary":"Listar mensagens predefinidas","description":"Retorna mensagens predefinidas conforme filtros enviados.","operationId":"getV4PredefinedMessages","responses":{"200":{"$ref":"#/components/responses/GenericSuccess"}}}}}}
```

## Criar mensagem predefinida

> Cria mensagem predefinida com 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."}},"schemas":{"PredefinedMessagesRequest":{"type":"object","required":["message","description"],"properties":{"message":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}}}},"description":{"type":"string"}}},"GenericSuccessResponse":{"type":"object","additionalProperties":true}},"responses":{"GenericSuccess":{"description":"Sucesso.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericSuccessResponse"}}}}}},"paths":{"/v4/predefined_messages":{"post":{"tags":["Messages"],"summary":"Criar mensagem predefinida","description":"Cria mensagem predefinida com os dados enviados.","operationId":"postV4PredefinedMessages","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredefinedMessagesRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/GenericSuccess"}}}}}}
```

## Detalhar mensagem predefinida

> Recupera os dados de mensagem predefinida identificado no caminho.

```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"}}}}},"schemas":{"GenericSuccessResponse":{"type":"object","additionalProperties":true}}},"paths":{"/v4/predefined_messages/{id}":{"get":{"tags":["Messages"],"summary":"Detalhar mensagem predefinida","description":"Recupera os dados de mensagem predefinida identificado no caminho.","operationId":"getV4PredefinedMessagesById","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/GenericSuccess"}}}}}}
```

## Atualizar mensagem predefinida

> Atualiza mensagem predefinida 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."}},"schemas":{"PredefinedMessagesRequest":{"type":"object","required":["message","description"],"properties":{"message":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}}}},"description":{"type":"string"}}},"GenericSuccessResponse":{"type":"object","additionalProperties":true}},"responses":{"GenericSuccess":{"description":"Sucesso.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericSuccessResponse"}}}}}},"paths":{"/v4/predefined_messages/{id}":{"put":{"tags":["Messages"],"summary":"Atualizar mensagem predefinida","description":"Atualiza mensagem predefinida conforme os dados enviados.","operationId":"putV4PredefinedMessagesById","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredefinedMessagesRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/GenericSuccess"}}}}}}
```

## Remover mensagem predefinida

> Remove mensagem predefinida identificado no caminho.

```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":{"NotFound":{"description":"Não encontrado.","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/predefined_messages/{id}":{"delete":{"tags":["Messages"],"summary":"Remover mensagem predefinida","description":"Remove mensagem predefinida identificado no caminho.","operationId":"deleteV4PredefinedMessagesById","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Removido."},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
```

## Buscar por campanhas

> Pesquisa por campanhas conforme critérios 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."}},"schemas":{"FindPredefinedMessagesByCampaignsRequest":{"type":"object","required":["campaigns"],"properties":{"campaigns":{"type":"array","minItems":1,"items":{"type":"string"}},"order_by":{"type":"string","enum":["description","_id"]}}},"GenericSuccessResponse":{"type":"object","additionalProperties":true}},"responses":{"GenericSuccess":{"description":"Sucesso.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericSuccessResponse"}}}}}},"paths":{"/v4/predefined_messages/by_campaigns":{"post":{"tags":["Messages"],"summary":"Buscar por campanhas","description":"Pesquisa por campanhas conforme critérios enviados.","operationId":"postV4PredefinedMessagesByCampaigns","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindPredefinedMessagesByCampaignsRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/GenericSuccess"}}}}}}
```

## Enviar mensagem em canal genérico

> Envia mensagem em canal genérico 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"}],"paths":{"/v4/generic/messages/send":{"post":{"tags":["Messages"],"summary":"Enviar mensagem em canal genérico","description":"Envia mensagem em canal genérico com os dados informados.","operationId":"postV4GenericMessagesSend","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"$ref":"#/components/responses/MessageSendSuccess"},"422":{"$ref":"#/components/responses/ValidationError"}}}}},"components":{"responses":{"MessageSendSuccess":{"description":"Mensagem enviada.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"ValidationError":{"description":"Erro de validação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"schemas":{"ValidationErrorResponse":{"type":"object","properties":{"status":{"type":"boolean"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}}}
```


---

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