Use audiences to filter your API
Use x-fern-audiences
to filter to relevant endpoints, schemas and properties
Audiences are a useful tool for segmenting your API for different consumers. Common examples of audiences include public
and beta
.
Remember to filter your SDKs and Docs after specifying audiences. If no audiences are specified, nothing will be filtered.
SDKs
The following example configures the SDK to filter to the public
audience:
Docs
The following example configures the docs to filter to the public
audience:
Audiences for servers
To mark a server with a particular audience, add the x-fern-server-name
and x-fern-audiences
extension to the relevant server.
In the example below, the Production
server is only available to public consumers:
Audiences for endpoints
To mark an endpoint with a particular audience, add the x-fern-audiences
extension to the relevant endpoint.
In the example below, the POST /users/sendEmail
endpoint is only available to public consumers:
Audiences for schemas
Schemas can be marked for different audiences, as well.
In this example, the Email
type is available to both public and beta customers.
Audiences for properties
Properties can be marked for different audiences, as well.
In this example, the to
property is available to beta customers only.