openapi: 3.2.0 info: title: Reference Data Deletion API version: 1.0.0 servers: - url: https://api.beehiiv.com/v2 description: Default tags: - name: Data Deletion 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. API keys restricted to specific publications cannot access this endpoint and will receive a 403 response, since deletion requests apply to the entire workspace.' tags: - Data Deletion 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' '401': description: Unauthorized. The API key or OAuth access token is missing, invalid, or expired. 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. API keys restricted to specific publications cannot access this endpoint and will receive a 403 response, since deletion requests apply to the entire workspace.' tags: - Data Deletion 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' '401': description: Unauthorized. The API key or OAuth access token is missing, invalid, or expired. 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' '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. API keys restricted to specific publications cannot access this endpoint and will receive a 403 response, since deletion requests apply to the entire workspace.' tags: - Data Deletion 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' '401': description: Unauthorized. The API key or OAuth access token is missing, invalid, or expired. 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' '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_ids_PublicationId: type: string description: The prefixed ID of the publication. title: PublicationId type_dataDeletion_DataDeletionRequestStatus: type: string enum: - pending - processing - completed - failed - canceled description: The current status of the data deletion request. title: DataDeletionRequestStatus 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__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_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__ErrorDetail: type: object properties: message: type: string code: type: string required: - message - code title: ErrorDetail 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 securitySchemes: BearerAuthScheme: type: http scheme: bearer