Media - Delete
  • 22 Dec 2023
  • 1 Minute to read
  • Dark
    Light

Media - Delete

  • Dark
    Light

Article summary

Delete Media

DELETE /1/media/{media_id}
Host: https://api.cogniac.io

Example: Delete Media

curl -X DELETE https://api.cogniac.io/1/media/YAHZLMQEYTWB7OBG1RT8HG6OUQOS \
-H "Authorization: Bearer abcdefg.hijklmnop.qrstuvwxyz" \

import requests

url_prefix = 'https://api.cogniac.io'
api_version = "1"
media_id = 'Z2EQR5NFJREOYVUBS6L9XGNX0SDA'
token = ''  # add your token here
headers = {'Authorization': f'Bearer {token}'}  

url = f'{url_prefix}/{api_version}/media/{media_id}'
response = requests.delete(url, headers=headers)

if response.status_code == 204:
    print(f"{media_id} was deleted successfully.")
else:
    print(f"Error: {response.status_code}")
    print(response.content)

HTTP 204 Code (with no body)


Was this article helpful?