Skip to content

Conversation

levindixon
Copy link
Contributor

@levindixon levindixon commented Jul 29, 2025

Towards https://github.com/intercom/intercom/issues/420117

Macros API v1 PR: https://github.com/intercom/intercom/pull/419604

Summary

  • Added new Macros API endpoints (GET /macros GET /macros/{id}) to OpenAPI spec
  • Added Macro and MacroList schema definitions
  • Generated Postman collection with comprehensive examples

Changes

  • descriptions/0/api.intercom.io.yaml: Added Macros API endpoint and schemas
  • postman/Unstable/intercom-api.postman_collection.json: Generated collection with examples

Test plan

  • Verify OpenAPI spec validates correctly
  • Test Postman collection examples work as expected
  • Confirm schema definitions match implementation

🤖 Generated with Claude Code

levindixon and others added 5 commits July 28, 2025 16:53
…rcom#420117)

Add the Macro object schema to the Unstable API specification. This schema
represents saved replies (macros) that can be used for quick responses in
conversations.

Schema includes:
- Basic fields: type, id, name
- Content fields: body (HTML with transformed placeholders), body_text
- Timestamps: created_at, updated_at (Unix timestamps)
- Visibility controls: visible_to, visible_to_team_ids
- Availability: available_on array for inbox/messenger

The schema follows the implementation in MacroPresenter and includes the
placeholder transformation feature where mustache-style placeholders are
converted to XML-like attribute tags.

Part of: intercom/intercom#420117
…tercom#420117)

- Add MacroList schema to support paginated list responses for macros
- Follow established pattern with type "list" and data array
- Implement cursor-based pagination with starting_after parameter
- Include Base64-encoded cursor for stable pagination ([updated_at, id] tuples)
- Reference existing macro schema for data items
- Add x-tags: Unstable to match macro visibility

This schema will be used by the GET /macros endpoint to return paginated
lists of saved reply templates.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…m#420117)

Add GET /macros and GET /macros/{id} endpoint definitions to the Unstable OpenAPI specification for the new Macros API.

Changes:
- Add GET /macros endpoint with cursor-based pagination
  - Query parameters: per_page (1-150, default 50), starting_after (Base64 cursor), updated_since (Unix timestamp)
  - Returns paginated list of macros with MacroList schema
  - Documents placeholder transformation from Intercom to XML-like format
- Add GET /macros/{id} endpoint for single macro retrieval
  - Path parameter: id (macro identifier)
  - Returns single macro with Macro schema
- Add Macros tag to tags section in alphabetical order
- Include comprehensive examples and error responses (400, 401, 403, 404)
- Document OAuth scope requirement (read_conversations)

The endpoints follow existing patterns in the OpenAPI spec and accurately reflect the implementation in PR #419604.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…ntercom#420117)

- Clarify macro visibility rules and team-based access control
- Add detailed explanation of when macros are accessible vs return 404
- Expand examples to show team-restricted and complex placeholder scenarios
- Document HTML escaping behavior for placeholder default values
- Improve parameter description for clarity

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…ntercom/intercom#420117)

Add complete Postman collection for the new Macros API endpoints including:
- List all macros endpoint with basic pagination
- List macros with cursor-based pagination example
- List macros filtered by update timestamp
- Complex example combining multiple query parameters
- Get single macro by ID with error responses

Each request includes:
- Proper Bearer token authentication setup
- Required Intercom-Version header for Unstable API
- Detailed parameter descriptions and usage notes
- Example responses showcasing placeholder transformation
- Test scripts for response validation and cursor handling

The collection provides developers with executable examples to quickly
test and integrate the Macros API without writing code first.

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>
@levindixon levindixon changed the title feat(api): Add Macros API endpoints to OpenAPI spec Add Macros API endpoints to OpenAPI spec Jul 29, 2025
…ntercom/intercom#420117)

- Changed timestamp fields from integer/int64 to string/date-time format
- Updated all timestamp examples to ISO 8601 format
- Added body_text and visible_to_team_ids to required fields
- Clarified placeholder transformation behavior in documentation
- Regenerated Postman collection with corrected schema

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@levindixon levindixon marked this pull request as ready for review July 31, 2025 08:00
@levindixon levindixon requested a review from a team July 31, 2025 08:00
levindixon and others added 2 commits July 31, 2025 11:37
…endpoints (intercom/intercom#420117)

- Add code samples in cURL, Node.js, Python, and Ruby for both endpoints
- Expand response examples with multiple scenarios including pagination, filtering, and various macro types
- Improve error response examples with clearer messaging
- Fix tags from 'Unstable' to 'Macros' for proper categorization
- Enhance tag description for better API documentation navigation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
… schemas (intercom/intercom#420117)

- Remove overly restrictive required field definitions from macro and macro_list schemas
- Update Postman collection timestamps
- Simplify placeholder transformation descriptions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copy link
Contributor

@davymalone davymalone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@davymalone davymalone requested a review from a team August 1, 2025 08:33
@levindixon levindixon merged commit 551f8eb into main Aug 1, 2025
6 checks passed
@levindixon levindixon deleted the levin.dixon/420117-macros-api-v1-docs branch August 1, 2025 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants