Help
DevelopersReference

Segments

Saved filters over what visitors asked and did; members with identity, and who entered or left.

Base URL https://api.showpilot.com/v1. Every call needs Authorization: Bearer <api key>; see Authentication.

List saved segments

GET /segments

Scope: segments:read. Operation id: listSegments.

Example request

curl "https://api.showpilot.com/v1/segments" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

Every segment with its current member count.

FieldTypeAlwaysMeaning
itemsarray of Segmentyes

Segment

FieldTypeAlwaysMeaning
idstring (uuid)yes
namestringyes
descriptionstringyes
filterSegmentFilteryes
memberCountintegeryesAs of the last evaluation.
evaluatedAtstring or null (date-time)yes
createdAtstring (date-time)yes
updatedAtstring (date-time)yes

SegmentFilter

Conditions AND together. At least one is required.

FieldTypeAlwaysMeaning
askedstringnoWeb-search syntax over what the visitor asked and said: security OR SOC2, "single sign-on", pricing -enterprise.
toursWatchedarray of string (uuid)noAny of these tours was watched.
identifiedbooleannoHas an email or a CRM contact.
hasCrmbooleanno
minIntentintegerno
lastSeenWithinDaysintegerno
qualifiedobjectnoQualifying answers that must equal these values.
labelsobjectno
accountobjectno

Errors

StatusWhen
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

Save a segment

POST /segments

Scope: segments:write. Operation id: createSegment.

Requires Idempotency-Key. The worker evaluates it within minutes; call evaluate to run it now.

Example request

curl "https://api.showpilot.com/v1/segments" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

Status 201.

The saved segment.

Segment

FieldTypeAlwaysMeaning
idstring (uuid)yes
namestringyes
descriptionstringyes
filterSegmentFilteryes
memberCountintegeryesAs of the last evaluation.
evaluatedAtstring or null (date-time)yes
createdAtstring (date-time)yes
updatedAtstring (date-time)yes

SegmentFilter

Conditions AND together. At least one is required.

FieldTypeAlwaysMeaning
askedstringnoWeb-search syntax over what the visitor asked and said: security OR SOC2, "single sign-on", pricing -enterprise.
toursWatchedarray of string (uuid)noAny of these tours was watched.
identifiedbooleannoHas an email or a CRM contact.
hasCrmbooleanno
minIntentintegerno
lastSeenWithinDaysintegerno
qualifiedobjectnoQualifying answers that must equal these values.
labelsobjectno
accountobjectno

Errors

StatusWhen
400A parameter is malformed, such as a cursor this API did not issue, a limit under 1, or an unknown status. Code invalid-request.
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

Count a filter's members without saving it

POST /segments/preview

Scope: segments:read. Operation id: previewSegment.

Example request

curl "https://api.showpilot.com/v1/segments/preview" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

The normalised filter, its count, and a few matching visitor ids.

FieldTypeAlwaysMeaning
filterSegmentFilteryes
countintegeryes
sampleVisitorIdsarray of string (uuid)yes

SegmentFilter

Conditions AND together. At least one is required.

FieldTypeAlwaysMeaning
askedstringnoWeb-search syntax over what the visitor asked and said: security OR SOC2, "single sign-on", pricing -enterprise.
toursWatchedarray of string (uuid)noAny of these tours was watched.
identifiedbooleannoHas an email or a CRM contact.
hasCrmbooleanno
minIntentintegerno
lastSeenWithinDaysintegerno
qualifiedobjectnoQualifying answers that must equal these values.
labelsobjectno
accountobjectno

Errors

StatusWhen
400A parameter is malformed, such as a cursor this API did not issue, a limit under 1, or an unknown status. Code invalid-request.
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

Read a segment

GET /segments/{id}

Scope: segments:read. Operation id: getSegment.

Parameters

NameInTypeMeaning
idpathstring (uuid)

Example request

curl "https://api.showpilot.com/v1/segments/<id>" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

The segment.

Segment

FieldTypeAlwaysMeaning
idstring (uuid)yes
namestringyes
descriptionstringyes
filterSegmentFilteryes
memberCountintegeryesAs of the last evaluation.
evaluatedAtstring or null (date-time)yes
createdAtstring (date-time)yes
updatedAtstring (date-time)yes

SegmentFilter

Conditions AND together. At least one is required.

FieldTypeAlwaysMeaning
askedstringnoWeb-search syntax over what the visitor asked and said: security OR SOC2, "single sign-on", pricing -enterprise.
toursWatchedarray of string (uuid)noAny of these tours was watched.
identifiedbooleannoHas an email or a CRM contact.
hasCrmbooleanno
minIntentintegerno
lastSeenWithinDaysintegerno
qualifiedobjectnoQualifying answers that must equal these values.
labelsobjectno
accountobjectno

Errors

StatusWhen
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
404No object with that id in this workspace. Code not-found.
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

Rename a segment or change its filter

PATCH /segments/{id}

Scope: segments:write. Operation id: updateSegment.

Requires Idempotency-Key. A changed filter takes effect at the next evaluation.

Parameters

NameInTypeMeaning
idpathstring (uuid)

Example request

curl "https://api.showpilot.com/v1/segments/<id>" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

The updated segment.

Segment

FieldTypeAlwaysMeaning
idstring (uuid)yes
namestringyes
descriptionstringyes
filterSegmentFilteryes
memberCountintegeryesAs of the last evaluation.
evaluatedAtstring or null (date-time)yes
createdAtstring (date-time)yes
updatedAtstring (date-time)yes

SegmentFilter

Conditions AND together. At least one is required.

FieldTypeAlwaysMeaning
askedstringnoWeb-search syntax over what the visitor asked and said: security OR SOC2, "single sign-on", pricing -enterprise.
toursWatchedarray of string (uuid)noAny of these tours was watched.
identifiedbooleannoHas an email or a CRM contact.
hasCrmbooleanno
minIntentintegerno
lastSeenWithinDaysintegerno
qualifiedobjectnoQualifying answers that must equal these values.
labelsobjectno
accountobjectno

Errors

StatusWhen
400A parameter is malformed, such as a cursor this API did not issue, a limit under 1, or an unknown status. Code invalid-request.
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
404No object with that id in this workspace. Code not-found.
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

Delete a segment and its membership history

DELETE /segments/{id}

Scope: segments:write. Operation id: deleteSegment.

Requires Idempotency-Key.

Parameters

NameInTypeMeaning
idpathstring (uuid)

Example request

curl "https://api.showpilot.com/v1/segments/<id>" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

Status 204. Deleted.

Errors

StatusWhen
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
404No object with that id in this workspace. Code not-found.
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

Re-evaluate a segment now

POST /segments/{id}/evaluate

Scope: segments:write. Operation id: evaluateSegment.

Requires Idempotency-Key. Runs the same pass the worker runs; every visitor who entered or left gets a segment.entered / segment.left event.

Parameters

NameInTypeMeaning
idpathstring (uuid)

Example request

curl "https://api.showpilot.com/v1/segments/<id>/evaluate" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

What changed.

FieldTypeAlwaysMeaning
segmentIdstring (uuid)yes
enteredintegeryes
leftintegeryes
totalintegeryes
evaluatedAtstring (date-time)yes

Errors

StatusWhen
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
404No object with that id in this workspace. Code not-found.
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

Who is in the segment now, with identity

GET /segments/{id}/members

Scope: segments:read. Operation id: listSegmentMembers.

Parameters

NameInTypeMeaning
idpathstring (uuid)
limitqueryintegerPage size, 1 to 200. Default 50.
cursorquerystringThe nextCursor from the previous page. Opaque; never build one.

Example request

curl "https://api.showpilot.com/v1/segments/<id>/members?limit=50" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

One page of members, newest entry first.

FieldTypeAlwaysMeaning
itemsarray of SegmentMemberyes
nextCursorstring or nullyes

SegmentMember

The visitor's identity as your systems need it; ShowPilot never sends anything to them.

FieldTypeAlwaysMeaning
visitorIdstring (uuid)yes
emailstring or nullyes
displayNamestring or nullyes
accountobject or nullyes
crmobject or nullyesContact and company ids in the CRM you connected.
labelsobjectyes
intentScoreintegeryes
enteredAtstring (date-time)yes
leftAtstring or null (date-time)yes
changedAtstring (date-time)yes

Errors

StatusWhen
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
404No object with that id in this workspace. Code not-found.
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

Who entered or left after a time

GET /segments/{id}/changes

Scope: segments:read. Operation id: listSegmentChanges.

The sync primitive. Pass the last nextSince you saw; each row says entered or left.

Parameters

NameInTypeMeaning
idpathstring (uuid)
sincequerystring (date-time)
limitqueryintegerPage size, 1 to 200. Default 50.

Example request

curl "https://api.showpilot.com/v1/segments/<id>/changes?limit=50" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

Changes, oldest first.

FieldTypeAlwaysMeaning
itemsarray of objectyes
nextSincestring or null (date-time)yes

SegmentMember

The visitor's identity as your systems need it; ShowPilot never sends anything to them.

FieldTypeAlwaysMeaning
visitorIdstring (uuid)yes
emailstring or nullyes
displayNamestring or nullyes
accountobject or nullyes
crmobject or nullyesContact and company ids in the CRM you connected.
labelsobjectyes
intentScoreintegeryes
enteredAtstring (date-time)yes
leftAtstring or null (date-time)yes
changedAtstring (date-time)yes

Errors

StatusWhen
400A parameter is malformed, such as a cursor this API did not issue, a limit under 1, or an unknown status. Code invalid-request.
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
404No object with that id in this workspace. Code not-found.
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

On this page