# Delete Twin Doc

This endpoint deletes the given Doc of the given Twin.

Method Path Operation*
DELETE /twins/{twin}/docs/{doc_name} delete_twin_doc

*

In order for a user to perform the "delete_twin_doc" operation, the "delete_twin_doc" permission must be included in the list of allowed actions in the statement of the user's role.

# Request

Parameter Type In Description
{twin}
required
string path Twin UUID.
doc_name
required
string path Name of the Doc. It must match the regular expression(opens new window) ^([a-zA-Z0-9_-]{1,32}\/){0,5}([a-zA-Z0-9_-]{1,32})(.[a-zA-Z0-9]{1,8})?$. It must be unique in the context of the Twin.

# Response

The response returns the details of the deleted Doc.

Attribute Type Description
creation_certificate dictionary
Certificate generated automatically by the system upon sending a request to copy the Doc (attach_twin_doc endpoint). It cannot be modified after it has been generated.
Attribute Type Description
created_ts timestamp Time at which the Doc was created. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
creator string Account UUID of the account creating the Doc.
hash * string SHA-256 hash(opens new window).
size integer Size of the Doc in bytes.
storage_class string, value can be "access_optimized" or "cost_optimized" Storage class of the Doc:
- "access_optimized": Storage class for frequently accessed data.
- "cost_optimized": Storage class for automatic cost savings for less frequently accessed data.
Once the Doc has been copied and attached to a Twin, the "storage_class" cannot be changed.
status string, value can be "copying", "ok", "error", or "hash_mismatch" Status of the Doc:
- "copying": The Doc is in the process of being copied.
- "ok": The copy of the Doc has been successfully generated. It is attached to the Twin and stored in the Twin's directory.
- "hash_mismatch": The "hash" provided in the request does not match the hash of the Doc. A copy of the Doc could not be generated.
- "error": An error occurred and a copy of the Doc could not be generated.
updated_ts timestamp Time at which the Doc was last updated. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
description dictionary User-defined key-value pairs:
- key: It must match the regular expression(opens new window) ^[a-z_][0-9a-z_]{0,63}$.
- value: JSON compliant value.
For more details consult the description field section.

*

The "hash" attribute is only displayed in the "creation_certificate" if it was provided in the request to the attach_twin_doc endpoint.

# Status codes

Requests to this endpoint result in generic status codes. For a comprehensive list of status codes, please consult the Status codes section.

Was this article helpful?