Skip to content

Add full CRUD operations for Audiences API (Preview)#502

Open
kilian-tennyson wants to merge 5 commits into
mainfrom
kilian-tennyson/add-audiences-delete-api
Open

Add full CRUD operations for Audiences API (Preview)#502
kilian-tennyson wants to merge 5 commits into
mainfrom
kilian-tennyson/add-audiences-delete-api

Conversation

@kilian-tennyson
Copy link
Copy Markdown
Contributor

@kilian-tennyson kilian-tennyson commented May 19, 2026

Audiences API — OpenAPI Spec (Full CRUD)

Adds all five Audiences API endpoints to the Preview OpenAPI spec:

  • GET /audiences (listAudiences) — already on main
  • GET /audiences/{id} (retrieveAudience) — in this PR
  • POST /audiences (createAudience) — in this PR
  • PUT /audiences/{id} (updateAudience) — in this PR
  • DELETE /audiences/{id} (deleteAudience) — in this PR

Schema updates

  • audience schema: added predicates, role_predicates, default_predicates array fields
  • Added create_audience_request and update_audience_request request body schemas
  • Fixed id param type from integer to string (API returns stringified IDs)
  • Fixed operationId from getAudience to retrieveAudience (matches existing convention)
  • Updated all examples to include predicate arrays

Cross-references

  • Monolith PRs: intercom/intercom#511493 (show), intercom/intercom#512085 (delete), intercom/intercom#512681 (create), intercom/intercom#513478 (update)
  • Developer docs: intercom/developer-docs#904

kilian-tennyson and others added 2 commits May 19, 2026 10:32
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@kilian-tennyson kilian-tennyson self-assigned this May 19, 2026
- Add POST /audiences (create) with 201 response
- Add PUT /audiences/{id} (update) with request body
- Add create_audience_request and update_audience_request schemas
- Add predicates, role_predicates, default_predicates to audience schema
- Fix operationId: getAudience → retrieveAudience (matches convention)
- Fix id param type: integer → string (API returns stringified IDs)
- Update all examples to include predicate arrays
@kilian-tennyson kilian-tennyson changed the title Add DELETE /audiences/{id} operation Add full CRUD operations for Audiences API (Preview) May 27, 2026
- Define predicate component schema once under components/schemas
- Replace 6 inline predicate definitions with $ref pointers
- Add readOnly: true to id, created_at, updated_at in audience schema
- Add descriptions and examples to all predicate properties

Addresses Docly review findings 1-4 on PR #502.
Comment thread descriptions/0/api.intercom.io.yaml Outdated
comparison: eq
value: VIP
role_predicates: []
default_predicates: []
Copy link
Copy Markdown
Contributor

@bhavishnadar bhavishnadar May 27, 2026

Choose a reason for hiding this comment

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

don't we need default_predicates on updates as well ?

… create

- Remove default_predicates from all response examples and audience schema
- Show default role_predicates values in create example
- Add role_predicates to create_audience_request schema
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