v1

latestOpenAPI 3.0.0Open Government Licence v3.02026-07-14355492.7 KB
Private

Create an instance

Create an instance which will be imported. To create an instance an import job id and href is required. This is to allow a link back to the import job

post/instances

Request body

idstring

A unique id for an instance

state'created' | 'completed' | 'failed' | 'edition-confirmed' | 'associated' | 'published'

The state of the resource, can only be one of the following:

  • created
  • completed (instances only)
  • failed (instances only)
  • edition-confirmed (instances and versions only)
  • associated (not editions)
  • published

Example request

{
  "links": {
    "dataset": {
      "href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset",
      "id": "my-dataset"
    },
    "job": {
      "href": "https://api.beta.ons.gov.uk/v1/jobs/042e216a-7822-4fa0-a3d6-e3f5248ffc35",
      "id": "042e216a-7822-4fa0-a3d6-e3f5248ffc35"
    },
    "self": {
      "href": "https://api.beta.ons.gov.uk/v1/instances/45c4669b-3ae9-4ba7-b690-87e890a1c67f"
    }
  },
  "state": "published"
}

Response

Successfully created instance

idstring

A unique id for an instance

state'created' | 'completed' | 'failed' | 'edition-confirmed' | 'associated' | 'published'

The state of the resource, can only be one of the following:

  • created
  • completed (instances only)
  • failed (instances only)
  • edition-confirmed (instances and versions only)
  • associated (not editions)
  • published

Example response

{
  "links": {
    "dataset": {
      "href": "https://api.beta.ons.gov.uk/v1/datasets/my-dataset",
      "id": "my-dataset"
    },
    "job": {
      "href": "https://api.beta.ons.gov.uk/v1/jobs/042e216a-7822-4fa0-a3d6-e3f5248ffc35",
      "id": "042e216a-7822-4fa0-a3d6-e3f5248ffc35"
    },
    "self": {
      "href": "https://api.beta.ons.gov.uk/v1/instances/45c4669b-3ae9-4ba7-b690-87e890a1c67f"
    }
  },
  "state": "published"
}