openapi: 3.1.0 info: title: API Reference subpackage_advertisement_opportunities subpackage_newsletterLists API version: 1.0.0 servers: - url: https://api.beehiiv.com/v2 tags: - name: subpackage_newsletterLists paths: /publications/{publicationId}/newsletter_lists: get: operationId: index summary: 'List newsletter lists Beta OAuth Scope: newsletter_lists:read' description: "\n Newsletter Lists is currently in beta, the API is subject to change.\n\nList all newsletter lists for a publication." tags: - subpackage_newsletterLists parameters: - name: publicationId in: path description: The prefixed ID of the publication object required: true schema: $ref: '#/components/schemas/type_ids:PublicationId' - name: limit in: query description: A limit on the number of objects to be returned. The limit can range between 1 and 100, and the default is 10. required: false schema: type: integer - name: page in: query description: 'Pagination returns the results in pages. Each page contains the number of results specified by the `limit` (default: 10).
If not specified, results 1-10 from page 1 will be returned.' required: false schema: type: integer - name: direction in: query description: The direction that the results are sorted in. Defaults to asc
`asc` - Ascending, sorts from smallest to largest.
`desc` - Descending, sorts from largest to smallest. required: false schema: $ref: '#/components/schemas/type_:RequestDirection' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/type_newsletterLists:NewsletterListIndexResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/type_:Error' '404': description: Resource Not Found content: application/json: schema: $ref: '#/components/schemas/type_:Error' '429': description: Rate Limit Exceeded content: application/json: schema: $ref: '#/components/schemas/type_:Error' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/type_:Error' /publications/{publicationId}/newsletter_lists/{newsletterListId}: get: operationId: show summary: 'Get newsletter list Beta OAuth Scope: newsletter_lists:read' description: "\n Newsletter Lists is currently in beta, the API is subject to change.\n\nRetrieve a single newsletter list belonging to a specific publication." tags: - subpackage_newsletterLists parameters: - name: publicationId in: path description: The prefixed ID of the publication object required: true schema: $ref: '#/components/schemas/type_ids:PublicationId' - name: newsletterListId in: path description: The prefixed ID of the newsletter list object required: true schema: $ref: '#/components/schemas/type_ids:NewsletterListId' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/type_newsletterLists:NewsletterListResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/type_:Error' '404': description: Resource Not Found content: application/json: schema: $ref: '#/components/schemas/type_:Error' '429': description: Rate Limit Exceeded content: application/json: schema: $ref: '#/components/schemas/type_:Error' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/type_:Error' components: schemas: type_newsletterLists:NewsletterListResponse: type: object properties: data: $ref: '#/components/schemas/type_newsletterLists:NewsletterListInfo' required: - data title: NewsletterListResponse type_ids:PublicationId: type: string description: The prefixed ID of the publication. title: PublicationId type_:Error: type: object properties: status: type: integer statusText: type: string errors: type: array items: $ref: '#/components/schemas/type_:ErrorDetail' required: - status - statusText - errors description: The top level error response. title: Error type_ids:NewsletterListId: type: string description: The prefixed ID of the newsletter list. title: NewsletterListId type_:ErrorDetail: type: object properties: message: type: string code: type: string required: - message - code title: ErrorDetail type_newsletterLists:NewsletterListStatus: type: string enum: - draft - active - archived description: The status of the newsletter list. title: NewsletterListStatus type_newsletterLists:NewsletterListInfo: type: object properties: id: $ref: '#/components/schemas/type_ids:NewsletterListId' description: The prefixed ID of the newsletter list. name: type: string description: The name of the newsletter list. slug: type: string description: The URL-friendly slug of the newsletter list. description: type: string description: A description of the newsletter list. status: $ref: '#/components/schemas/type_newsletterLists:NewsletterListStatus' description: The status of the newsletter list. auto_subscribe: type: boolean description: Whether new subscribers are automatically subscribed to this list. subscriber_count: type: integer description: The number of active subscribers on this list. created_at: type: integer description: The time the newsletter list was created. Measured in seconds since the Unix epoch. updated_at: type: integer description: The time the newsletter list was last updated. Measured in seconds since the Unix epoch. required: - id - name - slug - status - auto_subscribe - subscriber_count - created_at - updated_at title: NewsletterListInfo type_:RequestDirection: type: string enum: - asc - desc default: asc description: The direction of the request. Defaults to `asc`. title: RequestDirection type_newsletterLists:NewsletterListIndexResponse: type: object properties: data: type: array items: $ref: '#/components/schemas/type_newsletterLists:NewsletterListInfo' limit: type: integer description: The limit placed on the results. If no limit was specified in the request, this defaults to 10. page: type: integer default: 1 description: The page number the results are from. If no page was specified in the request, this defaults to page 1. total_results: type: integer description: The total number of results from all pages. total_pages: type: integer description: The total number of pages. required: - data - limit - page - total_results - total_pages title: NewsletterListIndexResponse securitySchemes: BearerAuthScheme: type: http scheme: bearer