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

# Create filters (one per seat)

POST https://alsona.com/rest/accounts/{account_id}/campaigns/{campaign_id}/filters
Content-Type: application/json

Create multiple filters; generates `filter_group_id`.

**Request body fields (wrapped in `campaign` object):**
- `name` (string, required) - Human-readable campaign name.
- `account_id` (string, required) - Target account ID.
- `status` (string, optional) - `DRAFT` | `RUN` | `PAUSE` | `DONE`. Defaults to `DRAFT`.
- `seats` (array of strings, required) - Seat IDs to run this campaign.
- `schedule` (object, required) - Day-of-week schedule. Each day key maps to `[enabled (bool), start_hour (int), end_hour (int)]`.
- `timezone` (integer, optional) - UTC offset in minutes (e.g. `-300` = UTC-5).
- `campaign_id` (string, optional) - Supply to create with a specific ID; omit to auto-generate.

Reference: https://api.alsona.com/api-reference/filters/create-filters-one-per-seat

## Authentication

- `X-API-KEY` header (required)

## Request

### Path parameters

- `account_id` (string, required)
- `campaign_id` (string, required)

### Body (application/json)

- `seats` (list of string, required)
- `filter` (object, required)
  - `type` (string, required)
  - `filters` (object, required)
    - `data_cleansing` (boolean, required)
    - `include_degree_1` (boolean, required)
  - `url_page` (string, required)
  - `max_profiles` (integer, required)
  - `profile_fetch_type` (string, required)

## Response

### 200

- `success` (boolean, required)
- `filters` (list of object, required)
  - `type` (string, required)
  - `status` (string, required)
  - `filters` (object, required)
    - `data_cleansing` (boolean, required)
    - `include_degree_1` (boolean, required)
  - `seat_id` (string, required)
  - `url_page` (string, required)
  - `filter_id` (string, required)
  - `account_id` (string, required)
  - `created_at` (integer, required)
  - `campaign_id` (string, required)
  - `max_profiles` (integer, required)
  - `filter_group_id` (string, required)
  - `profile_fetch_type` (string, required)

## Examples

### Response

**Request**

```json
undefined
```

**Response**

```json
{
  "success": true,
  "filters": [
    {
      "type": "filter_LP",
      "status": "RUN",
      "filters": {
        "data_cleansing": true,
        "include_degree_1": true
      },
      "seat_id": "SEAT6a13e661ecc6a86e3fb7",
      "url_page": "https://www.linkedin.com/search/results/people/?keywords=ceos%20michigan&network=%5B%22S%22%5D&sid=p-e",
      "filter_id": "filter_4357423a0c38093766fa",
      "account_id": "ACCO136ce10b5f8a7682efb3",
      "created_at": 1756556153805,
      "campaign_id": "campaign_79dc16be15ff633fb8dc",
      "max_profiles": 500,
      "filter_group_id": "filter_group_7a935bd04ec72fe08ee9",
      "profile_fetch_type": "LAZY"
    }
  ]
}
```

**SDK Code**

```python Response
import requests

url = "https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters"

headers = {"X-API-KEY": "<apiKey>"}

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

print(response.json())
```

```javascript Response
const url = 'https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters';
const options = {method: 'POST', headers: {'X-API-KEY': '<apiKey>'}};

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

```go Response
package main

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

func main() {

	url := "https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters"

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

	req.Header.Add("X-API-KEY", "<apiKey>")

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

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

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

}
```

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

url = URI("https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters")

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

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<apiKey>'

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

```java Response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters")
  .header("X-API-KEY", "<apiKey>")
  .asString();
```

```php Response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters', [
  'headers' => [
    'X-API-KEY' => '<apiKey>',
  ],
]);

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

```csharp Response
using RestSharp;

var client = new RestClient("https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Response
import Foundation

let headers = ["X-API-KEY": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```

### Filters_Create filters (one per seat)_example

**Request**

```json
{
  "seats": [
    "SEAT6a13e661ecc6a86e3fb7"
  ],
  "filter": {
    "type": "filter_LP",
    "filters": {
      "data_cleansing": true,
      "include_degree_1": true
    },
    "url_page": "https://www.linkedin.com/search/results/people/?keywords=ceos%20michigan&network=%5B%22S%22%5D&sid=p-e",
    "max_profiles": 500,
    "profile_fetch_type": "LAZY"
  }
}
```

**Response**

```json
{
  "success": true,
  "filters": [
    {
      "type": "filter_LP",
      "status": "RUN",
      "filters": {
        "data_cleansing": true,
        "include_degree_1": true
      },
      "seat_id": "SEAT6a13e661ecc6a86e3fb7",
      "url_page": "https://www.linkedin.com/search/results/people/?keywords=ceos%20michigan&network=%5B%22S%22%5D&sid=p-e",
      "filter_id": "filter_4357423a0c38093766fa",
      "account_id": "ACCO136ce10b5f8a7682efb3",
      "created_at": 1756556153805,
      "campaign_id": "campaign_79dc16be15ff633fb8dc",
      "max_profiles": 500,
      "filter_group_id": "filter_group_7a935bd04ec72fe08ee9",
      "profile_fetch_type": "LAZY"
    }
  ]
}
```

**SDK Code**

```python Filters_Create filters (one per seat)_example
import requests

url = "https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters"

payload = {
    "seats": ["SEAT6a13e661ecc6a86e3fb7"],
    "filter": {
        "type": "filter_LP",
        "filters": {
            "data_cleansing": True,
            "include_degree_1": True
        },
        "url_page": "https://www.linkedin.com/search/results/people/?keywords=ceos%20michigan&network=%5B%22S%22%5D&sid=p-e",
        "max_profiles": 500,
        "profile_fetch_type": "LAZY"
    }
}
headers = {
    "X-API-KEY": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Filters_Create filters (one per seat)_example
const url = 'https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters';
const options = {
  method: 'POST',
  headers: {'X-API-KEY': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"seats":["SEAT6a13e661ecc6a86e3fb7"],"filter":{"type":"filter_LP","filters":{"data_cleansing":true,"include_degree_1":true},"url_page":"https://www.linkedin.com/search/results/people/?keywords=ceos%20michigan&network=%5B%22S%22%5D&sid=p-e","max_profiles":500,"profile_fetch_type":"LAZY"}}'
};

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

```go Filters_Create filters (one per seat)_example
package main

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

func main() {

	url := "https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters"

	payload := strings.NewReader("{\n  \"seats\": [\n    \"SEAT6a13e661ecc6a86e3fb7\"\n  ],\n  \"filter\": {\n    \"type\": \"filter_LP\",\n    \"filters\": {\n      \"data_cleansing\": true,\n      \"include_degree_1\": true\n    },\n    \"url_page\": \"https://www.linkedin.com/search/results/people/?keywords=ceos%20michigan&network=%5B%22S%22%5D&sid=p-e\",\n    \"max_profiles\": 500,\n    \"profile_fetch_type\": \"LAZY\"\n  }\n}")

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

	req.Header.Add("X-API-KEY", "<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 Filters_Create filters (one per seat)_example
require 'uri'
require 'net/http'

url = URI("https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters")

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

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"seats\": [\n    \"SEAT6a13e661ecc6a86e3fb7\"\n  ],\n  \"filter\": {\n    \"type\": \"filter_LP\",\n    \"filters\": {\n      \"data_cleansing\": true,\n      \"include_degree_1\": true\n    },\n    \"url_page\": \"https://www.linkedin.com/search/results/people/?keywords=ceos%20michigan&network=%5B%22S%22%5D&sid=p-e\",\n    \"max_profiles\": 500,\n    \"profile_fetch_type\": \"LAZY\"\n  }\n}"

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

```java Filters_Create filters (one per seat)_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters")
  .header("X-API-KEY", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"seats\": [\n    \"SEAT6a13e661ecc6a86e3fb7\"\n  ],\n  \"filter\": {\n    \"type\": \"filter_LP\",\n    \"filters\": {\n      \"data_cleansing\": true,\n      \"include_degree_1\": true\n    },\n    \"url_page\": \"https://www.linkedin.com/search/results/people/?keywords=ceos%20michigan&network=%5B%22S%22%5D&sid=p-e\",\n    \"max_profiles\": 500,\n    \"profile_fetch_type\": \"LAZY\"\n  }\n}")
  .asString();
```

```php Filters_Create filters (one per seat)_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters', [
  'body' => '{
  "seats": [
    "SEAT6a13e661ecc6a86e3fb7"
  ],
  "filter": {
    "type": "filter_LP",
    "filters": {
      "data_cleansing": true,
      "include_degree_1": true
    },
    "url_page": "https://www.linkedin.com/search/results/people/?keywords=ceos%20michigan&network=%5B%22S%22%5D&sid=p-e",
    "max_profiles": 500,
    "profile_fetch_type": "LAZY"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '<apiKey>',
  ],
]);

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

```csharp Filters_Create filters (one per seat)_example
using RestSharp;

var client = new RestClient("https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"seats\": [\n    \"SEAT6a13e661ecc6a86e3fb7\"\n  ],\n  \"filter\": {\n    \"type\": \"filter_LP\",\n    \"filters\": {\n      \"data_cleansing\": true,\n      \"include_degree_1\": true\n    },\n    \"url_page\": \"https://www.linkedin.com/search/results/people/?keywords=ceos%20michigan&network=%5B%22S%22%5D&sid=p-e\",\n    \"max_profiles\": 500,\n    \"profile_fetch_type\": \"LAZY\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Filters_Create filters (one per seat)_example
import Foundation

let headers = [
  "X-API-KEY": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "seats": ["SEAT6a13e661ecc6a86e3fb7"],
  "filter": [
    "type": "filter_LP",
    "filters": [
      "data_cleansing": true,
      "include_degree_1": true
    ],
    "url_page": "https://www.linkedin.com/search/results/people/?keywords=ceos%20michigan&network=%5B%22S%22%5D&sid=p-e",
    "max_profiles": 500,
    "profile_fetch_type": "LAZY"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://alsona.com/rest/accounts/account_id/campaigns/campaign_id/filters")! 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()
```