> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postsyncer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Accept Suggestion

> Add the brand's suggested competitor to its competitors

## Accept Suggestion

Adds the competitor the brand brain suggests (`suggestion` in [Get brand](https://docs.postsyncer.com/api-reference/brand/get.md)) to the workspace's `competitors`. It saves the same way as adding the competitor by hand in Settings → Brand: a new brand version, and the competitor list is kept as yours. On a paid plan, the account's public posts are read at once, and `watch` shows how that goes.

The account is never suggested again, even if it is taken off the list later. The answer has the next suggestion, if there is one. Ask the person before you accept for them.

> [!NOTE]
>
> The body must be JSON, sent with `Content-Type: application/json`. A form body or any other content type is refused with `415`. The query string is not read, so `workspace_id` goes in the body too.

### Request

**workspace\_id** `integer` *required*

The ID of the workspace, from [List workspaces](https://docs.postsyncer.com/api-reference/workspaces/list.md)

**network** `string` *required*

The suggestion's `network`: `bluesky`, `mastodon`, `youtube` or `twitter`

**handle** `string` *required*

The suggestion's `handle`, as Get brand gives it

Send the network and handle of the suggestion as it is now. If it changed since you read it, nothing is saved and the answer is `409`.

```json theme={null}
{
  "workspace_id": 12,
  "network": "mastodon",
  "handle": "@kilnroasters@mastodon.social"
}
```

### Response

`data` is the [brand object](https://docs.postsyncer.com/api-reference/brand/overview.md#the-brand-object) after the save, with the new competitor at the end of `competitors`:

```json theme={null}
{
  "data": {
    "workspace_id": 12,
    "version": 4,
    "competitors": [
      {
        "name": "Northbound Roasters",
        "handles": [
          { "network": "bluesky", "handle": "northbound.bsky.social" },
          { "network": "instagram", "handle": "northboundroasters" }
        ]
      },
      {
        "name": "Kiln Coffee Roasters",
        "handles": [
          { "network": "mastodon", "handle": "kilnroasters@mastodon.social" }
        ]
      }
    ],
    "sources": {
      "competitors": { "source": "api", "at": "2026-11-19T10:20:00+00:00" }
    },
    "watch": [
      {
        "competitor": "Northbound Roasters",
        "network": "bluesky",
        "handle": "northbound.bsky.social",
        "status": "ok",
        "read_at": "2026-11-19T09:31:40+00:00"
      },
      {
        "competitor": "Northbound Roasters",
        "network": "instagram",
        "handle": "northboundroasters",
        "status": "later",
        "read_at": null
      },
      {
        "competitor": "Kiln Coffee Roasters",
        "network": "mastodon",
        "handle": "kilnroasters@mastodon.social",
        "status": "reading",
        "read_at": null
      }
    ],
    "suggestion": null
  }
}
```

(The brand object is shortened here. The full answer is the same as [Get brand](https://docs.postsyncer.com/api-reference/brand/get.md).)

### Code Examples

```bash cURL theme={null}
curl -X POST "https://postsyncer.com/api/v1/brand/suggestion/accept" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": 12,
    "network": "mastodon",
    "handle": "@kilnroasters@mastodon.social"
  }'
```

```javascript Node.js theme={null}
const axios = require('axios');

const acceptSuggestion = async (workspaceId, suggestion) => {
  try {
    const response = await axios.post('https://postsyncer.com/api/v1/brand/suggestion/accept', {
      workspace_id: workspaceId,
      network: suggestion.network,
      handle: suggestion.handle
    }, {
      headers: {
        'Authorization': 'Bearer YOUR_API_TOKEN',
        'Content-Type': 'application/json'
      }
    });

    console.log('Competitors:', response.data.data.competitors.map((c) => c.name));
    return response.data.data;
  } catch (error) {
    console.error('Error accepting the suggestion:', error.response?.data || error.message);
  }
};
```

```php PHP theme={null}
<?php

$data = [
    'workspace_id' => 12,
    'network' => 'mastodon',
    'handle' => '@kilnroasters@mastodon.social'
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://postsyncer.com/api/v1/brand/suggestion/accept');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_API_TOKEN',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 200) {
    $brand = json_decode($response, true)['data'];
    echo "Competitors: " . implode(', ', array_column($brand['competitors'], 'name'));
} elseif ($httpCode === 409) {
    echo "The suggestion changed. Read the brand again.";
} else {
    echo "Error: " . $response;
}
?>
```

```python Python theme={null}
import requests

data = {
    'workspace_id': 12,
    'network': 'mastodon',
    'handle': '@kilnroasters@mastodon.social'
}

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN'
}

# json= sends the body as JSON, with Content-Type: application/json.
response = requests.post(
    'https://postsyncer.com/api/v1/brand/suggestion/accept',
    json=data,
    headers=headers
)

if response.status_code == 200:
    print('Next suggestion:', response.json()['data']['suggestion'])
elif response.status_code == 409:
    print('The suggestion changed. Read the brand again.')
else:
    print(f"Error: {response.status_code}")
    print(response.text)
```

### Error Codes

**401** `Unauthorized`

Missing or invalid API token

**403** `Forbidden`

The key does not have the `brand:update` permission, or the key's person is not an owner or manager of the workspace: `You do not have permission to edit workspace.`

**409** `Conflict`

The network and handle are not the brand's suggestion now: `That suggestion changed. Refresh to see the new one.` Someone answered it already, it is a competitor already, or newer posts put another account first. Read the brand again for the current suggestion.

When there is no suggestion at all, as on a free plan, the message is `There is no suggested competitor right now.` Reading the brand again shows none, so don't try again.

Either way, nothing is saved.

**415** `Unsupported Media Type`

The body is not JSON: `Send the body as JSON.`

**422** `Unprocessable Entity`

`workspace_id` is missing, not a number, or a workspace the key's person is not in (`Invalid workspace ID.`). `network` is not one the suggestion can be on (`Network is bluesky, mastodon, youtube or twitter.`), or `handle` is missing. Or the brand already has 10 competitors (`competitors`: `Competitors: 10 at most.`): take one off with [Update brand](https://docs.postsyncer.com/api-reference/brand/update.md) first. Nothing is saved.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.