> For the complete documentation index, see [llms.txt](https://howto.indexify.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://howto.indexify.finance/indexify-api-documentation/chat.md).

# Chat

## Stack chat messages and creator notes

> Manage community messages and creator notes on a stack's chat. The \`action\` query parameter selects the sub-operation.<br>

```json
{"openapi":"3.0.3","info":{"title":"Indexify API","version":"0.1.12-beta"},"servers":[{"url":"https://api.indexify.finance","description":"Production"}],"security":[{},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-KEY","description":"API key with the `ix_` prefix. You can generate an API Key by navigating to Settings -> API Key in the web app. Pass it in the `X-API-KEY` header on every request."}},"schemas":{"ChatMessage":{"type":"object","properties":{"id":{"type":"integer"},"stack_id":{"type":"integer"},"messages":{"type":"string","description":"Message content."},"message_type":{"type":"string","enum":["community","creator_notes"]},"pinned":{"type":"boolean"},"created_at":{"type":"integer","description":"Unix timestamp."},"user":{"type":"object","properties":{"username":{"type":"string"},"avatar":{"type":"string","nullable":true}}}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}},"paths":{"/api/chat.php":{"post":{"tags":["Chat"],"summary":"Stack chat messages and creator notes","description":"Manage community messages and creator notes on a stack's chat. The `action` query parameter selects the sub-operation.\n","parameters":[{"name":"action","in":"query","required":true,"schema":{"type":"string","enum":["addMessage","getAll","togglePin"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"title":"addMessage","type":"object","required":["stack_id","message"],"properties":{"stack_id":{"type":"integer","description":"Stack whose chat to post to."},"message":{"type":"string","minLength":1,"maxLength":1000,"description":"Message body (1-1000 characters). HTML tags are stripped."},"message_type":{"type":"string","enum":["community","creator_notes"],"default":"community","description":"Message type. `creator_notes` is restricted to the stack creator.\n"},"pinned":{"type":"boolean","default":false,"description":"Pin this message (creator_notes only). Unpins any previously pinned note."}}},{"title":"getAll","type":"object","required":["stack_id"],"properties":{"stack_id":{"type":"integer"},"message_type":{"type":"string","enum":["community","creator_notes"],"default":"community"},"page":{"type":"integer","minimum":1,"default":1},"limit":{"type":"integer","minimum":1,"maximum":100,"default":50}}},{"title":"togglePin","type":"object","required":["message_id"],"properties":{"message_id":{"type":"integer","description":"ID of the creator note to pin or unpin."}}}]}}}},"responses":{"200":{"description":"Successful response. Shape varies by action.","content":{"application/json":{"schema":{"oneOf":[{"title":"AddMessageResponse","type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"object","properties":{"id":{"type":"integer"},"stack_id":{"type":"integer"},"messages":{"type":"string","description":"The message content."},"message_type":{"type":"string","enum":["community","creator_notes"]},"pinned":{"type":"boolean"},"created_at":{"type":"integer","description":"Unix timestamp."},"user":{"type":"object","properties":{"id":{"type":"integer"},"username":{"type":"string"},"avatar":{"type":"string","nullable":true}}}}}}},{"title":"GetAllResponse","type":"object","properties":{"success":{"type":"boolean"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"total_pages":{"type":"integer"},"has_next":{"type":"boolean"},"has_prev":{"type":"boolean"}}},"message_type_supported":{"type":"boolean"},"pinned_notes":{"type":"array","nullable":true,"description":"Only present when message_type is creator_notes. Contains pinned creator notes outside pagination.\n","items":{"$ref":"#/components/schemas/ChatMessage"}}}},{"title":"TogglePinResponse","type":"object","properties":{"success":{"type":"boolean"},"message_id":{"type":"integer"},"pinned":{"type":"boolean"}}}]}}}},"400":{"description":"Validation error (missing fields, message too long/short, etc.).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (not the stack creator for creator_notes / togglePin).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Chat or message not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://howto.indexify.finance/indexify-api-documentation/chat.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
