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.

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:

openapi.yml
1servers:
2 - url: https://api.com
3 x-fern-server-name: Production
4 x-fern-audiences:
5 - public

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:

openapi.yml
1paths:
2 /users/sendEmail:
3 post:
4 x-fern-audiences:
5 - public
6 operationId: send_email

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.

openapi.yml
1components:
2 schemas:
3 Email:
4 title: Email
5 type: object
6 properties:
7 subject:
8 type: string
9 body:
10 type: string
11 to:
12 type: string
13 x-fern-audiences:
14 - public
15 - beta

Audiences for properties

Properties can be marked for different audiences, as well.

In this example, the to property is available to beta customers only.

openapi.yml
1components:
2 schemas:
3 Email:
4 title: Email
5 type: object
6 properties:
7 subject:
8 type: string
9 body:
10 type: string
11 to:
12 type: string
13 x-fern-audiences:
14 - beta