# Comments

> For AI agents: the index of these docs is at https://indrava.forumulate.com/docs/llms.txt (every page it lists has a Markdown version like this one).

## List a post's comments

**`GET http://localhost:4000/api/v1/posts/{postId}/comments`** — List a post's comments

Oldest first. A reply has `parentId`; a comment on a passage has `quote`, and a suggested edit also `suggestion` with its `suggestionState`. `mentions` are Atlas user ids.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `postId` | path | string | yes |  |

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X GET "http://localhost:4000/api/v1/posts/{postId}/comments" \
  -H "Authorization: Bearer $API_KEY"
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/posts/{postId}/comments', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer $API_KEY',
  },
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "GET",
    "http://localhost:4000/api/v1/posts/{postId}/comments",
    headers={
    "Authorization": "Bearer $API_KEY",
    },
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "http://localhost:4000/api/v1/posts/{postId}/comments", nil)
	req.Header.Set("Authorization", "Bearer $API_KEY")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/posts/{postId}/comments');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/posts/{postId}/comments')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/posts/{postId}/comments"))
    .header("Authorization", "Bearer $API_KEY")
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Comment on a post, or on a passage of it, or suggest an edit

**`POST http://localhost:4000/api/v1/posts/{postId}/comments`** — Comment on a post, or on a passage of it, or suggest an edit

With `quote` the comment is about that passage; with `suggestion` as well it proposes replacing the passage with that text (accept it with `POST /posts/comments/{id}/suggestion`). `mentionIds` tells those teammates.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `postId` | path | string | yes |  |

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `body` | string | yes |  |
| `parentId` | string | no |  |
| `quote` | string | no |  |
| `suggestion` | string | no |  |
| `mentionIds` | string[] | no |  |
| `internal` | boolean | no | Default: `true`. |

```json
{
  "body": "string",
  "parentId": "string",
  "quote": "string",
  "suggestion": "string",
  "mentionIds": [
    "string"
  ],
  "internal": true
}
```

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X POST "http://localhost:4000/api/v1/posts/{postId}/comments" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"body":"string","parentId":"string","quote":"string","suggestion":"string","mentionIds":["string"],"internal":true}'
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/posts/{postId}/comments', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"body":"string","parentId":"string","quote":"string","suggestion":"string","mentionIds":["string"],"internal":true}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "POST",
    "http://localhost:4000/api/v1/posts/{postId}/comments",
    headers={
    "Authorization": "Bearer $API_KEY",
    "Content-Type": "application/json",
    },
    json={"body": "string", "parentId": "string", "quote": "string", "suggestion": "string", "mentionIds": ["string"], "internal": True},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("POST", "http://localhost:4000/api/v1/posts/{postId}/comments", strings.NewReader(`{"body":"string","parentId":"string","quote":"string","suggestion":"string","mentionIds":["string"],"internal":true}`))
	req.Header.Set("Authorization", "Bearer $API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/posts/{postId}/comments');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"body":"string","parentId":"string","quote":"string","suggestion":"string","mentionIds":["string"],"internal":true}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/posts/{postId}/comments')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
req['Content-Type'] = 'application/json'
req.body = '{"body":"string","parentId":"string","quote":"string","suggestion":"string","mentionIds":["string"],"internal":true}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/posts/{postId}/comments"))
    .header("Authorization", "Bearer $API_KEY")
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"body\":\"string\",\"parentId\":\"string\",\"quote\":\"string\",\"suggestion\":\"string\",\"mentionIds\":[\"string\"],\"internal\":true}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Reply to a comment

**`POST http://localhost:4000/api/v1/posts/comments/{id}/replies`** — Reply to a comment

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `body` | string | yes |  |
| `mentionIds` | string[] | no |  |
| `internal` | boolean | no | Default: `true`. |

```json
{
  "body": "string",
  "mentionIds": [
    "string"
  ],
  "internal": true
}
```

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X POST "http://localhost:4000/api/v1/posts/comments/{id}/replies" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"body":"string","mentionIds":["string"],"internal":true}'
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/posts/comments/{id}/replies', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"body":"string","mentionIds":["string"],"internal":true}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "POST",
    "http://localhost:4000/api/v1/posts/comments/{id}/replies",
    headers={
    "Authorization": "Bearer $API_KEY",
    "Content-Type": "application/json",
    },
    json={"body": "string", "mentionIds": ["string"], "internal": True},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("POST", "http://localhost:4000/api/v1/posts/comments/{id}/replies", strings.NewReader(`{"body":"string","mentionIds":["string"],"internal":true}`))
	req.Header.Set("Authorization", "Bearer $API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/posts/comments/{id}/replies');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"body":"string","mentionIds":["string"],"internal":true}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/posts/comments/{id}/replies')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
req['Content-Type'] = 'application/json'
req.body = '{"body":"string","mentionIds":["string"],"internal":true}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/posts/comments/{id}/replies"))
    .header("Authorization", "Bearer $API_KEY")
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"body\":\"string\",\"mentionIds\":[\"string\"],\"internal\":true}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Delete your own comment (or any, for those who manage the workspace)

**`DELETE http://localhost:4000/api/v1/posts/comments/{id}`** — Delete your own comment (or any, for those who manage the workspace)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X DELETE "http://localhost:4000/api/v1/posts/comments/{id}" \
  -H "Authorization: Bearer $API_KEY"
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/posts/comments/{id}', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer $API_KEY',
  },
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "DELETE",
    "http://localhost:4000/api/v1/posts/comments/{id}",
    headers={
    "Authorization": "Bearer $API_KEY",
    },
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("DELETE", "http://localhost:4000/api/v1/posts/comments/{id}", nil)
	req.Header.Set("Authorization", "Bearer $API_KEY")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/posts/comments/{id}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/posts/comments/{id}')
req = Net::HTTP::Delete.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/posts/comments/{id}"))
    .header("Authorization", "Bearer $API_KEY")
    .method("DELETE", BodyPublishers.noBody())
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Edit your own comment

**`PATCH http://localhost:4000/api/v1/posts/comments/{id}`** — Edit your own comment

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `body` | string | yes |  |
| `mentionIds` | string[] | no |  |

```json
{
  "body": "string",
  "mentionIds": [
    "string"
  ]
}
```

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X PATCH "http://localhost:4000/api/v1/posts/comments/{id}" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"body":"string","mentionIds":["string"]}'
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/posts/comments/{id}', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer $API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"body":"string","mentionIds":["string"]}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "PATCH",
    "http://localhost:4000/api/v1/posts/comments/{id}",
    headers={
    "Authorization": "Bearer $API_KEY",
    "Content-Type": "application/json",
    },
    json={"body": "string", "mentionIds": ["string"]},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("PATCH", "http://localhost:4000/api/v1/posts/comments/{id}", strings.NewReader(`{"body":"string","mentionIds":["string"]}`))
	req.Header.Set("Authorization", "Bearer $API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/posts/comments/{id}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"body":"string","mentionIds":["string"]}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/posts/comments/{id}')
req = Net::HTTP::Patch.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
req['Content-Type'] = 'application/json'
req.body = '{"body":"string","mentionIds":["string"]}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/posts/comments/{id}"))
    .header("Authorization", "Bearer $API_KEY")
    .header("Content-Type", "application/json")
    .method("PATCH", BodyPublishers.ofString("{\"body\":\"string\",\"mentionIds\":[\"string\"]}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Settle or reopen a comment thread

**`POST http://localhost:4000/api/v1/posts/comments/{id}/resolve`** — Settle or reopen a comment thread

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `resolved` | boolean | yes |  |

```json
{
  "resolved": true
}
```

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X POST "http://localhost:4000/api/v1/posts/comments/{id}/resolve" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"resolved":true}'
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/posts/comments/{id}/resolve', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"resolved":true}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "POST",
    "http://localhost:4000/api/v1/posts/comments/{id}/resolve",
    headers={
    "Authorization": "Bearer $API_KEY",
    "Content-Type": "application/json",
    },
    json={"resolved": True},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("POST", "http://localhost:4000/api/v1/posts/comments/{id}/resolve", strings.NewReader(`{"resolved":true}`))
	req.Header.Set("Authorization", "Bearer $API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/posts/comments/{id}/resolve');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"resolved":true}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/posts/comments/{id}/resolve')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
req['Content-Type'] = 'application/json'
req.body = '{"resolved":true}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/posts/comments/{id}/resolve"))
    .header("Authorization", "Bearer $API_KEY")
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"resolved\":true}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Accept or reject a suggested edit

**`POST http://localhost:4000/api/v1/posts/comments/{id}/suggestion`** — Accept or reject a suggested edit

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accept` | boolean | yes |  |

```json
{
  "accept": true
}
```

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X POST "http://localhost:4000/api/v1/posts/comments/{id}/suggestion" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"accept":true}'
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/posts/comments/{id}/suggestion', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"accept":true}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "POST",
    "http://localhost:4000/api/v1/posts/comments/{id}/suggestion",
    headers={
    "Authorization": "Bearer $API_KEY",
    "Content-Type": "application/json",
    },
    json={"accept": True},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("POST", "http://localhost:4000/api/v1/posts/comments/{id}/suggestion", strings.NewReader(`{"accept":true}`))
	req.Header.Set("Authorization", "Bearer $API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/posts/comments/{id}/suggestion');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"accept":true}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/posts/comments/{id}/suggestion')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
req['Content-Type'] = 'application/json'
req.body = '{"accept":true}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/posts/comments/{id}/suggestion"))
    .header("Authorization", "Bearer $API_KEY")
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"accept\":true}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

---

## For AI agents

- This page for a human reader: https://indrava.forumulate.com/docs/ref-comments
- The whole space as one Markdown file: https://indrava.forumulate.com/docs/llms-full.txt
- Live search + fetch over MCP: https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/mcp
  - Install (Claude CLI): `claude mcp add forumulate-docs --transport http https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/mcp`

This Markdown is the same content the page renders — safe to quote and to ground answers in.
