Skip to main content

Subscription API - Delete

Written by Marcus Warren

Use this endpoint to delete a subscription from your account.


Endpoint

DELETE https://e1.envoke.com/v2/subscriptions/{ID}

Replace {ID} with the Envoke subscription ID you want to delete. Authentication is via HTTP Basic Auth using your API ID and API Key.


Important

A subscription cannot be deleted while contacts are assigned to it. If any contacts are currently subscribed, the API returns a validation error. You must remove all assigned contacts first using the DELETE /subscriptions/{ID}/contacts endpoint, then retry the delete.

Deletion is permanent. Once all contacts have been removed and the subscription is deleted, it cannot be recovered via the API.


Response

Success

{   "success": true,   "result_text": "Deleted",   "result_data": [] }

Subscription has contacts assigned

{   "success": false,   "result_text": "Validation failed, see 'result_data' -> 'errors'",   "result_data": {     "errors": ["Cannot delete a subscription that has contacts assigned to it"]   } }

Subscription not found

{   "success": false,   "result_text": "Validation failed, see 'result_data' -> 'errors'",   "result_data": {     "errors": ["Item with id '999999' not found"]   } }

Example

curl -X DELETE -gs \   -u "$API_ID:$API_KEY" \   "https://e1.envoke.com/v2/subscriptions/12"

Replace 12 with the ID of the subscription you want to delete, and substitute your actual API ID and API Key.


Note: The curl examples above are formatted for readability. All requests must use properly encoded URLs.

For code examples and interactive testing, visit api.envoke.com.

Did this answer your question?