You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: descriptions/0/api.intercom.io.yaml
+49-33Lines changed: 49 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -9063,10 +9063,15 @@ paths:
9063
9063
9064
9064
### Searching for Timestamp Fields
9065
9065
9066
-
All timestamp fields (created_at, updated_at etc.) are filtered by UTC calendar day in Contact Search. An equality (=) query on a timestamp matches any contact whose value falls on the same UTC day, so filtering by a value the API returned reliably matches that contact regardless of your workspace's timezone. Comparisons (>, <) are evaluated at UTC day granularity.
9067
-
For example, if you search for all Contacts with a created_at value greater (>) than 1577869200 (the UNIX timestamp for January 1st, 2020 9:00 AM UTC), that will be interpreted as 1577836800 (January 1st, 2020 12:00 AM UTC). The search results will then include Contacts created from January 2nd, 2020 12:00 AM UTC onwards.
9068
-
If you'd like to get contacts created on January 1st, 2020 (UTC) you should search with a created_at value equal (=) to 1577836800 (January 1st, 2020 12:00 AM UTC).
9069
-
This behaviour applies only to timestamps used in search queries. The search results will still contain the full UNIX timestamp and be sorted accordingly.
9066
+
Standard timestamp fields and Date custom attributes behave differently.
9067
+
9068
+
**Standard timestamp fields** (`created_at`, `updated_at`, `last_seen_at` etc.) are filtered on the exact second, in UTC. `=` matches only Contacts whose value is that exact second, and `>`, `<`, `>=` and `<=` compare against the exact instant you pass - the value is not rounded or truncated. These fields report a type of `datetime` on the Data Attributes endpoint. Note that `!=` also matches Contacts with no value set for the field.
9069
+
9070
+
**Date custom attributes** are matched by calendar day, and the day boundary is always UTC regardless of your workspace's timezone. `=` matches the whole UTC day, `>` matches from the start of the *next* UTC day, and `<` matches everything before the start of that day. The `!=`, `>=`, `<=`, `IN` and `NIN` operators are not supported on these fields and return an error.
9071
+
9072
+
**Example.** Searching for `created_at` greater than `1577869200` (January 1st, 2020 9:00 AM UTC) returns Contacts created after that exact instant. Passing the same value for a Date custom attribute truncates it to `1577836800` (January 1st, 2020 12:00 AM UTC), so those results begin from January 2nd, 2020 12:00 AM UTC.
9073
+
9074
+
Only search queries behave this way. Responses always carry the full UNIX timestamp, and sorting uses the full value.
9070
9075
9071
9076
### Accepted Fields
9072
9077
@@ -9084,14 +9089,14 @@ paths:
9084
9089
| phone | String |
9085
9090
| formatted_phone | String |
9086
9091
| external_id | String |
9087
-
| created_at | Date (UNIX Timestamp) |
9088
-
| signed_up_at | Date (UNIX Timestamp) |
9089
-
| updated_at | Date (UNIX Timestamp) |
9090
-
| last_seen_at | Date (UNIX Timestamp) |
9091
-
| last_contacted_at | Date (UNIX Timestamp) |
9092
-
| last_replied_at | Date (UNIX Timestamp) |
9093
-
| last_email_opened_at | Date (UNIX Timestamp) |
9094
-
| last_email_clicked_at | Date (UNIX Timestamp) |
9092
+
| created_at | Datetime (Unix timestamp in seconds) |
9093
+
| signed_up_at | Datetime (Unix timestamp in seconds) |
9094
+
| updated_at | Datetime (Unix timestamp in seconds) |
9095
+
| last_seen_at | Datetime (Unix timestamp in seconds) |
9096
+
| last_contacted_at | Datetime (Unix timestamp in seconds) |
9097
+
| last_replied_at | Datetime (Unix timestamp in seconds) |
9098
+
| last_email_opened_at | Datetime (Unix timestamp in seconds) |
9099
+
| last_email_clicked_at | Datetime (Unix timestamp in seconds) |
9095
9100
| language_override | String |
9096
9101
| browser | String |
9097
9102
| browser_language | String |
@@ -9102,42 +9107,44 @@ paths:
9102
9107
| unsubscribed_from_emails | Boolean |
9103
9108
| marked_email_as_spam | Boolean |
9104
9109
| has_hard_bounced | Boolean |
9105
-
| ios_last_seen_at | Date (UNIX Timestamp) |
9110
+
| ios_last_seen_at | Datetime (Unix timestamp in seconds) |
9106
9111
| ios_app_version | String |
9107
9112
| ios_device | String |
9108
9113
| ios_app_device | String |
9109
9114
| ios_os_version | String |
9110
9115
| ios_app_name | String |
9111
9116
| ios_sdk_version | String |
9112
-
| android_last_seen_at | Date (UNIX Timestamp) |
9117
+
| android_last_seen_at | Datetime (Unix timestamp in seconds) |
9113
9118
| android_app_version | String |
9114
9119
| android_device | String |
9115
9120
| android_app_name | String |
9116
9121
| andoid_sdk_version | String |
9117
9122
| segment_id | String |
9118
9123
| tag_id | String |
9119
-
| custom_attributes.{attribute_name} | String |
9124
+
| custom_attributes.{attribute_name} | Matches the attribute's own type<br>(String, Integer, Float, Boolean or Date) |
9120
9125
9121
9126
### Accepted Operators
9122
9127
9123
-
{% admonition type="warning" name="Searching based on `created_at`" %}
9124
-
You cannot use the `<=` or `>=` operators to search by `created_at`.
9128
+
{% admonition type="warning" name="Operators not supported on Date custom attributes" %}
9129
+
Date custom attributes do not support the `!=`, `>=`, or `<=` operators. Using them returns an error. Standard timestamp fields (`created_at`, `updated_at` etc.) do support these operators, and are filtered on the exact second.
9125
9130
{% /admonition %}
9126
9131
9127
-
The table below shows the operators you can use to define how you want to search for the value. The operator should be put in as a string (`"="`). The operator has to be compatible with the field's type (eg. you cannot search with `>` for a given string value as it's only compatible for integer's and dates).
| IN | All | In<br>Shortcut for `OR` queries<br>Values must be in Array |
9134
-
| NIN | All | Not In<br>Shortcut for `OR !` queries<br>Values must be in Array |
9135
-
| > | Integer<br>Date (UNIX Timestamp) | Greater than |
9136
-
| < | Integer<br>Date (UNIX Timestamp) | Lower than |
9137
-
| ~ | String | Contains |
9138
-
| !~ | String | Doesn't Contain |
9139
-
| ^ | String | Starts With |
9140
-
| $ | String | Ends With |
9132
+
The table below shows the operators you can use to define how you want to search for the value. The operator should be put in as a string (`"="`). Which operators are valid depends on the field's type - see the "Valid Types" column below. Searching by `tag_id` supports only the `=` and `!=` operators.
| != | All except Date | Doesn't Equal<br>Also matches Contacts with no value set |
9138
+
| IN | All except Date, Datetime and tag_id | In<br>Shortcut for `OR` queries<br>Values must be in Array |
9139
+
| NIN | All except Date, Datetime and tag_id | Not In<br>Shortcut for `OR !` queries<br>Values must be in Array |
9140
+
| > | Integer<br>Datetime<br>Date | Greater than<br>On Date custom attributes, matches from the start of the next day |
9141
+
| < | Integer<br>Datetime<br>Date | Lower than<br>On Date custom attributes, matches before the start of the day |
9142
+
| >= | Integer<br>Datetime | Greater than or equal to<br>Not supported on Date custom attributes |
9143
+
| <= | Integer<br>Datetime | Lower than or equal to<br>Not supported on Date custom attributes |
9144
+
| ~ | String | Contains |
9145
+
| !~ | String | Doesn't Contain |
9146
+
| ^ | String | Starts With |
9147
+
| $ | String | Ends With |
9141
9148
responses:
9142
9149
'200':
9143
9150
description: successful
@@ -33980,6 +33987,7 @@ components:
33980
33987
- float
33981
33988
- boolean
33982
33989
- date
33990
+
- datetime
33983
33991
example: boolean
33984
33992
options:
33985
33993
type: array
@@ -38964,13 +38972,21 @@ components:
38964
38972
- IN
38965
38973
- NIN
38966
38974
- "<"
38975
+
- "<="
38967
38976
- ">"
38977
+
- ">="
38968
38978
- "~"
38969
38979
- "!~"
38970
38980
- "^"
38971
38981
- "$"
38972
-
description: The accepted operators you can use to define how you want to
38973
-
search for the value.
38982
+
description: |-
38983
+
The accepted operators you can use to define how you want to search for the value. Operator support depends on the field's data type. The breakdown below is for Contacts search; the other search endpoints that share this schema accept a different set per field:
- `datetime` fields (standard contact timestamps such as `created_at` and `last_seen_at`): `=`, `!=`, `<`, `>`, `<=`, `>=`. Filtering is on the exact second, in UTC.
38989
+
- `date` fields (Date custom attributes): `=`, `<`, `>` only. `!=`, `<=`, and `>=` are not supported and return an error. Values are truncated to a whole UTC day.
0 commit comments