Delete a data export
This endpoint is only available to organization administrators.
DELETE https://chat.zulip.org/api/v1/export/realm/{export_id}
Delete a completed public or standard data export
of the organization.
Data exports that happened on a previous server (i.e., an export
with "export_from_prior_server": true in the
GET /export/realm response)
cannot be deleted using this endpoint, since their tarball is no
longer stored on this server; attempting to do so fails with
the same error as for an export that has already been deleted.
This endpoint's success response does not describe the resulting
state of the organization's data exports. Clients should rely
on the realm_export event,
which every organization administrator receives whenever a
data export's state changes, for the current state of an
organization's data exports.
Changes: Prior to Zulip 13.0 (feature level 506), data
exports without a tarball stored on this server had no
dedicated status, so attempting to delete one resulted in an
unexpected error. Starting at that feature level, such a
delete attempt instead fails cleanly, as described above. This
change was also backported to the Zulip 12.x series, at
feature level 499.
New in Zulip 2.1.
Usage examples
#!/usr/bin/env python
import zulip
# The user for this zuliprc file must be an organization administrator
client = zulip.Client(config_file="~/zuliprc-admin")
# Delete a completed public or standard data export.
result = client.call_endpoint(url=f"/export/realm/{export_id}", method="DELETE")
print(result)
The -u line implements HTTP Basic authentication.
See the Authorization header documentation for how
to get those credentials for Zulip users and bots.
curl -sSX DELETE https://chat.zulip.org/api/v1/export/realm/1 \
-u EMAIL_ADDRESS:API_KEY
Parameters
export_id integer required in path
Example: 1
The ID of the data export to be deleted.
Response
Example response(s)
Changes: As of Zulip 7.0 (feature level 167), if any
parameters sent in the request are not supported by this
endpoint, a successful JSON response will include an
ignored_parameters_unsupported array.
A typical successful JSON response may look like:
{
"msg": "",
"result": "success"
}
A typical failed JSON response for an invalid data export ID.
{
"code": "BAD_REQUEST",
"msg": "Invalid data export ID",
"result": "error"
}