Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions source/rest-v2.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,47 @@ The following fields need to be sent within a collection scope (see the right pa
| ----- | ------ | -------- | ---------------- |
| title | String | Yes | Collection Title |

## Delete a collection

### HTTP Request

`DELETE https://api.publitas.com/v2/groups/<Group ID>/collections/<Collection ID>`

### URL Parameters

| Parameter | Description |
| ------------- | -------------------------- |
| Group ID | The ID of a specific group |
| Collection ID | The ID of the collection to delete |

```shell
curl -X DELETE "https://api.publitas.com/v2/groups/1/collections/42" \
-H "Authorization: ApiKey <api_key>"
```

### Response codes

| Code | Description |
| ---- | ----------- |
| 204 | No Content - Collection successfully deleted |
| 403 | Forbidden - Invalid API key or insufficient permissions |
| 404 | Not Found - Collection does not exist |
| 409 | Conflict - Collection cannot be deleted because it contains publications |

### Error responses

When a collection cannot be deleted because it contains publications, the API returns a 409 Conflict status with the following error message:

```json
{
"error": "You can't delete this collection. It must be empty."
}
```

<aside class="notice">
A collection can only be deleted if it contains no publications.
</aside>

# Pages

## Add pages to publication
Expand Down