Conversation
Add audience_id and apply_audience_to_existing_content fields to the Preview OpenAPI spec (descriptions/0/) for Content Import Sources, per intercom/intercom#497303. Changes: - content_import_source response schema: add audience_id (nullable integer) - create_content_import_source_request: add optional audience_id - update_content_import_source_request: add optional audience_id and apply_audience_to_existing_content (boolean, default false) - All inline response examples updated with audience_id: null
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
PR intercom/intercom#497303 added audience targeting to the Content Import Sources public API but deferred the OpenAPI schema changes. Without this follow-up, the new
audience_idandapply_audience_to_existing_contentparameters are undocumented for SDK and developer-docs consumers.How?
Update the Preview OpenAPI spec (
descriptions/0/api.intercom.io.yaml) to addaudience_idto the response and create/update request schemas, addapply_audience_to_existing_contentto the update request schema, and includeaudience_id: nullin the inline response examples.Decisions
audience_idas a nullable integer (matching the existingparent_folder_idpattern) sonullcan represent "no audience" and the explicit-remove semanticsaudience_id: nullin all response examples to reflect the default unset stateReview Guidance
░░░░░░░░░░ 0.8Why
Single-file YAML additions to three schemas plus example updates, no cross-cutting impact.░░░░░░░░░░ 0.5Why
Diff matches the plan's line-by-line prescription precisely.░░░░░░░░░░ 0.6Why
Documentation-only spec file; no runtime, auth, or data paths touched.Attention: Routine review — Mechanical OpenAPI spec additions matching the plan exactly — schema fields and example updates only.
🧪 This AI-generated review guidance is experimental. Share feedback
Implementation Plan
Worker Implementation Plan
Plan: Add audience targeting fields to Content Import Source Preview spec
Context
PR intercom/intercom#497303 added audience targeting to the Content Import Sources API (
POST/PUT /ai/content_sources). The OpenAPI spec changes were explicitly deferred. This order adds the missingaudience_idandapply_audience_to_existing_contentfields to the Preview spec (descriptions/0/api.intercom.io.yaml).Only the Preview spec (version 0) needs updating — these parameters are gated to Unstable/Preview.
Target File
descriptions/0/api.intercom.io.yaml— single file, all changes below.Changes Required
1. Response schema:
content_import_source(line ~20959)Add
audience_idproperty before therequiredblock (afterupdated_at):This is a nullable integer — the field is
nullwhen no audience is set (or when removed by setting tonull).2. Create request schema:
create_content_import_source_request(line ~22289)Add
audience_idproperty afterurl:Not required (optional on create).
3. Update request schema:
update_content_import_source_request(line ~28397)Add two properties after
url:Neither is required.
4. Inline response examples — add
audience_id: nullto ALL response examplesEach response example for content import sources needs the new field. Add
audience_id: nullafter existing fields in each example:GET list (lines 637-660) — 3 items in the
dataarray, each getsaudience_id: nullupdated_at: 1734537259)updated_at: 1734537259)updated_at: 1734537259)POST create (lines 703-711) — after line 711 (
updated_at: 1734537261)GET single (lines 795-803) — after line 803 (
updated_at: 1734537265)PUT update (lines 838-846) — after line 846 (
updated_at: 1734537267)All examples use
audience_id: nullsince the example scenarios don't set an audience.5. POST create request example (lines 736-738)
No change needed —
audience_idis optional and the example shows a minimal create.6. PUT update request example (lines 871-873)
No change needed —
audience_idis optional and the example shows a minimal update.Validation
After all edits:
fern checkto validate the spec (requiresnpm install -g fern-apior use npx)Conventions to Follow
type: integer+nullable: true(nox-nullable, see existingparent_folder_idpattern)type,description,example; addnullablewhen applicabledefaultandexample$ref)Commit
Single commit:
Add audience targeting fields to Content Import Source Preview specParthas Order (task/issue)
Generate OpenAPI spec changes for audience targeting on Content Import Sources
Problem
PR intercom/intercom#497303 added audience targeting to the Content Import Sources public API (
POST/PUT /ai/content_sources) but explicitly excluded OpenAPI schema changes: "OpenAPI schema changes excluded — will be handled in a separate follow-up PR." This is that follow-up.The PR is shipping today. The OpenAPI spec needs to be updated to document the new API surface.
Why This Matters
Without the spec update, the new
audience_idandapply_audience_to_existing_contentparameters are undocumented — SDK users and developer-docs consumers will not know they exist.What Changed in the Intercom Monolith
PR: https://github.com/intercom/intercom/pull/497303
Changes (Unstable/Preview API only):
POST /ai/content_sources— new optionalaudience_idrequest parameter (integer)PUT /ai/content_sources/:id— new optionalaudience_id(integer) andapply_audience_to_existing_content(boolean, default false) request parametersGET /ai/content_sources/:idandGET /ai/content_sources— response now includesaudience_idfield (integer, nullable)audience_idtonullremoves the audienceaudience_idreturns 400 errorGoal
The Preview OpenAPI spec (
descriptions/0/api.intercom.io.yaml) reflects the new audience targeting parameters and response fields.How
Use the
generate-openapi-from-prskill with PR https://github.com/intercom/intercom/pull/497303 as input. The skill will analyze the diff and generate the appropriate YAML changes.Acceptance Criteria
audience_idin Content Import Source request schemas (create and update)apply_audience_to_existing_contentin update request schemaaudience_idin Content Import Source response schemafern checkpassesGenerated with Claude Code, zen coded with Parthas