Add full CRUD operations for Audiences API (Preview)#502
Open
kilian-tennyson wants to merge 5 commits into
Open
Add full CRUD operations for Audiences API (Preview)#502kilian-tennyson wants to merge 5 commits into
kilian-tennyson wants to merge 5 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- 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
- 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.
bhavishnadar
approved these changes
May 27, 2026
| comparison: eq | ||
| value: VIP | ||
| role_predicates: [] | ||
| default_predicates: [] |
Contributor
There was a problem hiding this comment.
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
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.
Audiences API — OpenAPI Spec (Full CRUD)
Adds all five Audiences API endpoints to the Preview OpenAPI spec:
GET /audiences(listAudiences) — already on mainGET /audiences/{id}(retrieveAudience) — in this PRPOST /audiences(createAudience) — in this PRPUT /audiences/{id}(updateAudience) — in this PRDELETE /audiences/{id}(deleteAudience) — in this PRSchema updates
audienceschema: addedpredicates,role_predicates,default_predicatesarray fieldscreate_audience_requestandupdate_audience_requestrequest body schemasidparam type fromintegertostring(API returns stringified IDs)operationIdfromgetAudiencetoretrieveAudience(matches existing convention)Cross-references