V1 and V2Assets

Update an asset

PATCH
/api/v1/assets/{asset_id}

Modifies attributes from asset and leaves the rest unchanged.

Current version supports the modification of the following fields:

FieldTypeDescription
filenamestringNew file name for the asset. File extension change is not allowed
categoriesarrayArray containing categories objects Each category is defined as follows { "id": category_id }

Authorization

bearerAuth
AuthorizationBearer <token>

Obtain a token via POST /auth/api/get-token (15 minute lifetime), then send it as Authorization: Bearer <token>.

In: header

Path Parameters

asset_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X PATCH 'https://example.com/api/v1/assets/string' \  -H 'Content-Type: application/json' \  --data-raw '{  "filename": "new_asset_filename.png",  "categories": [    {      "id": "5c3f6697d08a07000171c4de"    },    {      "id": "5c489c15f4b8950001378041"    }  ]}'
{  "data": [    {      "assigned": true,      "categories": [        {          "id": "5c3f66add08a07000171c4e0"        },        {          "id": "5c3f6697d08a07000171c4de"        },        {          "id": "5c489c15f4b8950001378041"        }      ],      "content_type": "image/png",      "created": "2019-01-21T09:29:48.127000+00:00",      "extension": "png",      "file_modified": "2019-01-21T09:29:48.127000",      "file_size": 532360,      "file_type": "IMAGES",      "filename": "new_asset_filename.png",      "id": "5c45910c0a3d5c000155aa62",      "modified": "2019-01-21T09:33:58.170000+00:00",      "n_catalogs": 1,      "n_products": 115,      "status": "ACTIVE",      "thumbnail": "https://files.plytix.com/api/v1.1/thumb/bird.png",      "url": "https://files.plytix.com/api/v1.1/file/assets/bird.png"    }  ]}