Delete an attachment
curl --request DELETE \
--url https://api.zerogen.com/v1/projects/{projectId}/attachments/{attachmentId} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zerogen.com/v1/projects/{projectId}/attachments/{attachmentId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerogen.com/v1/projects/{projectId}/attachments/{attachmentId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text){
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"outcome": "deleted"
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}Attachments
Delete an attachment
Soft-delete an attachment while retaining all saved text and history. expectedVersion is the current version you read. An already deleted attachment returns unchanged when expectedVersion is at most the current version; a future version is refused. Restore reverses the deletion. Takes no body. Requires attachments enabled; test keys are refused.
Needs the library:organize and library:read scopes.
DELETE
/
projects
/
{projectId}
/
attachments
/
{attachmentId}
Delete an attachment
curl --request DELETE \
--url https://api.zerogen.com/v1/projects/{projectId}/attachments/{attachmentId} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zerogen.com/v1/projects/{projectId}/attachments/{attachmentId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerogen.com/v1/projects/{projectId}/attachments/{attachmentId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text){
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"outcome": "deleted"
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {
"reason": "<string>"
}
}
}Authorizations
Headers
Response
The deletion's version, or the unchanged current version.