Edit a draft

Edit a draft on the server. The edit will be automatically synchronized to other clients via drafts events.

PATCH https://cstheory-se.zulipchat.com/api/v1/drafts/{draft_id}

Usage examples

curl -sSX PATCH https://cstheory-se.zulipchat.com/api/v1/drafts/2 \
    -u BOT_EMAIL_ADDRESS:BOT_API_KEY \
    --data-urlencode 'draft={"content": "how tough is a Lamy Safari?", "timestamp": 1595479019, "to": [1], "topic": "questions", "type": "stream"}'

Parameters

draft_id integer required in path

Example: 2

The ID of the draft to be edited.


draft object required

Example: {"type": "stream", "to": [1], "topic": "questions", "content": "how tough is a Lamy Safari?", "timestamp": 1595479019}

A JSON-encoded object containing a replacement draft object for this ID.


Response

Example response

A typical successful JSON response may look like:

{
    "msg": "",
    "result": "success"
}

JSON response for when no draft exists with the provided ID.

{
    "msg": "Draft does not exist",
    "result": "error"
}