Remove Category from Clip#
Removes a category from an existing clip.
Endpoint#
DELETE /api/app/clips/{clipId}/categories/
Parameters#
Path Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
clipId |
string |
Yes | The unique identifier of the clip |
Request Body#
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | The GUID of the category to remove |
Authentication#
This endpoint requires authentication using your API key. See Authentication for details.
Request#
Headers#
x-storyteller-api-key: your-api-key-here
Content-Type: application/json
Example Request#
DELETE /api/app/clips/12345678-1234-1234-1234-123456789abc/categories/
Host: api.storyteller.example.com
x-storyteller-api-key: your-api-key-here
Content-Type: application/json
{
"id": "87654321-4321-4321-4321-cba987654321"
}
Response#
Success Response#
Status Code: 200 OK
{
"success": true,
"message": "Category successfully removed from clip"
}
Error Responses#
Status Code: 400 Bad Request
{
"error": "BadRequest",
"message": "Invalid clip ID or category ID"
}
Status Code: `401 Unauthorized**
{
"error": "Unauthorized",
"message": "Invalid or missing API key"
}
Status Code: `404 Not Found**
{
"error": "NotFound",
"message": "Clip or category not found"
}
Status Code: `409 Conflict**
{
"error": "Conflict",
"message": "Category is not associated with this clip"
}
Code Examples#
const response = await fetch(
'https://api.storyteller.example.com/api/app/clips/12345678-1234-1234-1234-123456789abc/categories/',
{
method: 'DELETE',
headers: {
'x-storyteller-api-key': 'your-api-key-here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
id: '87654321-4321-4321-4321-cba987654321'
})
}
);
const data = await response.json();
console.log(data);
import requests
url = "https://api.storyteller.example.com/api/app/clips/12345678-1234-1234-1234-123456789abc/categories/"
headers = {
"x-storyteller-api-key": "your-api-key-here",
"Content-Type": "application/json"
}
data = {
"id": "87654321-4321-4321-4321-cba987654321"
}
response = requests.delete(url, headers=headers, json=data)
data = response.json()
print(data)
using HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Add("x-storyteller-api-key", "your-api-key-here");
var requestBody = new { id = "87654321-4321-4321-4321-cba987654321" };
var json = System.Text.Json.JsonSerializer.Serialize(requestBody);
var request = new HttpRequestMessage(HttpMethod.Delete,
"https://api.storyteller.example.com/api/app/clips/12345678-1234-1234-1234-123456789abc/categories/")
{
Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json")
};
var response = await client.SendAsync(request);
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
curl -X DELETE \
-H "x-storyteller-api-key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{"id": "87654321-4321-4321-4321-cba987654321"}' \
"https://api.storyteller.example.com/api/app/clips/12345678-1234-1234-1234-123456789abc/categories/"
Notes#
- You can only remove categories that are currently associated with the clip
- Attempting to remove a category that is not associated with the clip will result in a
409 Conflicterror - This operation is idempotent - calling it multiple times with the same parameters will not cause issues beyond the conflict error
- Removing a category does not delete the category itself, it only removes the association with the clip