PATCH
/
sources
/
{source_id}
/
filter_segments
/
{segment_id}
curl --request PATCH \
  --url https://app.getcensus.com/api/v1/sources/{source_id}/filter_segments/{segment_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "molecules": [
    {
      "attribute": "last_seen_at",
      "attribute_type": "property",
      "operator": "isnotnull",
      "value": "id"
    }
  ],
  "name": "priority accounts"
}'
{
  "data": {
    "created_at": "2021-10-20T02:43:07.120Z",
    "filter_segment_source_object_id": 32,
    "id": 18,
    "model_id": 9,
    "molecules": [
      {
        "attribute": "last_seen_at",
        "attribute_type": "property",
        "operator": "isnotnull",
        "value": "id"
      }
    ],
    "name": "priority accounts",
    "query": "SELECT * FROM (\n  SELECT 1 AS id, 'Planet Express'::text AS company_name\n) AS census_1d19740e93f711b22efaea201fcf3f8f\nWHERE (\"id\" IS NOT NULL )\n",
    "record_count": 12540,
    "resource_identifier": "segment:priority-accounts",
    "type": "segment",
    "updated_at": "2021-10-20T02:50:35.477Z"
  },
  "status": "updated"
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

source_id
integer
required

ID of the source

segment_id
integer
required

ID of the segment

Body

application/json
molecules
object[]

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

  • Option 1

  • Option 2

  • Option 3

name
string

The name of this segment.

Response

200 - application/json
data
object
status
enum<string>

Outcome of the operation.

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