Skip to content

Commit d9c0e71

Browse files
levindixonclaude
andcommitted
docs(api): Enhance macro retrieval endpoint documentation (intercom/intercom#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]>
1 parent 0901716 commit d9c0e71

File tree

1 file changed

+54
-20
lines changed

1 file changed

+54
-20
lines changed

descriptions/0/api.intercom.io.yaml

Lines changed: 54 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9338,55 +9338,75 @@ paths:
93389338
- name: id
93399339
in: path
93409340
required: true
9341-
description: The ID of the macro to retrieve
9341+
description: The unique identifier of the macro
93429342
schema:
93439343
type: string
93449344
example: "123"
93459345
tags:
93469346
- Macros
93479347
operationId: getMacro
93489348
description: |
9349-
You can fetch a single macro by its ID.
9349+
You can fetch a single macro (saved reply) by its ID. The macro will only be returned if it is visible to the authenticated user based on its visibility settings.
9350+
9351+
**Visibility Rules**
9352+
9353+
A macro is returned based on its `visible_to` setting:
9354+
- `everyone`: Always visible to all team members
9355+
- `specific_teams`: Only visible if the authenticated user belongs to one of the teams specified in `visible_to_team_ids`
9356+
9357+
If a macro exists but is not visible to the authenticated user, a 404 error is returned.
93509358

93519359
**Placeholder Transformation**
93529360

9353-
The API transforms Intercom placeholders to a more standard XML-like format:
9361+
The API transforms Intercom placeholders to a more standard XML-like format in the `body` field:
93549362
- From: `{{user.name | fallback: 'there'}}`
93559363
- To: `<attribute key="user.name" default="there"/>`
9364+
9365+
Default values in placeholders are HTML-escaped for security.
93569366
responses:
93579367
'200':
93589368
description: Macro found
93599369
content:
93609370
application/json:
93619371
examples:
9362-
Macro found:
9372+
Macro visible to everyone:
93639373
value:
93649374
type: macro
93659375
id: "123"
93669376
name: "Order Status Update"
9367-
body: "<p>Hi <attribute key=\"user.name\" default=\"there\"/>, your order #<attribute key=\"order.number\"/> is ready!</p>"
9368-
body_text: "Hi there, your order is ready!"
9377+
body: "<p>Hi <attribute key=\"user.name\" default=\"there\"/>, your order #<attribute key=\"order.number\"/> is ready for pickup!</p>"
9378+
body_text: "Hi there, your order is ready for pickup!"
93699379
created_at: 1719474966
93709380
updated_at: 1719493757
93719381
visible_to: "everyone"
93729382
visible_to_team_ids: []
93739383
available_on: ["inbox", "messenger"]
9374-
schema:
9375-
"$ref": "#/components/schemas/macro"
9376-
'404':
9377-
description: Macro not found
9378-
content:
9379-
application/json:
9380-
examples:
9381-
Macro not found:
9384+
Macro with team restrictions:
93829385
value:
9383-
type: error.list
9384-
request_id: bc300b1a-492a-405f-924e-a5881cb72e3a
9385-
errors:
9386-
- code: not_found
9387-
message: Macro not found
9386+
type: macro
9387+
id: "456"
9388+
name: "VIP Customer Support"
9389+
body: "<p>Dear <attribute key=\"user.name\" default=\"valued customer\"/>, we appreciate your VIP status. Your dedicated support team is here to help.</p>"
9390+
body_text: "Dear valued customer, we appreciate your VIP status. Your dedicated support team is here to help."
9391+
created_at: 1719474966
9392+
updated_at: 1719493757
9393+
visible_to: "specific_teams"
9394+
visible_to_team_ids: ["789", "012"]
9395+
available_on: ["inbox"]
9396+
Macro with complex placeholders:
9397+
value:
9398+
type: macro
9399+
id: "789"
9400+
name: "Account Summary"
9401+
body: "<p>Hello <attribute key=\"user.name\" default=\"there\"/>!</p><p>Your account balance is <attribute key=\"account.balance\" default=\"not available\"/>.</p><p>Last login: <attribute key=\"user.last_login\" default=\"never\"/></p>"
9402+
body_text: "Hello there! Your account balance is not available. Last login: never"
9403+
created_at: 1719474966
9404+
updated_at: 1719493757
9405+
visible_to: "everyone"
9406+
visible_to_team_ids: []
9407+
available_on: ["inbox", "messenger"]
93889408
schema:
9389-
"$ref": "#/components/schemas/error"
9409+
"$ref": "#/components/schemas/macro"
93909410
'401':
93919411
description: Unauthorized
93929412
content:
@@ -9415,6 +9435,20 @@ paths:
94159435
message: Token does not have the required 'read_conversations' scope
94169436
schema:
94179437
"$ref": "#/components/schemas/error"
9438+
'404':
9439+
description: Macro not found or not accessible
9440+
content:
9441+
application/json:
9442+
examples:
9443+
Macro not found:
9444+
value:
9445+
type: error.list
9446+
request_id: bc300b1a-492a-405f-924e-a5881cb72e3a
9447+
errors:
9448+
- code: not_found
9449+
message: Macro not found
9450+
schema:
9451+
"$ref": "#/components/schemas/error"
94189452
"/messages":
94199453
post:
94209454
summary: Create a message

0 commit comments

Comments
 (0)