Creating DOIs with the REST API

DOIs can be created using the https://api.datacite.org/dois endpoint. Only Repositories have the ability to create DOIs. This section of the guide will show you how to create an identifier in Draft state and then register a Findable DOI. (Learn more about DOI States.)

Create an identifier in Draft state

To reserve an identifier in Draft state, you will need to create a JSON file containing the minimum information necessary for creating a DOI, which is the DOI string. It should look like the following, but using a DOI prefix associated with your Repository account:

{
  "data": {
    "type": "dois",
    "attributes": {
      "doi": "10.5438/0012"
    }
  }
}

Next, submit that information using the following call, replacing YOUR_REPOSITORY_ID:YOUR_PASSWORD with your DataCite repository credentials and replacing my_draft.json with the name of the file you created earlier.

$ curl -X POST -H "Content-Type: application/vnd.api+json" --user YOUR_REPOSITORY_ID:YOUR_PASSWORD -d @my_draft.json https://api.test.datacite.org/dois 

📘

Auto-generated DOI's

If you want to auto-generate the DOI name you can make the above call removing the "doi" attribute in the json payload and adding just the "prefix" attribute. This generates a random DOI suffix.

{
  "data": {
    "type": "dois",
    "attributes": {
      "prefix": "10.5438"
    }
  }
}

Your response will look something like the following, but containing your Repository information:

{
  "data": {
    "id": "10.5438/0012",
    "type": "dois",
    "attributes": {
      "doi": "10.5438/0012",
      "prefix": "10.5438",
      "suffix": "0012",
      "identifiers": [{
        "identifier": "https://doi.org/10.5438/0012",
        "identifierType": "DOI"
      }],
      "creators": [],
      "titles": [],
      "publisher": null,
      "container": {},
      "publicationYear": null,
      "subjects": [],
      "contributors": [],
      "dates": [],
      "language": null,
      "types": {},
      "relatedIdentifiers": [],
      "sizes": [],
      "formats": [],
      "version": null,
      "rightsList": [],
      "descriptions": [],
      "geoLocations": [],
      "fundingReferences": [],
      "xml": null,
      "url":null,
      "contentUrl": null,
      "metadataVersion": 1,
      "schemaVersion": "http://datacite.org/schema/kernel-4",
      "source": null,
      "isActive": true,
      "state": "draft",
      "reason": null,
      "created": "2016-09-19T21:53:56.000Z",
      "registered": null,
      "updated": "2019-02-06T14:31:27.000Z"
    },
    "relationships": {
      "client": {
        "data": {
          "id": "datacite.datacite",
          "type": "clients"
        }
      },
      "media": {
        "data": []
      }
    }
  },
  "included": [{
    "id": "datacite.datacite",
    "type": "clients",
    "attributes": {
      "name": "DataCite",
      "symbol": "DATACITE.DATACITE",
      "year": 2011,
      "contactName": "DataCite",
      "contactEmail": "[email protected]",
      "description": null,
      "domains": "*",
      "url": null,
      "created": "2011-12-07T13:43:39.000Z",
      "updated": "2019-01-02T17:33:06.000Z",
      "isActive": true,
      "hasPassword": true
    },
    "relationships": {
      "provider": {
        "data": {
          "id": "datacite",
          "type": "providers"
        }
      },
      "prefixes": {
        "data": [{
          "id": "10.5438",
          "type": "prefixes"
        }]
      }
    }
  }]
}

The command will fail with an error message if the prefix you used is not associated with your Repository ID.

You have now created a Draft. It has a DOI string assigned, but is not visible for users, so it will not be functional.

Create a Findable DOI with basic metadata

To create a DOI in Findable state with a URL and metadata you need to include all of the required DOI metadata fields (DOI, creators, title, publisher, publicationYear, resourceTypeGeneral).

📘

What metadata should I include?

The DataCite Metadata Schema documentation contains information on required metadata, optional metadata, and those metadata elements that are recommended for enhancing data discovery. You will also find descriptions of controlled vocabulary for those fields that require it.

{
  "data": {
    "id": "10.5438/0012",
    "type": "dois",
    "attributes": {
      "event": "publish",
      "doi": "10.5438/0012",
      "creators": [{
        "name": "DataCite Metadata Working Group"
      }],
      "titles": [{
        "title": "DataCite Metadata Schema Documentation for the Publication and Citation of Research Data v4.0"
      }],
      "publisher": "DataCite e.V.",
      "publicationYear": 2016,
      "types": {
        "resourceTypeGeneral": "Text"
      },
      "url": "https://schema.datacite.org/meta/kernel-4.0/index.html",
      "schemaVersion": "http://datacite.org/schema/kernel-4"
    }
  }
}


📘

To autogenerate the DOI, remember to remove the "id" field and and replace the "doi" field with "prefix".

You can also include optional metadata.

Create a Findable DOI with rich metadata

The DataCite REST API uses a standard JSON API format based on https://jsonapi.org/. The properties correspond to the DataCite metadata schema. The best way to see the properties in JSON is to look at the response from a DOI request.

Below is an example of an API query that will retrieve all the available metadata fields in JSON.

$ curl https://api.test.datacite.org/dois/10.17596/qf5s-pc52?affiliation=true

Use the response to structure the JSON metadata in your payload. The properties correspond to the DataCite Metadata Schema, which is developed in XML. Some of the property names are slightly different in the JSON API.

You can copy and paste the payload below (making sure to update include your Repository Credentials and prefix) and run a POST request to create a Findable DOI.

{
  "data": {
    "id": "10.17596/qf5s-pc52",
    "type": "dois",
    "attributes": {
      "doi": "10.17596/qf5s-pc52",
      "prefix": "10.17596",
      "suffix": "qf5s-pc52",
      "event": "publish",
      "creators": [
        {
          "name": "Miller, Elizabeth",
          "nameType": "Personal",
          "givenName": "Elizabeth",
          "familyName": "Miller",
          "affiliation": [
            "DataCite",
            "California Institute of Technology"
          ],
          "nameIdentifiers": [
            {
              "schemeUri": "https://orcid.org",
              "nameIdentifier": "https://orcid.org/0000-0001-5000-0007",
              "nameIdentifierScheme": "ORCID"
            }
          ]
        }
      ],
      "titles": [
        {
          "lang": "en-US",
          "title": "Full DataCite XML Example"
        },
        {
          "lang": "en-US",
          "title": "Demonstration of DataCite Properties.",
          "titleType": "Subtitle"
        }
      ],
      "publisher": "DataCite",
      "publicationYear": 2014,
      "subjects": [
        {
          "subject": "computer science",
          "schemeUri": "http://dewey.info/",
          "subjectScheme": "dewey",
          "classificationCode": "000"
        }
      ],
      "contributors": [
        {
          "name": "Starr, Joan",
          "nameType": "Personal",
          "givenName": "Joan",
          "familyName": "Starr",
          "affiliation": [
            "California Digital Library"
          ],
          "contributorType": "ProjectLeader",
          "nameIdentifiers": [
            {
              "schemeUri": "https://orcid.org",
              "nameIdentifier": "https://orcid.org/0000-0002-7285-027X",
              "nameIdentifierScheme": "ORCID"
            }
          ]
        }
      ],
      "dates": [
        {
          "date": "2021-01-26",
          "dateType": "Updated",
          "dateInformation": "Updated with 4.4 properties"
        },
        {
          "date": "2014",
          "dateType": "Issued",
          "dateInformation": null
        }
      ],
      "alternateIdentifiers": [
        {
          "alternateIdentifierType": "URL",
          "alternateIdentifier": "https://schema.datacite.org/meta/kernel-4.4/example/datacite-example-full-v4.4.xml"
        }
      ],
      "language": "en",
      "types": {
        "resourceType": "XML",
        "resourceTypeGeneral": "Software"
      },
      "relatedIdentifiers": [
        {
          "schemeUri": "https://github.com/citation-style-language/schema/raw/master/csl-data.json",
          "schemeType": null,
          "relationType": "HasMetadata",
          "relatedIdentifier": "https://data.datacite.org/application/citeproc+json/10.5072/example-full",
          "resourceTypeGeneral": null,
          "relatedIdentifierType": "URL",
          "relatedMetadataScheme": "citeproc+json"
        },
        {
          "relationType": "IsReviewedBy",
          "relatedIdentifier": "arXiv:0706.0001",
          "resourceTypeGeneral": "Text",
          "relatedIdentifierType": "arXiv"
       }
      ],
      "relatedItems": [
        {
          "titles": [
            {
              "title": "Physics letters B"
            }
          ],
          "volume": "776",
          "lastPage": "264",
          "firstPage": "249",
          "relationType": "IsPublishedIn",
          "publicationYear": "2018",
          "relatedItemType": "Journal",
          "relatedItemIdentifier": {
            "relatedItemIdentifier": "0370-2693",
            "relatedItemIdentifierType": "ISSN"
          }
        }
      ],
      "sizes": [
        "4 kB"
      ],
      "formats": [
        "application/xml"
      ],
      "version": "4.2",
      "rightsList": [
        {
          "rights": "Creative Commons Zero v1.0 Universal",
          "rightsUri": "https://creativecommons.org/publicdomain/zero/1.0/legalcode",
          "schemeUri": "https://spdx.org/licenses/",
          "rightsIdentifier": "cc0-1.0",
          "rightsIdentifierScheme": "SPDX"
        }
      ],
      "descriptions": [
        {
          "lang": "en-US",
          "description": "XML example of all DataCite Metadata Schema v4.4 properties.",
          "descriptionType": "Abstract"
        }
      ],
      "geoLocations": [
        {
          "geoLocationBox": {
            "eastBoundLongitude": -68.211,
            "northBoundLatitude": 42.893,
            "southBoundLatitude": 41.09,
            "westBoundLongitude": -71.032
          },
          "geoLocationPlace": "Atlantic Ocean",
          "geoLocationPoint": {
            "pointLatitude": 31.233,
            "pointLongitude": -67.302
          }
        }
      ],
      "fundingReferences": [
        {
          "awardUri": "https://www.moore.org/grants/list/GBMF3859.01",
          "awardTitle": "Full DataCite XML Example",
          "funderName": "National Science Foundation",
          "awardNumber": "CBET-106",
          "funderIdentifier": "05dxps055",
          "funderIdentifierType": "ROR"
        }
      ],
      "url": "https://schema.datacite.org/meta/kernel-4.0/index.html",
      "schemaVersion": "http://datacite.org/schema/kernel-4.4"
    }
  }
}

❗️

Test and production

DataCite's test and production environments are completely separate. Your repository credentials, password and prefix will be different for each environment. Make sure you are using the correct endpoint

Test: https://api.test.datacite.org/dois
Production: https://api.datacite.org/dois

Changing the DOI state

In the previous examples you can see an "event" attribute added to our json payload, this corresponds to the action you want to trigger for the DOI.

In the case of reaching a findable state, we parse "publish" this pushes it through to the findable DOI state.

Possible actions:

  • publish - Triggers a state move from draft or registered to findable
  • register - Triggers a state move from draft to registered
  • hide - Triggers a state move from findable to registered

Provide metadata in formats other than JSON

As an alternative to providing metadata attributes directly in JSON, you can also provide metadata in other formats.

The following metadata formats can be used to register DOIs:

  • DataCite XML
  • Schema.org JSON-LD
  • Crossref Unixref
  • Citeproc JSON
  • RIS
  • BibTeX

You do this by 1.) base64-encoding the metadata and 2.) including them in the xml attribute.

For example:

{
  "data": {
    "id": "10.5438/0012",
    "type": "dois",
    "attributes": {
      "event": "publish",
      "doi": "10.5438/0012",
      "url": "https://schema.datacite.org/meta/kernel-4.0/index.html",
      "xml": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxyZXNvdXJjZSB4bWxucz0iaHR0cDovL2RhdGFjaXRlLm9yZy9zY2hlbWEva2VybmVsLTQiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhzaTpzY2hlbWFMb2NhdGlvbj0iaHR0cDovL2RhdGFjaXRlLm9yZy9zY2hlbWEva2VybmVsLTQgaHR0cDovL3NjaGVtYS5kYXRhY2l0ZS5vcmcvbWV0YS9rZXJuZWwtNC9tZXRhZGF0YS54c2QiPg0KCTxpZGVudGlmaWVyIGlkZW50aWZp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VtPGJyLz4NCjEuMiBEYXRhQ2l0ZSBDb21tdW5pdHkgUGFydGljaXBhdGlvbjxici8+DQoxLjMgVGhlIE1ldGFkYXRhIFNjaGVtYTxici8+DQoxLjQgVmVyc2lvbiA0LjAgVXBkYXRlPGJyLz4NCjIgRGF0YUNpdGUgTWV0YWRhdGEgUHJvcGVydGllczxici8+DQoyLjEgT3ZlcnZpZXc8YnIvPg0KMi4yIENpdGF0aW9uPGJyLz4NCjIuMyBEYXRhQ2l0ZSBQcm9wZXJ0aWVzPGJyLz4NCjMgWE1MIEV4YW1wbGU8YnIvPg0KNCBYTUwgU2NoZW1hPGJyLz4NCjUgT3RoZXIgRGF0YUNpdGUgU2VydmljZXM8YnIvPg0KQXBwZW5kaWNlczxici8+DQpBcHBlbmRpeCAxOiBDb250cm9sbGVkIExpc3QgRGVmaW5pdGlvbnM8YnIvPg0KQXBwZW5kaXggMjogRWFybGllciBWZXJzaW9uIFVwZGF0ZSBOb3RlczwvZGVzY3JpcHRpb24+DQoJPC9kZXNjcmlwdGlvbnM+DQo8L3Jlc291cmNlPg0K"
  }
}
}

You will then need to make a call on this file, like this:

curl -X POST -H "Content-Type: application/vnd.api+json" --user YOUR_CLIENT_ID:YOUR_PASSWORD -d @my_metadata.json https://api.test.datacite.org/dois 

Keep learning with the API Reference!