Add content snippets endpoints to Unstable spec#433
Conversation
Add GET/POST /content_snippets and GET/PUT /content_snippets/{id}
endpoints with schemas for content snippet responses and requests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@claude review |
1 similar comment
|
@claude review |
- Add Content Snippets to global tags section for docs navigation - Mark title and json_blocks as required in create request schema - Add $ref to error schema on all 404 and 422 responses Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
levindixon
left a comment
There was a problem hiding this comment.
Nice work — the schemas are well-defined, error responses properly use $ref, and the global Content Snippets tag is included. Two items to fix:
1. POST /content_snippets response should be 201, not 200
The implementation in intercom#490976 returns HTTP 201 Created for the create action. The spec currently documents '200':
responses:
'200':
description: Content snippet createdShould be:
responses:
'201':
description: Content snippet created2. Update endpoint reuses content_snippet_create_request — but update supports partial updates
The PUT endpoint references content_snippet_create_request, which has:
required:
- title
- json_blocksBut the implementation supports partial updates — you can send only title without json_blocks (the service preserves existing values). Using the same schema with required fields would cause OpenAPI validators to reject valid partial update requests.
Options:
- Create a separate
content_snippet_update_requestschema withoutrequiredfields - Or remove
requiredfromcontent_snippet_create_requestand validate required fields server-side (less ideal since create needs them documented)
Everything else looks solid — consistent examples, proper error schemas, good descriptions.
|
One more small thing from verification: 3. The implementation defaults locale: locale || "en",But the locale:
type: string
description: The locale of the content snippet. Defaults to `en`.
default: en
example: enThe |
- Create content_snippet_update_request schema with no required fields to support partial updates on PUT endpoint - Add default: en to locale field in create request schema - Point PUT endpoint at the new update request schema Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
levindixon
left a comment
There was a problem hiding this comment.
All three review comments addressed — 201 status, separate update schema, locale default. Looks good.
Summary
GET /content_snippets,POST /content_snippets,GET /content_snippets/{id}, andPUT /content_snippets/{id}to the Unstable OpenAPI speccontent_snippet,content_snippet_list, andcontent_snippet_create_requestschemasContext
Companion to intercom/intercom#490976 which adds the implementation, and intercom/developer-docs PR which syncs the spec and adds a changelog entry.
API Versions Affected
descriptions/0/)🤖 Generated with Claude Code