# Conversations

## GET /conversations

> Get conversations for the logged-in user

```json
{"openapi":"3.0.0","info":{"title":"JSMON API","version":"1.0.0"},"servers":[{"url":"https://api-dev.jsmon.sh","description":"Development Server (For internal testing)"},{"url":"https://api.jsmon.sh","description":"Production Server (Stable release)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{}},"paths":{"/conversations":{"get":{"summary":"Get conversations for the logged-in user","tags":["Conversations"],"parameters":[{"in":"query","name":"wkspId","schema":{"type":"string"},"required":true,"description":"Workspace ID to filter conversations"}],"responses":{"200":{"description":"Conversations retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"conversationName":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastUpdated":{"type":"string","format":{}}}}}}}}}},"401":{"description":"Unauthorized - Missing or invalid token"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}}}}}}
```

## GET /conversations/{conversationId}

> Get Q\&A data for a specific conversation by ID

```json
{"openapi":"3.0.0","info":{"title":"JSMON API","version":"1.0.0"},"servers":[{"url":"https://api-dev.jsmon.sh","description":"Development Server (For internal testing)"},{"url":"https://api.jsmon.sh","description":"Production Server (Stable release)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{}},"paths":{"/conversations/{conversationId}":{"get":{"summary":"Get Q&A data for a specific conversation by ID","tags":["Conversations"],"parameters":[{"in":"path","name":"conversationId","required":true,"schema":{"type":"string"},"description":"ID of the conversation to retrieve"},{"in":"query","name":"wkspId","required":true,"schema":{"type":"string"},"description":"Workspace ID to filter data"}],"responses":{"200":{"description":"Conversation retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string"},"answer":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastUpdated":{"type":"string","format":"date-time"}}}}}}}}},"400":{"description":"Missing conversation ID","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}}}}}}
```

## DELETE /conversations/{conversationId}

> Delete a conversation and its related Q\&A by conversationId

```json
{"openapi":"3.0.0","info":{"title":"JSMON API","version":"1.0.0"},"servers":[{"url":"https://api-dev.jsmon.sh","description":"Development Server (For internal testing)"},{"url":"https://api.jsmon.sh","description":"Production Server (Stable release)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{}},"paths":{"/conversations/{conversationId}":{"delete":{"summary":"Delete a conversation and its related Q&A by conversationId","tags":["Conversations"],"parameters":[{"in":"path","name":"conversationId","required":true,"schema":{"type":"string"},"description":"The ID of the conversation to delete"},{"in":"query","name":"wkspId","required":true,"schema":{"type":"string"},"description":"Workspace ID associated with the conversation"}],"responses":{"200":{"description":"Conversation deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"400":{"description":"Missing conversation ID","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"401":{"description":"Unauthorized - JWT token missing or invalid"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}}}}}}
```

## PATCH /conversations/edit-name

> Edit the name of a conversation by conversationId

```json
{"openapi":"3.0.0","info":{"title":"JSMON API","version":"1.0.0"},"servers":[{"url":"https://api-dev.jsmon.sh","description":"Development Server (For internal testing)"},{"url":"https://api.jsmon.sh","description":"Production Server (Stable release)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{}},"paths":{"/conversations/edit-name":{"patch":{"summary":"Edit the name of a conversation by conversationId","tags":["Conversations"],"parameters":[{"in":"query","name":"wkspId","required":true,"schema":{"type":"string"},"description":"Workspace ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["conversationId","updatedName"],"properties":{"conversationId":{"type":"string"},"updatedName":{"type":"string"}}}}}},"responses":{"200":{"description":"Name updated or already same","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"400":{"description":"Missing required fields","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"}}}}}}}}}}}
```


---

# 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://knowledge.jsmon.sh/api-reference/reference/conversations.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.
