> ## 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.

# Dismiss Suggestion

> Mark a suggested competitor as not a competitor

## Dismiss Suggestion

Marks an account as not a competitor, so the brand brain never suggests it to this workspace again. Send the `network` and `handle` of `suggestion` in [Get brand](https://docs.postsyncer.com/api-reference/brand/get.md).

The brand itself doesn't change: no new version, and `competitors` stays as it is. It needs no current suggestion, and dismissing the same account twice changes nothing. The answer has the next suggestion, if there is one. Ask the person before you dismiss 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

```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), with the next suggestion:

```json theme={null}
{
  "data": {
    "workspace_id": 12,
    "version": 3,
    "suggestion": {
      "network": "bluesky",
      "handle": "@ember.coffee",
      "name": "Ember Coffee Co.",
      "photo": null,
      "posts": 2,
      "note": "2 of the top coffee roasting posts on Bluesky in the last two weeks were theirs."
    }
  }
}
```

(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/dismiss" \
  -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 dismissSuggestion = async (workspaceId, suggestion) => {
  try {
    const response = await axios.post('https://postsyncer.com/api/v1/brand/suggestion/dismiss', {
      workspace_id: workspaceId,
      network: suggestion.network,
      handle: suggestion.handle
    }, {
      headers: {
        'Authorization': 'Bearer YOUR_API_TOKEN',
        'Content-Type': 'application/json'
      }
    });

    console.log('Next suggestion:', response.data.data.suggestion);
    return response.data.data;
  } catch (error) {
    console.error('Error dismissing 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/dismiss');
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 $brand['suggestion'] ? "Next: " . $brand['suggestion']['name'] : "No more suggestions";
} 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/dismiss',
    json=data,
    headers=headers
)

if response.status_code == 200:
    print('Next suggestion:', response.json()['data']['suggestion'])
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.`

**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 a suggestion can be on (`Network is bluesky, mastodon, youtube or twitter.`). `handle` is missing, or is not a handle on that network, such as `That is not a handle on Mastodon.` Nothing is saved.


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