Delete Draft post from the API - getting not_found error

Hi,

I’m trying to delete a draft using the API:

DELETE /drafts/{draft_key}.json

The draft exists (verified via GET /drafts.json) and I’m using the correct draft_key and sequence.

API Request (Postman / backend)

DELETE https://<base_url>/drafts/{draft_key}.json

Headers:

Api-Key: <api_key>
Api-Username: <username>
Content-Type: application/x-www-form-urlencoded / application/json

Body (tried both):

x-www-form-urlencoded:

draft_key=new_topic_xxxxx
sequence=12

or raw JSON:

{
  "draft_key": "new_topic_xxxxx",
  "sequence": 12
}

Response

{
  "errors": ["The requested URL or resource could not be found."],
  "error_type": "not_found"
}

From UI (works)

The same delete works from the browser using:

  • DELETE /drafts/{draft_key}.json

  • form data: draft_key + sequence

  • session cookies + CSRF token

Question

Is draft deletion supported via API key auth, same as the other APIs? If supported, what is the correct way to call this endpoint?

Thanks.

Have you tried passing the username as a query param as well? (aka. adding ?username=<username> to the URL)

Looks like we were not being quite consistent with how we allowed the API to fall-back to the Api-Username username when no username query param was being provided.

That should be fixed with