Skip to content

Cora REST-API

Members can read, create, and update records in Alvin via a REST API built on Cora, a metadata-driven generic open digital archive system designed to manage structured metadata and files.

Cora is developed by National Systems at Uppsala University Library.

Cora Record API Documentation describes how records and files are managed and how searches are performed.

Records in Alvin

To create and update records, the user must be registered in the system (only available to people connected to Alvin's member organisations). Published records, however, can be read by anyone and are openly available without logging in.

Records are managed via Alvin's data format in Cora expressed as either XML or JSON. The format description of types and classes is available in the cataloguing client and as an open linked vocabulary.

Create bibliographic record

Mandatory fields for all bibliographic records are typeOfResource, title, and location. In addition to descriptive Alvin metadata, Cora requires a number of specific mandatory control fields in the recordInfo element.

  
<record>
  <typeOfResource>img</typeOfResource>
  <title>
    <mainTitle>A title</mainTitle>
  </title>
  <physicalLocation>
    <heldBy>
      <location>
        <linkedRecordType>alvin-location</linkedRecordType>
        <linkedRecordId>1</linkedRecordId>
      </location>
    </heldBy>
  </physicalLocation>
  <recordInfo>
    <validationType>
      <linkedRecordType>validationType</linkedRecordType>
      <linkedRecordId>recordStillImage</linkedRecordId>
    </validationType>
    <dataDivider>
      <linkedRecordType>system</linkedRecordType>
      <linkedRecordId>alvinData</linkedRecordId>
     </dataDivider>
     <permissionUnit>
       <linkedRecordType>permissionUnit</linkedRecordType>
       <linkedRecordId>1</linkedRecordId>
     </permissionUnit>
     <visibility>published</visibility>
  </recordInfo>
</record>

Read bibliographic record

Records read via the API contain, in addition to the descriptive metadata itself, links (actionLinks) to the various possibilities the user has to call both the record and linked records in the API. A surrounding Cora element (record) contains (data) which in turn contains the actual metadata record.

Note the repeatId attribute which is mandatory for all repeatable fields in the Cora API. The repeatId must contain a unique number within each element.

<record>
  <data>
    <record>
      <typeOfResource>img</typeOfResource>
      <title>
        <mainTitle>A title</mainTitle>
      </title>
      <physicalLocation>
        <heldBy>
          <location>
            <linkedRecordType>alvin-location</linkedRecordType>
            <linkedRecordId>1</linkedRecordId>
            <actionLinks>
              <read>
                <requestMethod>GET</requestMethod>
                <rel>read</rel>
                <url>https://cora.alvin-portal.org/rest/record/alvin-location/1</url>
                <accept>application/vnd.cora.record+xml</accept>
              </read>
            </actionLinks>
          </location>
        </heldBy>
      </physicalLocation>
      <recordInfo>
        <validationType>
          <linkedRecordType>validationType</linkedRecordType>
          <linkedRecordId>recordStillImage</linkedRecordId>
          <actionLinks>
            <read>
              <requestMethod>GET</requestMethod>
              <rel>read</rel>
              <url>https://cora.alvin-portal.org/rest/record/validationType/recordStillImage</url>
              <accept>application/vnd.cora.record+xml</accept>
            </read>
          </actionLinks>
        </validationType>
        <dataDivider>
          <linkedRecordType>system</linkedRecordType>
          <linkedRecordId>alvinData</linkedRecordId>
          <actionLinks>
            <read>
              <requestMethod>GET</requestMethod>
              <rel>read</rel>
              <url>https://cora.alvin-portal.org/rest/record/system/alvinData</url>
              <accept>application/vnd.cora.record+xml</accept>
            </read>
          </actionLinks>
        </dataDivider>
        <permissionUnit>
          <linkedRecordType>permissionUnit</linkedRecordType>
          <linkedRecordId>1</linkedRecordId>
          <actionLinks>
            <read>
              <requestMethod>GET</requestMethod>
              <rel>read</rel>
              <url>https://cora.alvin-portal.org/rest/record/permissionUnit/1</url>
              <accept>application/vnd.cora.record+xml</accept>
            </read>
          </actionLinks>
        </permissionUnit>
        <visibility>published</visibility>
        <tsVisibility>2026-01-14T15:03:02.382669Z</tsVisibility>
        <inTrashBin>false</inTrashBin>
        <id>2</id>
        <type>
          <linkedRecordType>recordType</linkedRecordType>
          <linkedRecordId>alvin-record</linkedRecordId>
          <actionLinks>
            <read>
              <requestMethod>GET</requestMethod>
              <rel>read</rel>
              <url>https://cora.alvin-portal.org/rest/record/recordType/alvin-record</url>
              <accept>application/vnd.cora.record+xml</accept>
            </read>
          </actionLinks>
        </type>
        <createdBy>
          <linkedRecordType>user</linkedRecordType>
          <linkedRecordId>111111</linkedRecordId>
        </createdBy>
        <tsCreated>2026-01-14T15:03:02.383666Z</tsCreated>
        <updated repeatId="0">
          <tsUpdated>2026-01-14T17:29:26.591761Z</tsUpdated>
          <updatedBy>
            <linkedRecordType>user</linkedRecordType>
            <linkedRecordId>111111</linkedRecordId>
          </updatedBy>
        </updated>
        <urn>urn:nbn:se:alvin:portal:record-1</urn>
      </recordInfo>
    </record>
  </data>
  <actionLinks>
    <read>
      <requestMethod>GET</requestMethod>
      <rel>read</rel>
      <url>https://cora.alvin-portal.org/rest/record/alvin-record/1</url>
      <accept>application/vnd.cora.record+xml</accept>
    </read>
  </actionLinks>
</record>  

Update bibliographic record

When updating an existing record, the id and type are also specified in recordInfo. inTrashBin is set to false.

  
<record>
  <typeOfResource>img</typeOfResource>
  <title>
    <mainTitle>An updated title</mainTitle>
  </title>
  <physicalLocation>
    <heldBy>
      <location>
        <linkedRecordType>alvin-location</linkedRecordType>
        <linkedRecordId>1</linkedRecordId>
      </location>
    </heldBy>
  </physicalLocation>
  <recordInfo>
    <id>1</id>
    <type>
      <linkedRecordType>recordType</linkedRecordType>
      <linkedRecordId>alvin-record</linkedRecordId>
    </type>
    <validationType>
      <linkedRecordType>validationType</linkedRecordType>
      <linkedRecordId>recordStillImage</linkedRecordId>
    </validationType>
    <dataDivider>
      <linkedRecordType>system</linkedRecordType>
      <linkedRecordId>alvinData</linkedRecordId>
     </dataDivider>
     <permissionUnit>
       <linkedRecordType>permissionUnit</linkedRecordType>
       <linkedRecordId>1</linkedRecordId>
     </permissionUnit>
     <visibility>published</visibility>
     <inTrashBin>false</inTrashBin>
  </recordInfo>
</record>

Delete bibliographic record

Bibliographic records cannot be completely removed from the system for archival reasons, but can be hidden from users by updating the record as above and setting inTrashBin to true in recordInfo.

Authority records.

Handled in a similar way to bibliographic records but can be created and updated regardless of the user's organisational affiliation. They are also always openly published. This means that recordInfo for authority records does not contain the elements permissionUnit or visibility. Similarly, authority records that are not linked from another record can be removed from the system by a DELETE call, which is why inTrashBin does not exist for authority records either.

As descriptive metadata, authority records for person, organisation, and place must contain at least one authority element, and authority records for works must contain title and formOfWork as mandatory elements.