# Message

## Create message.

> Use this endpoint to create message.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Message"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CreateMessageViewModel":{"required":["prompt"],"type":"object","properties":{"prompt":{"type":"string","description":"User prompt text to send to the conversation."},"codeInterpreter":{"type":"boolean","description":"Enables code interpreter tooling for this request when true.","nullable":true},"webSearch":{"type":"boolean","description":"Enables web search augmentation for this request when true.","nullable":true},"reasoning":{"$ref":"#/components/schemas/NullableOfReasoningEffort2"},"vectorStoreId":{"type":"string","description":"Optional vector store identifier used for retrieval-augmented context.","format":"uuid","nullable":true},"mediaIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Optional media identifiers to attach to the message.","nullable":true},"toolIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Optional tool identifiers available during message processing.","nullable":true}},"description":"Represents the payload used to create a new user message in a conversation."},"NullableOfReasoningEffort2":{"type":"integer","description":"Requested reasoning effort for model processing.","nullable":true}}},"paths":{"/v1/Message/Create/{conversationId}":{"post":{"tags":["Message"],"summary":"Create message.","description":"Use this endpoint to create message.","parameters":[{"name":"conversationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMessageViewModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/CreateMessageViewModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CreateMessageViewModel"}}},"required":true},"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Update message.

> Use this endpoint to update message.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Message"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UpdateMessageViewModel":{"required":["prompt"],"type":"object","properties":{"prompt":{"type":"string","description":"Updated prompt text that replaces the original user request."},"codeInterpreter":{"type":"boolean","description":"Enables code interpreter tooling for the regenerated response when true.","nullable":true},"webSearch":{"type":"boolean","description":"Enables web search augmentation for the regenerated response when true.","nullable":true},"reasoning":{"$ref":"#/components/schemas/NullableOfReasoningEffort2"},"vectorStoreId":{"type":"string","description":"Optional vector store identifier used for retrieval-augmented context.","format":"uuid","nullable":true},"mediaIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Optional media identifiers to attach to the regenerated message.","nullable":true},"toolIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Optional tool identifiers available during regeneration.","nullable":true}},"description":"Represents the payload used to regenerate a message from an updated prompt."},"NullableOfReasoningEffort2":{"type":"integer","description":"Requested reasoning effort for model processing.","nullable":true}}},"paths":{"/v1/Message/Update/{messageId}":{"post":{"tags":["Message"],"summary":"Update message.","description":"Use this endpoint to update message.","parameters":[{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMessageViewModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateMessageViewModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpdateMessageViewModel"}}},"required":true},"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Delete message.

> Use this endpoint to delete message.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Message"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Message/Delete/{conversationId}/{messageId}":{"delete":{"tags":["Message"],"summary":"Delete message.","description":"Use this endpoint to delete message.","parameters":[{"name":"conversationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Converts a message to speech and returns a WAV file.

> Validates conversation ownership, converts markdown to plain text, registers text-to-speech usage, and synthesizes audio with Azure Speech.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Message"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Message/Speak/{messageId}":{"get":{"tags":["Message"],"summary":"Converts a message to speech and returns a WAV file.","description":"Validates conversation ownership, converts markdown to plain text, registers text-to-speech usage, and synthesizes audio with Azure Speech.","parameters":[{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Executes a one-off prompt and returns generated content.

> Runs a chat completion using the resolved model configuration, intended for direct prompt execution outside a persisted conversation stream.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Message"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"ExecuteMessageViewModel":{"required":["systemMessage","prompt"],"type":"object","properties":{"systemMessage":{"type":"string","description":"System instruction that defines assistant behavior for this execution."},"prompt":{"type":"string","description":"User prompt to execute."}},"description":"Represents the payload for executing a single standalone prompt."}}},"paths":{"/v1/Message/Execute":{"post":{"tags":["Message"],"summary":"Executes a one-off prompt and returns generated content.","description":"Runs a chat completion using the resolved model configuration, intended for direct prompt execution outside a persisted conversation stream.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteMessageViewModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/ExecuteMessageViewModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/ExecuteMessageViewModel"}}},"required":true},"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Generates a document file from a message using an optional template.

> Validates access to the message, creates a generated filename, renders a document from message text, stores it as media, and returns media metadata.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Message"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Message/GenerateDocument/{messageId}/{documentTemplateId}":{"get":{"tags":["Message"],"summary":"Generates a document file from a message using an optional template.","description":"Validates access to the message, creates a generated filename, renders a document from message text, stores it as media, and returns media metadata.","parameters":[{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"documentTemplateId","in":"path","required":true,"schema":{"type":"string","format":"uuid","default":null}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Placeholder endpoint for downloading a file from a message context.

> This action is currently a stub and does not yet perform file retrieval.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Message"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Message/DownloadFile/{messageId}":{"get":{"tags":["Message"],"summary":"Placeholder endpoint for downloading a file from a message context.","description":"This action is currently a stub and does not yet perform file retrieval.","parameters":[{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"sandboxPath","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```


---

# Agent Instructions: 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:

```
GET https://docs.safegpt.nl/api-nl/endpoints/message.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
