Skip to content

Commit dea74ee

Browse files
dan0505claude
andauthored
Add 400 response for invalid sort.order on POST /contacts/search (#567)
* Add 400 response for invalid sort.order on POST /contacts/search The contacts search endpoint now returns 400 with an invalid_sort_order error when sort.order is not "ascending" or "descending". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Document contacts search sort schema and align 400 example - Add a contact_search_request schema (sort.field + sort.order enum: ascending/descending, default descending) and point POST /contacts/search at it. Conversations and tickets searches keep the shared search_request. - Add request_id to the 400 invalid_sort_order example for parity with the rest of the spec. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Clarify sort.order description on contact_search_request Reword so valid values aren't implied to 400: "Values other than `ascending` or `descending` return a 400 error" instead of "Any other value". Keeps the contacts search schema in sync with developer-docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3f4f07d commit dea74ee

1 file changed

Lines changed: 51 additions & 1 deletion

File tree

descriptions/0/api.intercom.io.yaml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8391,11 +8391,25 @@ paths:
83918391
message: Access Token Invalid
83928392
schema:
83938393
"$ref": "#/components/schemas/error"
8394+
'400':
8395+
description: Bad Request
8396+
content:
8397+
application/json:
8398+
examples:
8399+
Invalid sort order:
8400+
value:
8401+
type: error.list
8402+
request_id: 8d6c1f0a-3b2e-4a17-9c5d-1f0e2a3b4c5d
8403+
errors:
8404+
- code: invalid_sort_order
8405+
message: "Invalid sort order 'desc'. Must be one of: ascending, descending"
8406+
schema:
8407+
"$ref": "#/components/schemas/error"
83948408
requestBody:
83958409
content:
83968410
application/json:
83978411
schema:
8398-
"$ref": "#/components/schemas/search_request"
8412+
"$ref": "#/components/schemas/contact_search_request"
83998413
examples:
84008414
successful:
84018415
summary: successful
@@ -8406,6 +8420,9 @@ paths:
84068420
- field: created_at
84078421
operator: ">"
84088422
value: '1306054154'
8423+
sort:
8424+
field: created_at
8425+
order: ascending
84098426
pagination:
84108427
per_page: 5
84118428
"/contacts":
@@ -27497,6 +27514,39 @@ components:
2749727514
maxItems: 10
2749827515
required:
2749927516
- user_id
27517+
contact_search_request:
27518+
description: Search for contacts using Intercom's Search API.
27519+
type: object
27520+
title: Contact search request
27521+
properties:
27522+
query:
27523+
oneOf:
27524+
- "$ref": "#/components/schemas/single_filter_search_request"
27525+
title: Single filter search request
27526+
- "$ref": "#/components/schemas/multiple_filter_search_request"
27527+
title: multiple filter search request
27528+
pagination:
27529+
"$ref": "#/components/schemas/starting_after_paging"
27530+
sort:
27531+
type: object
27532+
description: An optional object to sort the results by.
27533+
properties:
27534+
field:
27535+
type: string
27536+
description: The field to sort the results on.
27537+
example: created_at
27538+
order:
27539+
type: string
27540+
description: The order to sort the results in. Defaults to `descending`
27541+
when omitted. Values other than `ascending` or `descending` return a
27542+
`400` error with code `invalid_sort_order`.
27543+
enum:
27544+
- ascending
27545+
- descending
27546+
default: descending
27547+
example: descending
27548+
required:
27549+
- query
2750027550
contact_segments:
2750127551
title: Segments
2750227552
type: object

0 commit comments

Comments
 (0)