openapi: 3.1.0 info: title: API Reference subpackage_advertisement_opportunities subpackage_dataDeletion API version: 1.0.0 servers: - url: https://api.beehiiv.com/v2 tags: - name: subpackage_dataDeletion paths: /publications/{publicationId}/data_privacy/deletion_requests: post: operationId: create summary: 'Create data deletion request OAuth Scope: data_deletion:write' description: 'This is a gated feature that requires enablement. Contact support to enable Data Deletion API access for your organization. Creates a data deletion request for a subscriber within your organization. The subscriber''s data will be redacted from all publications in the organization after a 14-day safety delay. This action cannot be undone once processing begins.' tags: - subpackage_dataDeletion parameters: - name: publicationId in: path description: The prefixed ID of the publication object required: true schema: $ref: '#/components/schemas/type_ids:PublicationId' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/type_dataDeletion:DataDeletionRequestResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/type_:Error' '403': description: Forbidden content: application/json: schema: $ref: '#/components/schemas/type_:Error' '404': description: Resource Not Found content: application/json: schema: $ref: '#/components/schemas/type_:Error' '409': description: Conflict 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' requestBody: content: application/json: schema: type: object properties: email: type: string description: The email address of the subscriber to delete. required: - email get: operationId: index summary: 'List data deletion requests OAuth Scope: data_deletion:read' description: 'This is a gated feature that requires enablement. Contact support to enable Data Deletion API access for your organization. List all data deletion requests for your organization.' tags: - subpackage_dataDeletion parameters: - name: publicationId in: path description: The prefixed ID of the publication object required: true schema: $ref: '#/components/schemas/type_ids:PublicationId' - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/type_dataDeletion:DataDeletionRequestIndexResponse' '403': description: Forbidden 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}/data_privacy/deletion_requests/{id}: get: operationId: show summary: 'Get data deletion request OAuth Scope: data_deletion:read' description: 'This is a gated feature that requires enablement. Contact support to enable Data Deletion API access for your organization. Retrieve the details and current status of a specific data deletion request.' tags: - subpackage_dataDeletion parameters: - name: publicationId in: path description: The prefixed ID of the publication object required: true schema: $ref: '#/components/schemas/type_ids:PublicationId' - name: id in: path description: The ID of the data deletion request required: true schema: type: string - name: Authorization in: header description: Bearer authentication required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/type_dataDeletion:DataDeletionRequestResponse' '403': description: Forbidden 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_dataDeletion:DataDeletionRequestIndexResponse: type: object properties: data: type: array items: $ref: '#/components/schemas/type_dataDeletion:DataDeletionRequestInfo' limit: type: integer description: The limit placed on the results. If no limit was specified in the request, this defaults to 10. has_more: type: boolean description: Whether there are more results available after this page. next_cursor: type: string description: The cursor to use for the next page of results. title: DataDeletionRequestIndexResponse type_dataDeletion:DataDeletionRequestResponse: type: object properties: data: $ref: '#/components/schemas/type_dataDeletion:DataDeletionRequestInfo' title: DataDeletionRequestResponse 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_dataDeletion:DataDeletionRequestSource: type: string enum: - zendesk - retool - website - app - public_api - other description: The source from which the deletion request was created. title: DataDeletionRequestSource type_dataDeletion:DataDeletionRequestInfo: type: object properties: id: type: string email: type: string status: $ref: '#/components/schemas/type_dataDeletion:DataDeletionRequestStatus' source: $ref: '#/components/schemas/type_dataDeletion:DataDeletionRequestSource' requested_at: type: string scheduled_for_processing_at: type: string completed_at: type: string created_at: type: string title: DataDeletionRequestInfo type_:ErrorDetail: type: object properties: message: type: string code: type: string required: - message - code title: ErrorDetail type_dataDeletion:DataDeletionRequestStatus: type: string enum: - pending - processing - completed - failed - canceled description: The current status of the data deletion request. title: DataDeletionRequestStatus securitySchemes: BearerAuthScheme: type: http scheme: bearer