Add an asset

POST https://manage.kontent.ai/v2/projects/:environment_id/assets

Use a file reference to link an existing binary file to a new asset. You can also create assets by upserting (PUT /assets/external-id/<external_id>).

Each binary file can be referenced only by a single asset.

Request Body

{"file_reference"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "descriptions"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "elements"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "external_id"=>"<string>", "file_name"=>"<string>", "folder"=>{"id"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "external_id"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "codename"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}}, "collection"=>{"reference"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}}, "id"=>"<uuid>", "codename"=>"<string>", "image_height"=>"<integer,null-int32>", "image_width"=>"<integer,null-int32>", "last_modified"=>"<dateTime>", "size"=>"<integer>", "title"=>"<string,null>", "type"=>"<string>", "url"=>"<string>"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: Created

{&quot;id&quot;:&quot;fcbb12e6-66a3-4672-85d9-d502d16b8d9c&quot;,&quot;file_name&quot;:&quot;file_name.jpeg&quot;,&quot;title&quot;:&quot;Description of what the file contains&quot;,&quot;size&quot;:148636,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;url&quot;:&quot;https://assets-us-01.kc-usercontent.com/8d20758c-d74c-4f59-ae04-ee928c0816b7/adf26cd2-1acb-403f-9d1e-6d04e46c39f1/file_name.png&quot;,&quot;image_width&quot;:1280,&quot;image_height&quot;:548,&quot;file_reference&quot;:{&quot;id&quot;:&quot;fcbb12e6-66a3-4672-85d9-d502d16b8d9c&quot;,&quot;type&quot;:&quot;internal&quot;},&quot;folder&quot;:{&quot;id&quot;:&quot;8fe4ff47-0ca8-449d-bc63-c280efee44ea&quot;},&quot;descriptions&quot;:[{&quot;language&quot;:{&quot;id&quot;:&quot;00000000-0000-0000-0000-000000000000&quot;},&quot;description&quot;:&quot;The asset&#39;s alt text in the default language describing what the file or image shows.&quot;}],&quot;elements&quot;:[{&quot;element&quot;:{&quot;id&quot;:&quot;c7c3b834-2222-5677-89c4-b46f04489109&quot;},&quot;value&quot;:[{&quot;id&quot;:&quot;53a5eecb-f295-59b4-a07d-19655b6ad860&quot;},{&quot;id&quot;:&quot;3f367e4f-75b7-4b48-be3b-1136bbaf1f53&quot;}]}],&quot;external_id&quot;:&quot;custom-asset-identifier&quot;,&quot;last_modified&quot;:&quot;2017-09-12T08:29:36.1645977Z&quot;}