Header name | Description |
---|---|
Content-Type required |
application/json |
X-API-KEY required |
YOUR_API_KEY |
Param name | Description |
---|---|
title required |
Title Validations:
|
description optional |
Description Validations:
|
category optional |
Category Validations:
|
tags optional |
Tags Validations:
|
media_type optional |
Type. During asset creation, only used for articles. Defaults to placeholder with no media. Validations:
|
external_id optional |
External ID Validations:
|
// Failed request, missing required "title" parameter POST /api/v2/assets { "description": "Sample asset from API V2", "category": "Sample", "tags": [ "sample", "test" ] } 422 { "error": "Missing parameter title" }
// Failed request, invalid media type POST /api/v2/assets { "title": "Sample Asset", "description": "Sample asset from API V2", "category": "Sample", "tags": [ "sample", "test" ], "media_type": "image" } 422 { "error": "Invalid parameter 'media_type' value \"image\": Must be one of: <code>article</code>." }
// Successful request POST /api/v2/assets { "title": "Sample Asset", "description": "Sample asset from API V2", "category": "Sample", "tags": [ "sample", "test" ] } 200 { "asset": { "id": "-vevooaEWuYCnLFQqe2l", "external_id": null, "parent_id": null, "project_id": null, "owner": "admin-user-54@example.com", "title": "Sample Asset", "description": "Sample asset from API V2", "category": "sample", "tags": [ "sample", "test" ], "ai_tags": [], "status": "open", "media_type": "placeholder", "original_filename": null, "drop_folder_id": null, "md5_sum": null, "created_date": "2023-11-27T09:42:48.538Z", "modification_date": "2023-11-27T09:42:48.538Z", "deleted": null } }
// External ID has already been taken POST /api/v2/assets { "title": "Sample Asset", "external_id": "already_used_id" } 400 { "error": "External id has already been taken" }
// Successful request, valid media type POST /api/v2/assets { "title": "Sample Asset", "description": "Sample asset from API V2", "category": "Sample", "tags": [ "sample", "test" ], "media_type": "article" } 200 { "asset": { "id": "dbZ_vHeiERRUyDRlX_FY", "external_id": null, "parent_id": null, "project_id": null, "owner": "admin-user-56@example.com", "title": "Sample Asset", "description": "Sample asset from API V2", "category": "sample", "tags": [ "sample", "test" ], "ai_tags": [], "status": "open", "media_type": "article", "original_filename": null, "drop_folder_id": null, "md5_sum": null, "created_date": "2023-11-27T09:42:49.160Z", "modification_date": "2023-11-27T09:42:49.282Z", "deleted": null } }
Code | Description |
---|---|
401 | Unauthorized |
404 | Not found |
500 | Internal Server Error |
422 | Missing parameters |