Skip to navigation

Delete publication OAuth Scope: publications:write

Currently in beta

This endpoint is currently in beta and is not yet available to every workspace.

Deletes a publication the same way deleting it from the workspace settings in the app does. This also deletes its subscribers, segments, metrics, and other associated data, frees its subdomain, removes its custom domains, removes its Stripe payout account, and cancels its paid subscriptions. Contact support if a publication was deleted by mistake.

To confirm the deletion, confirm_name must exactly match the publication’s current name. A mismatch is rejected with a 400 and the code PUBLICATION_NAME_MISMATCH. Omitting confirm_name is rejected with a 400 and the code NOT_EXIST_REQUIRED_KEY, the same as any other missing required field.

A workspace must keep at least one publication. Deleting the last one is rejected with a 422 and the code LAST_PUBLICATION_IN_WORKSPACE.

The deletion runs in the background, so this endpoint answers 202. Once it finishes, getting the publication returns a 404.

This endpoint requires an API key with access to every publication in the workspace.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

publicationIdstringRequiredformat: "^(pub_[0-9a-fA-F\-]+)$"
The prefixed ID of the publication to delete

Request

This endpoint expects an object.
confirm_namestringRequired
The publication's current name, exactly as it appears in the app.

Response

Accepted
dataobject

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error