> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fyno.io/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fyno.io/docs/_mcp/server.

# Add User to Suppression List

POST https://api.fyno.io/v1/{WSID}/suppressions
Content-Type: application/json

Add a user to the suppression list for a given channel.

**Note:** If both `distinct_id` and `destination` are provided, `distinct_id` takes precedence, and `destination` is ignored.

Example request:

`POST {{API_URL}}/v1/{{WSID}}/suppressions`

Reference: https://fyno.io/docs/api-reference/suppression-list/add-user-to-suppression-list

## Authentication

- `Authorization` header (bearer token, required) — Enter your API Key. If you don't have it already, you can create one from the API Keys page within your Fyno account

## Request

### Path parameters

- `WSID` (string, required) — Enter your workspace ID. You can obtain this value from the API Keys page within your Fyno account.

### Body (application/json)

This endpoint expects an add_suppression_list.

- `add_suppression_list`

## Response

### 200

Suppression list updated. `_message` reflects whether a new suppression record was created ("User has been added to the suppression!", with `_id` returned) or an existing record for that `distinct_id`/`destination` and `channel` was updated ("User record has been updated!", `_id` omitted).

- `status` (string, required)
- `_message` (string, required)

## Errors

### 400 Bad Request Error

Destination is invalid

- `status` (string, optional)
- `_message` (string, optional)

### 401 Unauthorized Error

API Key or Workspace ID is invalid. User is unauthorised.

- `_message` (string, required)
- `status` (string, required)

## Types

### AddSuppressionList0

- `distinct_id` (string, required) — The distinct ID you use to identify the user. Use this as an alternative to `destination`.
- `channel` (string, required) — The channel to suppress the user on, for example `sms`, `email`, `whatsapp`, or `push`.
- `event_type` (list of enum, optional) — Enter the event types for which the user must be suppressed on the specified channel. If omitted, the suppression applies to all event types.
  - Allowed values: `marketing`, `transactional`, `otp`
- `description` (string, optional) — Reason or tag for the suppression, for example "DND" or "User unsubscribed".
- `expiry_ts` (datetime, optional) — (Optional) Enter the timestamp (ISO 8601 format) at which this suppression should automatically expire and the user should no longer be suppressed. If omitted, the suppression does not expire and remains in effect until manually removed.

### AddSuppressionList1

- `destination` (string, required) — The email address, phone number, or push token to suppress, for example `abcde@fghi.com` for email, `+49XXXXXXXXX` for SMS or WhatsApp, or `ExponentPushToken[XXXXX]` for push. Enter a phone number with the country code.
- `channel` (string, required) — The channel to suppress the user on, for example `sms`, `email`, `whatsapp`, or `push`.
- `event_type` (list of enum, optional) — Enter the event types for which the user must be suppressed on the specified channel. If omitted, the suppression applies to all event types.
  - Allowed values: `marketing`, `transactional`, `otp`
- `description` (string, optional) — Reason or tag for the suppression, for example "DND" or "User unsubscribed".
- `expiry_ts` (datetime, optional) — (Optional) Enter the timestamp (ISO 8601 format) at which this suppression should automatically expire and the user should no longer be suppressed. If omitted, the suppression does not expire and remains in effect until manually removed.

## Examples

### Suppress an email address

**Request**

```json
{
  "channel": "email",
  "description": "User unsubscribed",
  "destination": "abcde@fghi.com",
  "distinct_id": "XXXXXXXX",
  "event_type": [
    "marketing"
  ]
}
```

**Response**

```json
{
  "status": "ok",
  "_message": "User has been added to the suppression!"
}
```

**SDK Code**

```python Suppress an email address
import requests

url = "https://api.fyno.io/v1/FYXXXXXXXX/suppressions"

payload = {
    "channel": "email",
    "description": "User unsubscribed",
    "destination": "abcde@fghi.com",
    "distinct_id": "XXXXXXXX",
    "event_type": ["marketing"]
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Suppress an email address
const url = 'https://api.fyno.io/v1/FYXXXXXXXX/suppressions';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"channel":"email","description":"User unsubscribed","destination":"abcde@fghi.com","distinct_id":"XXXXXXXX","event_type":["marketing"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Suppress an email address
package main

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

func main() {

	url := "https://api.fyno.io/v1/FYXXXXXXXX/suppressions"

	payload := strings.NewReader("{\n  \"channel\": \"email\",\n  \"description\": \"User unsubscribed\",\n  \"destination\": \"abcde@fghi.com\",\n  \"distinct_id\": \"XXXXXXXX\",\n  \"event_type\": [\n    \"marketing\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Suppress an email address
require 'uri'
require 'net/http'

url = URI("https://api.fyno.io/v1/FYXXXXXXXX/suppressions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"channel\": \"email\",\n  \"description\": \"User unsubscribed\",\n  \"destination\": \"abcde@fghi.com\",\n  \"distinct_id\": \"XXXXXXXX\",\n  \"event_type\": [\n    \"marketing\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Suppress an email address
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.fyno.io/v1/FYXXXXXXXX/suppressions")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"channel\": \"email\",\n  \"description\": \"User unsubscribed\",\n  \"destination\": \"abcde@fghi.com\",\n  \"distinct_id\": \"XXXXXXXX\",\n  \"event_type\": [\n    \"marketing\"\n  ]\n}")
  .asString();
```

```php Suppress an email address
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.fyno.io/v1/FYXXXXXXXX/suppressions', [
  'body' => '{
  "channel": "email",
  "description": "User unsubscribed",
  "destination": "abcde@fghi.com",
  "distinct_id": "XXXXXXXX",
  "event_type": [
    "marketing"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Suppress an email address
using RestSharp;

var client = new RestClient("https://api.fyno.io/v1/FYXXXXXXXX/suppressions");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"channel\": \"email\",\n  \"description\": \"User unsubscribed\",\n  \"destination\": \"abcde@fghi.com\",\n  \"distinct_id\": \"XXXXXXXX\",\n  \"event_type\": [\n    \"marketing\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Suppress an email address
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "channel": "email",
  "description": "User unsubscribed",
  "destination": "abcde@fghi.com",
  "distinct_id": "XXXXXXXX",
  "event_type": ["marketing"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fyno.io/v1/FYXXXXXXXX/suppressions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Suppress a user by distinct ID

**Request**

```json
{
  "channel": "sms",
  "description": "DND",
  "distinct_id": "XXXXXXXX",
  "event_type": [
    "marketing",
    "transactional",
    "otp"
  ],
  "expiry_ts": "2026-09-16T12:40:20.997+05:30"
}
```

**Response**

```json
{
  "status": "ok",
  "_message": "User has been added to the suppression!"
}
```

**SDK Code**

```python Suppress a user by distinct ID
import requests

url = "https://api.fyno.io/v1/FYXXXXXXXX/suppressions"

payload = {
    "channel": "sms",
    "description": "DND",
    "distinct_id": "XXXXXXXX",
    "event_type": ["marketing", "transactional", "otp"],
    "expiry_ts": "2026-09-16T12:40:20.997+05:30"
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Suppress a user by distinct ID
const url = 'https://api.fyno.io/v1/FYXXXXXXXX/suppressions';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"channel":"sms","description":"DND","distinct_id":"XXXXXXXX","event_type":["marketing","transactional","otp"],"expiry_ts":"2026-09-16T12:40:20.997+05:30"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Suppress a user by distinct ID
package main

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

func main() {

	url := "https://api.fyno.io/v1/FYXXXXXXXX/suppressions"

	payload := strings.NewReader("{\n  \"channel\": \"sms\",\n  \"description\": \"DND\",\n  \"distinct_id\": \"XXXXXXXX\",\n  \"event_type\": [\n    \"marketing\",\n    \"transactional\",\n    \"otp\"\n  ],\n  \"expiry_ts\": \"2026-09-16T12:40:20.997+05:30\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Suppress a user by distinct ID
require 'uri'
require 'net/http'

url = URI("https://api.fyno.io/v1/FYXXXXXXXX/suppressions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"channel\": \"sms\",\n  \"description\": \"DND\",\n  \"distinct_id\": \"XXXXXXXX\",\n  \"event_type\": [\n    \"marketing\",\n    \"transactional\",\n    \"otp\"\n  ],\n  \"expiry_ts\": \"2026-09-16T12:40:20.997+05:30\"\n}"

response = http.request(request)
puts response.read_body
```

```java Suppress a user by distinct ID
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.fyno.io/v1/FYXXXXXXXX/suppressions")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"channel\": \"sms\",\n  \"description\": \"DND\",\n  \"distinct_id\": \"XXXXXXXX\",\n  \"event_type\": [\n    \"marketing\",\n    \"transactional\",\n    \"otp\"\n  ],\n  \"expiry_ts\": \"2026-09-16T12:40:20.997+05:30\"\n}")
  .asString();
```

```php Suppress a user by distinct ID
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.fyno.io/v1/FYXXXXXXXX/suppressions', [
  'body' => '{
  "channel": "sms",
  "description": "DND",
  "distinct_id": "XXXXXXXX",
  "event_type": [
    "marketing",
    "transactional",
    "otp"
  ],
  "expiry_ts": "2026-09-16T12:40:20.997+05:30"
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Suppress a user by distinct ID
using RestSharp;

var client = new RestClient("https://api.fyno.io/v1/FYXXXXXXXX/suppressions");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"channel\": \"sms\",\n  \"description\": \"DND\",\n  \"distinct_id\": \"XXXXXXXX\",\n  \"event_type\": [\n    \"marketing\",\n    \"transactional\",\n    \"otp\"\n  ],\n  \"expiry_ts\": \"2026-09-16T12:40:20.997+05:30\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Suppress a user by distinct ID
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "channel": "sms",
  "description": "DND",
  "distinct_id": "XXXXXXXX",
  "event_type": ["marketing", "transactional", "otp"],
  "expiry_ts": "2026-09-16T12:40:20.997+05:30"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fyno.io/v1/FYXXXXXXXX/suppressions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```