POST
/
sources
/
{source_id}
/
filter_segments
curl --request POST \
  --url https://app.getcensus.com/api/v1/sources/{source_id}/filter_segments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "priority accounts",
  "molecules": [
    {
      "attribute": "last_seen_at",
      "attribute_type": "property",
      "operator": "isnotnull",
      "value": "id"
    }
  ],
  "dataset_id": 123
}'
{
  "status": "created",
  "data": {
    "id": 9
  },
  "filter_segment_source_url": "https://app.getcensus.com/api/v1/sources/12/filter_segments/9/source_status"
}

Authorizations

Authorization
string
header
required

Bearer token for the current workspace. Can be retrieved from the Workspace's settings page.

Path Parameters

source_id
integer
required

ID of the source

Body

application/json
name
string
required

The name of this segment.

Example:

"priority accounts"

molecules
object[]
required

A list of Atomic Molecules, Related Segment Molecules, Relationship Molecules, Molecule Groups and at most one Operation Molecule.

A condition on an property of an entity. The property or column will belong to the entity described in the parent relationship molecule. If the basic molecule is top level, the condition is on the entity on which the segment is based on.

dataset_id
integer
required

The id of the dataset on which this segment is based.

Response

201 - application/json
Segment created successfully
status
enum<string>

Outcome of the operation.

Available options:
success,
updated,
created,
not_found,
error
Example:

"created"

data
object
filter_segment_source_url
string

Some subproperties of the filter_segment are created asynchronously. You can query this url to fetch the status of the creation (true or false). When status is true, it will return all properties returned in GET /sources/{source_id}/filter_segments/{segment_id}.

Example:

"https://app.getcensus.com/api/v1/sources/12/filter_segments/9/source_status"