v1

latestOpenAPI 3.0.0Open Government Licence v3.02026-07-239817.3 KB
image

Update an image metadata entry

Updates an existing image metadata entry whose id matches the id provided as path parameter. Only the provided fields will be used to overwrite an existing image, creating them if they did not already exist, and not overwriting any field that is not provided.

put/images/{image_id}

Path parameters

image_idstring required

A unique id for an image metadata entry

Request body

idstring required

Image metadata unique identifier

collection_idstring required

Collection unique identifier corresponding to this image

state'created' | 'uploaded' | 'importing' | 'imported' | 'published' | 'completed' | 'deleted' | 'failed_import' | 'failed_publish' required

The state of the image

errorstring

Any error information, if there was an error with this image

filenamestring

Image's file name. According to SEO recommendations, the name should not be longer than 5 words. And it should not include extension because multiple extensions for the same image might be available as download variants.

typestring required

Type of image, which might define a set of possible formats and variants or resolutions.

Example request

{
  "id": "042e216a-7822-4fa0-a3d6-e3f5248ffc35",
  "collection_id": "5557dcd9-bf58-4a67-94f7-2343569834cc",
  "state": "published",
  "error": "publish process failed",
  "filename": "image-name",
  "license": {
    "title": "Open Government Licence v3.0",
    "href": "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
  },
  "links": {
    "downloads": "https://localhost:100000/images/042e216a-7822-4fa0-a3d6-e3f5248ffc35/downloads"
  },
  "upload": {
    "path": "images/025a789c-533f-4ecf-a83b-65412b96b2b7/image-name.png"
  },
  "type": "chart"
}

Response

A json with the requested image metadata

idstring required

Image metadata unique identifier

collection_idstring required

Collection unique identifier corresponding to this image

state'created' | 'uploaded' | 'importing' | 'imported' | 'published' | 'completed' | 'deleted' | 'failed_import' | 'failed_publish' required

The state of the image

errorstring

Any error information, if there was an error with this image

filenamestring

Image's file name. According to SEO recommendations, the name should not be longer than 5 words. And it should not include extension because multiple extensions for the same image might be available as download variants.

typestring required

Type of image, which might define a set of possible formats and variants or resolutions.

Example response

{
  "id": "042e216a-7822-4fa0-a3d6-e3f5248ffc35",
  "collection_id": "5557dcd9-bf58-4a67-94f7-2343569834cc",
  "state": "published",
  "error": "publish process failed",
  "filename": "image-name",
  "license": {
    "title": "Open Government Licence v3.0",
    "href": "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
  },
  "links": {
    "downloads": "https://localhost:100000/images/042e216a-7822-4fa0-a3d6-e3f5248ffc35/downloads"
  },
  "upload": {
    "path": "images/025a789c-533f-4ecf-a83b-65412b96b2b7/image-name.png"
  },
  "type": "chart"
}