Choose your language:
    Delete an upload
    Returns
    Returns a upload object.

    Examples

    Example code:
    const SiteClient = require('datocms-client').SiteClient;
    const client = new SiteClient('YOUR-API-TOKEN');
    const uploadId = '666';
    client.upload.destroy(uploadId)
    .then((upload) => {
    console.log(upload);
    })
    .catch((error) => {
    console.error(error);
    });
    Returned output:
    > node example.js
    {
    "id": "666",
    "size": 444,
    "width": 30,
    "height": 30,
    "path": "/45/1496845848-digital-cats.jpg",
    "basename": "digital-cats",
    "filename": "digital-cats.jpg",
    "url": "https://www.datocms-assets.com/45/1496845848-digital-cats.jpg",
    "format": "jpg",
    "author": "Mark Smith",
    "copyright": "2020 DatoCMS",
    "notes": "Nyan the cat",
    "md5": "873c296d0f2b7ee569f2d7ddaebc0d33",
    "duration": 62,
    "frameRate": 30,
    "blurhash": "LEHV6nWB2yk8pyo0adR*.7kCMdnj",
    "muxPlaybackId": "a1B2c3D4e5F6g7H8i9",
    "muxMp4HighestRes": "high",
    "defaultFieldMetadata": {
    "en": {
    "title": "this is the default title",
    "alt": "this is the default alternate text",
    "customData": {
    "foo": "bar"
    },
    "focalPoint": {
    "x": 0.5,
    "y": 0.5
    }
    }
    },
    "isImage": true,
    "createdAt": "2020-04-21T07:57:11.124Z",
    "updatedAt": "2020-04-21T07:57:11.124Z",
    "mimeType": "image/jpeg",
    "tags": [
    "cats"
    ],
    "smartTags": [
    "robot-cats"
    ],
    "exifInfo": {
    "iso": 10000,
    "model": "ILCE-7",
    "flashMode": 16,
    "focalLength": 35,
    "exposureTime": 0.0166667
    },
    "colors": [
    {
    "red": 206,
    "green": 203,
    "blue": 167,
    "alpha": 255
    },
    {
    "red": 158,
    "green": 163,
    "blue": 93,
    "alpha": 255
    }
    ],
    "creator": "312"
    }