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"
    }
  ],
  "business_object_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
headerrequired

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.

molecules
object[]
required

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

business_object_id
integer
required

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

Response

201 - application/json
status
enum<string>

Outcome of the operation.

Available options:
success,
updated,
created,
not_found,
error
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}.