v1

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

Create a new image metadata entry

Creates a new image metadata entry corresponding to the provided body in this request. A new ID will be generated for the image, and it will be set to created state.

post/images

Request body

state'created' required

The state of the image

collection_idstring required

Collection unique identifier corresponding to 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 that will be generated by the image importer.

Example request

{
  "state": "created",
  "collection_id": "5557dcd9-bf58-4a67-94f7-2343569834cc",
  "filename": "image-name",
  "license": {
    "title": "Open Government Licence v3.0",
    "href": "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
  },
  "type": "chart"
}

Response

The image metadata was correctly created and a json object containing the new image information is returned. The new image will be in 'created' state and its id will be newly generated.

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"
}