Navbar
Logo
shell python

Introduction

This is the documentation for the ArchivesSpace RESTful API. This documents the endpoints that are used by the backend server to edit records in the application.

Since not all backend/API end points require authentication, it is best to restrict access to port 8089 to only IP addresses you trust. Your firewall should be used to specify a range of IP addresses that are allowed to call your ArchivesSpace API endpoint. This is commonly called whitelisting or allowlisting.

This example API documentation page was created with Slate.

Authentication

Example Authentication Request:

# With shell, you can pass the correct header with each request
curl -s -F password="admin" "http://localhost:8089/users/admin/login"
# Using the ArchivesSnake library
from asnake.client import ASnakeClient

client = ASnakeClient(baseurl="http://localhost:8089",
                      username="admin",
                      password="admin")
client.authorize()

Example Response:

{
   "session":"9528190655b979f00817a5d38f9daf07d1686fed99a1d53dd2c9ff2d852a0c6e",
   "user":{
      "lock_version":6,
      "username":"admin",
      "name":"Administrator",
      "is_system_user":true,
      "create_time":"2015-05-08T13:10:06Z",
      "system_mtime":"2015-07-07T10:21:53Z",
      "user_mtime":"2015-07-07T10:21:53Z",
      "jsonmodel_type":"user",
      "groups":[

      ],
      "is_admin":true,
      "uri":"/users/1",
      "agent_record":{
         "ref":"/agents/people/1"
      },
      "permissions":{
         "/repositories/1":[
            "update_location_record",
            "delete_vocabulary_record",
            "update_subject_record",
            "delete_subject_record",
            "update_agent_record",
            "delete_agent_record",
            "update_vocabulary_record",
            "merge_subject_record",
            "merge_agent_record",
            "administer_system",
            "become_user",
            "cancel_importer_job",
            "create_repository",
            "delete_archival_record",
            "delete_classification_record",
            "delete_event_record",
            "delete_repository",
            "import_records",
            "index_system",
            "manage_agent_record",
            "manage_repository",
            "manage_subject_record",
            "manage_users",
            "manage_vocabulary_record",
            "mediate_edits",
            "merge_agents_and_subjects",
            "merge_archival_record",
            "suppress_archival_record",
            "system_config",
            "transfer_archival_record",
            "transfer_repository",
            "update_accession_record",
            "update_classification_record",
            "update_digital_object_record",
            "update_event_record",
            "update_resource_record",
            "view_all_records",
            "view_repository",
            "view_suppressed"
         ],
         "_archivesspace":[
            "administer_system",
            "become_user",
            "cancel_importer_job",
            "create_repository",
            "delete_archival_record",
            "delete_classification_record",
            "delete_event_record",
            "delete_repository",
            "import_records",
            "index_system",
            "manage_agent_record",
            "manage_repository",
            "manage_subject_record",
            "manage_users",
            "manage_vocabulary_record",
            "mediate_edits",
            "merge_agents_and_subjects",
            "merge_archival_record",
            "suppress_archival_record",
            "system_config",
            "transfer_archival_record",
            "transfer_repository",
            "update_accession_record",
            "update_classification_record",
            "update_digital_object_record",
            "update_event_record",
            "update_resource_record",
            "view_all_records",
            "view_repository",
            "view_suppressed",
            "update_location_record",
            "delete_vocabulary_record",
            "update_subject_record",
            "delete_subject_record",
            "update_agent_record",
            "delete_agent_record",
            "update_vocabulary_record",
            "merge_subject_record",
            "merge_agent_record"
         ]
      }
   }
}

It’s a good idea to save the session key since this will be used for later requests:

# Mac/Unix terminal
export SESSION="9528190655b979f00817a5d38f9daf07d1686fed99a1d53dd2c9ff2d852a0c6e"

# Windows Command Prompt
set SESSION="9528190655b979f00817a5d38f9daf07d1686fed99a1d53dd2c9ff2d852a0c6e"

# Windows PowerShell
$env:SESSION="9528190655b979f00817a5d38f9daf07d1686fed99a1d53dd2c9ff2d852a0c6e"
# Handled by ArchivesSnake library
# For more information, see:
# https://github.com/archivesspace-labs/ArchivesSnake/#low-level-api

Most requests to the ArchivesSpace backend require a user to be authenticated. Since not all requests to the backend require authentication it is important to restrict access to only trusted IP addresses. Authentication can be done with a POST request to the /users/:user_name/login endpoint, with :user_name and :password parameters being supplied.

The JSON that is returned will have a session key, which can be stored and used for other requests. Sessions will expire after an hour, although you can change this in your config.rb file.

Common Route Categories and Parameters

As you use the ArchivesSpace API, you may start to notice similarities between different endpoints, and arguments that repeatedly show up in URLs or parameter lists. Some of the most general bear special description.

Create/Read/Update/Destroy (CRUD) Endpoints

The simplest types of endpoints conceptually, these are endpoints that allow you to create new resources, fetch and update existing known resources, get all the resources of a particular type, and remove resources from the system. Almost every kind of object in the system has routes of this type: here are the routes for agent_corporate_entity records.

Example routes: - Create: POST /agents/corporate_entities - Read (Index route): GET /agents/corporate_entities - Read (Single Record): GET /agents/corporate_entities/42 - Update: POST /agents/corporate_entities/42 - Destroy: DELETE /agents/corporate_entities/42

Paginated Endpoints

Endpoints that represent groups of objects, rather than single objects, tend to be paginated. Paginated endpoints are called out in the documentation as special, with some version of the following content appearing:

These endpoints support some or all of the following:

Search routes

A number of routes in the ArchivesSpace API are designed to search for content across all or part of the records in the application. These routes make use of Solr, a component bundled with ArchivesSpace and used to provide full text search over records.

The search routes present in the application as of this time are:

Search routes take quite a few different parameters, most of which correspond directly to Solr query parameters. The most important parameter to understand is q, which is the query sent to Solr. This query is made in Lucene query syntax. The relevant docs are located here.

To limit a search to records of a particular type or set of types, you can use the ‘type’ parameter. This is only relevant for search endpoints that aren’t limited to specific types. Note that type is expected to be a list of types, even if there is only one type you care about.

from asnake.client import ASnakeClient

client = ASnakeClient()
client.authorize()

# Search repository for records of any type with the word "pearlescent" in any field
client.get('repositories/2/search', params={'q': 'pearlescent', 'page': 1}).json()

# Search repository wth ID 24 for archival objects with "dragon" in their title field
client.get('repositories/2/search', params={'q': 'title:dragon', 'type': ['archival_object'], 'page': 1}).json()

Notes on search routes and results

ArchivesSpace represents records as JSONModel Objects - this is what you get from and send to the system.

SOLR takes these records, and stores “documents” BASED ON these JSONModel objects in a searchable index.

Search routes query these documents, NOT the records themselves as stored in the database and represented by JSONModel.

JSONModel objects and SOLR documents are similar in some ways:

But they also differ in quite a few important ways:

How do I get the actual JSONModel from a search document?

In ArchivesSpace, SOLR documents all have a field json, which contains the JSONModel Object the document represents as a string. You can use a JSON library to parse this string from the field, for example the json library in Python.

import json
search_results = client.get('repositories/2/search', params={'q': 'title:dragon', 'type': ['archival_object']}).json()['results']

# get JSONModel from first search document in results
my_record = json.loads(search_results[0]['json'])

refs and :resolve


curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/24/top_container?resolve[]=repository"

# JSON Output: Some keys have been left out in order to make the example shorter and clearer

{
  "lock_version": 11,
  "indicator": "1",
  "created_by": "admin",
  "last_modified_by": "admin",
  "type": "box",
  "jsonmodel_type": "top_container",
  "uri": "/repositories/24/top_containers/24470",
  "repository": {
    "ref": "/repositories/24",
    "_resolved": {
      "lock_version": 1,
      "repo_code": "HOU",
      "name": "Houghton Library",
      "org_code": "MH-H",
      "url": "http://nrs.harvard.edu/urn-3:hul.ois:HOU",
      "image_url": "http://nrs.harvard.edu/urn-3:HUL.OIS:fas_shield",
      "created_by": "admin",
      "last_modified_by": "admin",
      "publish": true,
      "jsonmodel_type": "repository",
      "uri": "/repositories/24",
      "display_string": "Houghton Library (HOU)",
      "agent_representation": {
        "ref": "/agents/corporate_entities/1511"
      }
    }
  },
  "restricted": false,
  "is_linked_to_published_record": true,
  "display_string": "Box 1: Series pfMS Am 21",
  "long_display_string": "MS Am 21, MS Am 21.5, MCZ 118, Series pfMS Am 21, Box 1"
}
from asnake.client import ASnakeClient

client = ASnakeClient()
client.authorize()

client.get('repositories/24/top_container', params={'resolve': ['repository']}).json()

# JSON Output: Some keys have been left out in order to make the example shorter.

{
  "lock_version": 11,
  "indicator": "1",
  "created_by": "admin",
  "last_modified_by": "admin",
  "type": "box",
  "jsonmodel_type": "top_container",
  "uri": "/repositories/24/top_containers/24470",
  "repository": {
    "ref": "/repositories/24",
    "_resolved": {
      "lock_version": 1,
      "repo_code": "HOU",
      "name": "Houghton Library",
      "org_code": "MH-H",
      "url": "http://nrs.harvard.edu/urn-3:hul.ois:HOU",
      "image_url": "http://nrs.harvard.edu/urn-3:HUL.OIS:fas_shield",
      "created_by": "admin",
      "last_modified_by": "admin",
      "publish": True,
      "jsonmodel_type": "repository",
      "uri": "/repositories/24",
      "display_string": "Houghton Library (HOU)",
      "agent_representation": {"ref": "/agents/corporate_entities/1511"}}},
  "restricted": False,
  "is_linked_to_published_record": True,
  "display_string": "Box 1: Series pfMS Am 21",
  "long_display_string": "MS Am 21, MS Am 21.5, MCZ 118, Series pfMS Am 21, Box 1"
}

In ArchivesSpace’s JSONModel schema, a ref is a link to another object. They take the general form of a JSON object with a ref key, containing the URI of an object in ArchivesSpace, and optionally other attributes. For example, a ref to a resource might look like this:

{'ref': '/repositories/13/resources/155'}

The :resolve parameter is a way to tell ArchivesSpace to attach the full object to these refs; it is passed in as an array of keys to “prefetch” in the returned JSON. The object is included in the ref under a _resolved key.

ArchivesSpace REST API

As of 2021-09-21 14:08:49 -0400 the following REST endpoints exist in the master branch of the development repository:

Create a corporate entity agent

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"agent_corporate_entity",
"agent_contacts":[{ "jsonmodel_type":"agent_contact",
"telephones":[{ "jsonmodel_type":"telephone",
"number":"37234 6300 054",
"ext":"E953C566558"}],
"notes":[{ "jsonmodel_type":"note_contact_note",
"date_of_contact":"TY918852M",
"contact_notes":"TTM483M"}],
"is_representative":false,
"name":"Name Number 6",
"address_1":"C386HET",
"address_3":"NPU409W",
"city":"BI351496828",
"region":"F94501NR",
"fax":"EKE354J",
"email_signature":"YSEXM"}],
"agent_record_controls":[],
"agent_alternate_sets":[],
"agent_conventions_declarations":[],
"agent_other_agency_codes":[],
"agent_maintenance_histories":[],
"agent_record_identifiers":[],
"agent_identifiers":[],
"agent_sources":[],
"agent_places":[],
"agent_occupations":[],
"agent_functions":[],
"agent_topics":[],
"agent_resources":[],
"linked_agent_roles":[],
"external_documents":[],
"notes":[],
"used_within_repositories":[],
"used_within_published_repositories":[],
"dates_of_existence":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"used_languages":[],
"metadata_rights_declarations":[],
"is_slug_auto":true,
"names":[{ "jsonmodel_type":"name_corporate_entity",
"use_dates":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"authorized":false,
"is_display_name":false,
"sort_name_auto_generate":true,
"conference_meeting":false,
"jurisdiction":false,
"parallel_names":[],
"rules":"aacr",
"primary_name":"Name Number 5",
"subordinate_name_1":"7968494U545",
"subordinate_name_2":"QXX604O",
"number":"V441C455I",
"sort_name":"SORT v - 4",
"qualifier":"BHK735T",
"dates":"C140KVG",
"authority_id":"http://www.example-8-1632179081.com",
"source":"nad"}],
"related_agents":[],
"agent_type":"agent_corporate_entity"}' \
  "http://localhost:8089/agents/corporate_entities"

Endpoint

[:POST] /agents/corporate_entities

Description

Create a corporate entity agent.

Accepts Payload of Type

JSONModel(:agent_corporate_entity)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

List all corporate entity agents

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/corporate_entities?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/corporate_entities?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/corporate_entities?all_ids=true"

Endpoint

[:GET] /agents/corporate_entities

Description

List all corporate entity agents.

Parameters

Returns

200 – [(:agent_corporate_entity)]

Update a corporate entity agent

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"agent_corporate_entity",
"agent_contacts":[{ "jsonmodel_type":"agent_contact",
"telephones":[{ "jsonmodel_type":"telephone",
"number":"37234 6300 054",
"ext":"E953C566558"}],
"notes":[{ "jsonmodel_type":"note_contact_note",
"date_of_contact":"TY918852M",
"contact_notes":"TTM483M"}],
"is_representative":false,
"name":"Name Number 6",
"address_1":"C386HET",
"address_3":"NPU409W",
"city":"BI351496828",
"region":"F94501NR",
"fax":"EKE354J",
"email_signature":"YSEXM"}],
"agent_record_controls":[],
"agent_alternate_sets":[],
"agent_conventions_declarations":[],
"agent_other_agency_codes":[],
"agent_maintenance_histories":[],
"agent_record_identifiers":[],
"agent_identifiers":[],
"agent_sources":[],
"agent_places":[],
"agent_occupations":[],
"agent_functions":[],
"agent_topics":[],
"agent_resources":[],
"linked_agent_roles":[],
"external_documents":[],
"notes":[],
"used_within_repositories":[],
"used_within_published_repositories":[],
"dates_of_existence":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"used_languages":[],
"metadata_rights_declarations":[],
"is_slug_auto":true,
"names":[{ "jsonmodel_type":"name_corporate_entity",
"use_dates":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"authorized":false,
"is_display_name":false,
"sort_name_auto_generate":true,
"conference_meeting":false,
"jurisdiction":false,
"parallel_names":[],
"rules":"aacr",
"primary_name":"Name Number 5",
"subordinate_name_1":"7968494U545",
"subordinate_name_2":"QXX604O",
"number":"V441C455I",
"sort_name":"SORT v - 4",
"qualifier":"BHK735T",
"dates":"C140KVG",
"authority_id":"http://www.example-8-1632179081.com",
"source":"nad"}],
"related_agents":[],
"agent_type":"agent_corporate_entity"}' \
  "http://localhost:8089/agents/corporate_entities/1"

Endpoint

[:POST] /agents/corporate_entities/:id

Description

Update a corporate entity agent.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Accepts Payload of Type

JSONModel(:agent_corporate_entity)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Get a corporate entity by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/corporate_entities/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /agents/corporate_entities/:id

Description

Get a corporate entity by ID.

Parameters

Parameter Description Type Optional?
id ID of the corporate entity agent Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:agent_corporate_entity)

404 – Not found

Delete a corporate entity agent

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/agents/corporate_entities/1"

Endpoint

[:DELETE] /agents/corporate_entities/:id

Description

Delete a corporate entity agent.

Parameters

Parameter Description Type Optional?
id ID of the corporate entity agent Integer

Returns

200 – deleted

Publish a corporate entity agent and all its sub-records

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/agents/corporate_entities/1/publish"

Endpoint

[:POST] /agents/corporate_entities/:id/publish

Description

Publish a corporate entity agent and all its sub-records.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Create a family agent

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"agent_family",
"agent_contacts":[],
"agent_record_controls":[],
"agent_alternate_sets":[],
"agent_conventions_declarations":[],
"agent_other_agency_codes":[],
"agent_maintenance_histories":[],
"agent_record_identifiers":[],
"agent_identifiers":[],
"agent_sources":[],
"agent_places":[],
"agent_occupations":[],
"agent_functions":[],
"agent_topics":[],
"agent_resources":[],
"linked_agent_roles":[],
"external_documents":[],
"notes":[],
"used_within_repositories":[],
"used_within_published_repositories":[],
"dates_of_existence":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"used_languages":[],
"metadata_rights_declarations":[],
"is_slug_auto":true,
"names":[{ "jsonmodel_type":"name_family",
"use_dates":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"authorized":false,
"is_display_name":false,
"sort_name_auto_generate":true,
"parallel_names":[],
"rules":"aacr",
"family_name":"Name Number 3",
"sort_name":"SORT j - 2",
"dates":"866654628PU",
"qualifier":"SNCOB",
"prefix":"V327753799131",
"authority_id":"http://www.example-4-1632179079.com",
"source":"ingest"}],
"related_agents":[],
"agent_type":"agent_family"}' \
  "http://localhost:8089/agents/families"

Endpoint

[:POST] /agents/families

Description

Create a family agent.

Accepts Payload of Type

JSONModel(:agent_family)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

List all family agents

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/families?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/families?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/families?all_ids=true"

Endpoint

[:GET] /agents/families

Description

List all family agents.

Parameters

Returns

200 – [(:agent_family)]

Update a family agent

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"agent_family",
"agent_contacts":[],
"agent_record_controls":[],
"agent_alternate_sets":[],
"agent_conventions_declarations":[],
"agent_other_agency_codes":[],
"agent_maintenance_histories":[],
"agent_record_identifiers":[],
"agent_identifiers":[],
"agent_sources":[],
"agent_places":[],
"agent_occupations":[],
"agent_functions":[],
"agent_topics":[],
"agent_resources":[],
"linked_agent_roles":[],
"external_documents":[],
"notes":[],
"used_within_repositories":[],
"used_within_published_repositories":[],
"dates_of_existence":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"used_languages":[],
"metadata_rights_declarations":[],
"is_slug_auto":true,
"names":[{ "jsonmodel_type":"name_family",
"use_dates":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"authorized":false,
"is_display_name":false,
"sort_name_auto_generate":true,
"parallel_names":[],
"rules":"aacr",
"family_name":"Name Number 3",
"sort_name":"SORT j - 2",
"dates":"866654628PU",
"qualifier":"SNCOB",
"prefix":"V327753799131",
"authority_id":"http://www.example-4-1632179079.com",
"source":"ingest"}],
"related_agents":[],
"agent_type":"agent_family"}' \
  "http://localhost:8089/agents/families/1"

Endpoint

[:POST] /agents/families/:id

Description

Update a family agent.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Accepts Payload of Type

JSONModel(:agent_family)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Get a family by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/families/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /agents/families/:id

Description

Get a family by ID.

Parameters

Parameter Description Type Optional?
id ID of the family agent Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:agent)

404 – Not found

Delete an agent family

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/agents/families/1"

Endpoint

[:DELETE] /agents/families/:id

Description

Delete an agent family.

Parameters

Parameter Description Type Optional?
id ID of the family agent Integer

Returns

200 – deleted

Publish a family agent and all its sub-records

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/agents/families/1/publish"

Endpoint

[:POST] /agents/families/:id/publish

Description

Publish a family agent and all its sub-records.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Create a person agent

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"agent_person",
"agent_contacts":[],
"agent_record_controls":[],
"agent_alternate_sets":[],
"agent_conventions_declarations":[],
"agent_other_agency_codes":[],
"agent_maintenance_histories":[],
"agent_record_identifiers":[],
"agent_identifiers":[],
"agent_sources":[],
"agent_places":[],
"agent_occupations":[],
"agent_functions":[],
"agent_topics":[],
"agent_resources":[],
"linked_agent_roles":[],
"external_documents":[],
"notes":[],
"used_within_repositories":[],
"used_within_published_repositories":[],
"dates_of_existence":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"used_languages":[],
"metadata_rights_declarations":[],
"is_slug_auto":true,
"names":[{ "jsonmodel_type":"name_person",
"use_dates":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"authorized":false,
"is_display_name":false,
"sort_name_auto_generate":true,
"parallel_names":[],
"rules":"aacr",
"source":"naf",
"primary_name":"Name Number 14",
"sort_name":"SORT m - 10",
"name_order":"direct",
"number":"25214C963586",
"dates":"306TWVY",
"qualifier":"Y62VFF",
"fuller_form":"OETNM",
"prefix":"325LCW206",
"title":"193294WA536",
"suffix":"LOK423R",
"rest_of_name":"TJDCW",
"authority_id":"http://www.example-25-1632179086.com"}],
"agent_genders":[],
"related_agents":[],
"agent_type":"agent_person"}' \
  "http://localhost:8089/agents/people"

Endpoint

[:POST] /agents/people

Description

Create a person agent.

Accepts Payload of Type

JSONModel(:agent_person)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

List all person agents

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/people?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/people?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/people?all_ids=true"

Endpoint

[:GET] /agents/people

Description

List all person agents.

Parameters

Returns

200 – [(:agent_person)]

Update a person agent

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"agent_person",
"agent_contacts":[],
"agent_record_controls":[],
"agent_alternate_sets":[],
"agent_conventions_declarations":[],
"agent_other_agency_codes":[],
"agent_maintenance_histories":[],
"agent_record_identifiers":[],
"agent_identifiers":[],
"agent_sources":[],
"agent_places":[],
"agent_occupations":[],
"agent_functions":[],
"agent_topics":[],
"agent_resources":[],
"linked_agent_roles":[],
"external_documents":[],
"notes":[],
"used_within_repositories":[],
"used_within_published_repositories":[],
"dates_of_existence":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"used_languages":[],
"metadata_rights_declarations":[],
"is_slug_auto":true,
"names":[{ "jsonmodel_type":"name_person",
"use_dates":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"authorized":false,
"is_display_name":false,
"sort_name_auto_generate":true,
"parallel_names":[],
"rules":"aacr",
"source":"naf",
"primary_name":"Name Number 14",
"sort_name":"SORT m - 10",
"name_order":"direct",
"number":"25214C963586",
"dates":"306TWVY",
"qualifier":"Y62VFF",
"fuller_form":"OETNM",
"prefix":"325LCW206",
"title":"193294WA536",
"suffix":"LOK423R",
"rest_of_name":"TJDCW",
"authority_id":"http://www.example-25-1632179086.com"}],
"agent_genders":[],
"related_agents":[],
"agent_type":"agent_person"}' \
  "http://localhost:8089/agents/people/1"

Endpoint

[:POST] /agents/people/:id

Description

Update a person agent.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Accepts Payload of Type

JSONModel(:agent_person)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Get a person by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/people/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /agents/people/:id

Description

Get a person by ID.

Parameters

Parameter Description Type Optional?
id ID of the person agent Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:agent)

404 – Not found

Delete an agent person

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/agents/people/1"

Endpoint

[:DELETE] /agents/people/:id

Description

Delete an agent person.

Parameters

Parameter Description Type Optional?
id ID of the person agent Integer

Returns

200 – deleted

Publish an agent person and all its sub-records

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/agents/people/1/publish"

Endpoint

[:POST] /agents/people/:id/publish

Description

Publish an agent person and all its sub-records.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Create a software agent

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"agent_software",
"agent_contacts":[],
"agent_record_controls":[],
"agent_alternate_sets":[],
"agent_conventions_declarations":[],
"agent_other_agency_codes":[],
"agent_maintenance_histories":[],
"agent_record_identifiers":[],
"agent_identifiers":[],
"agent_sources":[],
"agent_places":[],
"agent_occupations":[],
"agent_functions":[],
"agent_topics":[],
"agent_resources":[],
"linked_agent_roles":[],
"external_documents":[],
"notes":[],
"used_within_repositories":[],
"used_within_published_repositories":[],
"dates_of_existence":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"used_languages":[],
"metadata_rights_declarations":[],
"is_slug_auto":true,
"names":[{ "jsonmodel_type":"name_software",
"use_dates":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"authorized":false,
"is_display_name":false,
"sort_name_auto_generate":true,
"parallel_names":[],
"rules":"dacs",
"source":"snac",
"software_name":"Name Number 12",
"sort_name":"SORT k - 9",
"qualifier":"TRO425606",
"dates":"KHBP456",
"authority_id":"http://www.example-24-1632179086.com"}],
"agent_type":"agent_software"}' \
  "http://localhost:8089/agents/software"

Endpoint

[:POST] /agents/software

Description

Create a software agent.

Accepts Payload of Type

JSONModel(:agent_software)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

List all software agents

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/software?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/software?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/software?all_ids=true"

Endpoint

[:GET] /agents/software

Description

List all software agents.

Parameters

Returns

200 – [(:agent_software)]

Update a software agent

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"agent_software",
"agent_contacts":[],
"agent_record_controls":[],
"agent_alternate_sets":[],
"agent_conventions_declarations":[],
"agent_other_agency_codes":[],
"agent_maintenance_histories":[],
"agent_record_identifiers":[],
"agent_identifiers":[],
"agent_sources":[],
"agent_places":[],
"agent_occupations":[],
"agent_functions":[],
"agent_topics":[],
"agent_resources":[],
"linked_agent_roles":[],
"external_documents":[],
"notes":[],
"used_within_repositories":[],
"used_within_published_repositories":[],
"dates_of_existence":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"used_languages":[],
"metadata_rights_declarations":[],
"is_slug_auto":true,
"names":[{ "jsonmodel_type":"name_software",
"use_dates":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"authorized":false,
"is_display_name":false,
"sort_name_auto_generate":true,
"parallel_names":[],
"rules":"dacs",
"source":"snac",
"software_name":"Name Number 12",
"sort_name":"SORT k - 9",
"qualifier":"TRO425606",
"dates":"KHBP456",
"authority_id":"http://www.example-24-1632179086.com"}],
"agent_type":"agent_software"}' \
  "http://localhost:8089/agents/software/1"

Endpoint

[:POST] /agents/software/:id

Description

Update a software agent.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Accepts Payload of Type

JSONModel(:agent_software)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Get a software agent by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/agents/software/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /agents/software/:id

Description

Get a software agent by ID.

Parameters

Parameter Description Type Optional?
id ID of the software agent Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:agent)

404 – Not found

Delete a software agent

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/agents/software/1"

Endpoint

[:DELETE] /agents/software/:id

Description

Delete a software agent.

Parameters

Parameter Description Type Optional?
id ID of the software agent Integer

Returns

200 – deleted

Publish a software agent and all its sub-records

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/agents/software/1/publish"

Endpoint

[:POST] /agents/software/:id/publish

Description

Publish a software agent and all its sub-records.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Redirect to resource identified by ARK Name

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/ark*/1/1"

Endpoint

[:GET] /ark*/:naan/:id

Description

Redirect to resource identified by ARK Name.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Returns

404 – Not found

302 – redirect

Carry out delete requests against a list of records

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/batch_delete?record_uris=Y528728UT"

Endpoint

[:POST] /batch_delete

Description

Carry out delete requests against a list of records.

Parameters

Parameter Description Type Optional?
record_uris A list of record uris [String]

Returns

200 – deleted

List records by their external ID(s)

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/by-external-id?eid=I99672GU&type=D66246E881"

Endpoint

[:GET] /by-external-id

Description

List records by their external ID(s).

Parameters

Parameter Description Type Optional?
eid An external ID to find String
type The record type to search (useful if IDs may be shared between different types) [String] true

Returns

303 – A redirect to the URI named by the external ID (if there’s only one)

300 – A JSON-formatted list of URIs if there were multiple matches

404 – No external ID matched

Get an Enumeration Value

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/config/enumeration_values/1"

Endpoint

[:GET] /config/enumeration_values/:enum_val_id

Description

Get an Enumeration Value.

Parameters

Parameter Description Type Optional?
enum_val_id The ID of the enumeration value to retrieve Integer

Returns

200 – (:enumeration_value)

Update an enumeration value

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/config/enumeration_values/1"

Endpoint

[:POST] /config/enumeration_values/:enum_val_id

Description

Update an enumeration value.

Parameters

Parameter Description Type Optional?
enum_val_id The ID of the enumeration value to update Integer

Accepts Payload of Type

JSONModel(:enumeration_value)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Update the position of an ennumeration value

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/config/enumeration_values/1/position?position=1"

Endpoint

[:POST] /config/enumeration_values/:enum_val_id/position

Description

Update the position of an ennumeration value.

Parameters

Parameter Description Type Optional?
enum_val_id The ID of the enumeration value to update Integer
position The target position in the value list Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Suppress this value

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/config/enumeration_values/1/suppressed?suppressed=true"

Endpoint

[:POST] /config/enumeration_values/:enum_val_id/suppressed

Description

Suppress this value.

Parameters

Parameter Description Type Optional?
enum_val_id The ID of the enumeration value to update Integer
suppressed Suppression state RESTHelpers::BooleanParam

Returns

200 – {:status => “Suppressed”, :id => (id of updated object), :suppressed_state => (true|false)}

400 – {:error => (description of error)}

List all defined enumerations

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/config/enumerations"

Endpoint

[:GET] /config/enumerations

Description

List all defined enumerations.

Returns

200 – [(:enumeration)]

Create an enumeration

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/config/enumerations"

Endpoint

[:POST] /config/enumerations

Description

Create an enumeration.

Accepts Payload of Type

JSONModel(:enumeration)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Update an enumeration

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/config/enumerations/1"

Endpoint

[:POST] /config/enumerations/:enum_id

Description

Update an enumeration.

Parameters

Parameter Description Type Optional?
enum_id The ID of the enumeration to update Integer

Accepts Payload of Type

JSONModel(:enumeration)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Get an Enumeration

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/config/enumerations/1"

Endpoint

[:GET] /config/enumerations/:enum_id

Description

Get an Enumeration.

Parameters

Parameter Description Type Optional?
enum_id The ID of the enumeration to retrieve Integer

Returns

200 – (:enumeration)

List all defined enumerations as a csv

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/config/enumerations/csv"

Endpoint

[:GET] /config/enumerations/csv

Description

List all defined enumerations as a csv.

Returns

200 – (csv)

Migrate all records from one value to another

curl -H 'Content-Type: application/json' \
    -H "X-ArchivesSpace-Session: $SESSION" \
    -d '{"enum_uri": "/config/enumerations/17", "from": "sir", "to": "mr"}' \
    "http://localhost:8089/config/enumerations/migration"

from asnake.client import ASnakeClient

client = ASnakeClient()
client.authorize()

client.post('/config/enumerations/migration',
            json={
                'enum_uri': '/config/enumerations/17',
                'from': 'sir', #value to be deleted
                'to': 'mr' #value to merge into
                }
            )

Endpoint

[:POST] /config/enumerations/migration

Description

Migrate all records from one value to another.

Accepts Payload of Type

JSONModel(:enumeration_migration)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

404 – Not found

Get an Enumeration by Name

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/config/enumerations/names/1"

Endpoint

[:GET] /config/enumerations/names/:enum_name

Description

Get an Enumeration by Name.

Parameters

Parameter Description Type Optional?
enum_name The name of the enumeration to retrieve String

Returns

200 – (:enumeration)

Create a Container_Profile

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"container_profile",
"name":"GNY733C",
"url":"Q182UQK",
"dimension_units":"inches",
"extent_dimension":"width",
"depth":"70",
"height":"37",
"width":"46"}' \
  "http://localhost:8089/container_profiles"

Endpoint

[:POST] /container_profiles

Description

Create a Container_Profile.

Accepts Payload of Type

JSONModel(:container_profile)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

Get a list of Container Profiles

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/container_profiles?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/container_profiles?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/container_profiles?all_ids=true"

Endpoint

[:GET] /container_profiles

Description

Get a list of Container Profiles.

Parameters

Returns

200 – [(:container_profile)]

Update a Container Profile

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"container_profile",
"name":"GNY733C",
"url":"Q182UQK",
"dimension_units":"inches",
"extent_dimension":"width",
"depth":"70",
"height":"37",
"width":"46"}' \
  "http://localhost:8089/container_profiles/1"

Endpoint

[:POST] /container_profiles/:id

Description

Update a Container Profile.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Accepts Payload of Type

JSONModel(:container_profile)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get a Container Profile by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/container_profiles/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /container_profiles/:id

Description

Get a Container Profile by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:container_profile)

Delete an Container Profile

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/container_profiles/1"

Endpoint

[:DELETE] /container_profiles/:id

Description

Delete an Container Profile.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Returns

200 – deleted

Get the global Preferences records for the current user.

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/current_global_preferences"

Endpoint

[:GET] /current_global_preferences

Description

Get the global Preferences records for the current user..

Returns

200 – {(:preference)}

Calculate the dates of an archival object tree

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/date_calculator?record_uri=T229BF39&label=WV17C702"

Endpoint

[:GET] /date_calculator

Description

Calculate the dates of an archival object tree.

Parameters

Parameter Description Type Optional?
record_uri The uri of the object String
label The date label to filter on String true

Returns

200 – Calculation results

Get a stream of deleted records

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/delete-feed?page=1&page_size=10"

Endpoint

[:GET] /delete-feed

Description

Get a stream of deleted records.

Parameters

Returns

200 – a list of URIs that were deleted

Calculate the extent of an archival object tree

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/extent_calculator?record_uri=TBIUC&unit=233568MEK"

Endpoint

[:GET] /extent_calculator

Description

Calculate the extent of an archival object tree.

Parameters

Parameter Description Type Optional?
record_uri The uri of the object String
unit The unit of measurement to use String true

Returns

200 – Calculation results

List all supported job types

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/job_types"

Endpoint

[:GET] /job_types

Description

List all supported job types.

Returns

200 – A list of supported job types

Create a Location_Profile

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"location_profile",
"name":"ELLIM",
"dimension_units":"millimeters",
"depth":"88",
"height":"59",
"width":"10"}' \
  "http://localhost:8089/location_profiles"

Endpoint

[:POST] /location_profiles

Description

Create a Location_Profile.

Accepts Payload of Type

JSONModel(:location_profile)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

Get a list of Location Profiles

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/location_profiles?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/location_profiles?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/location_profiles?all_ids=true"

Endpoint

[:GET] /location_profiles

Description

Get a list of Location Profiles.

Parameters

Returns

200 – [(:location_profile)]

Update a Location Profile

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"location_profile",
"name":"ELLIM",
"dimension_units":"millimeters",
"depth":"88",
"height":"59",
"width":"10"}' \
  "http://localhost:8089/location_profiles/1"

Endpoint

[:POST] /location_profiles/:id

Description

Update a Location Profile.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Accepts Payload of Type

JSONModel(:location_profile)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get a Location Profile by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/location_profiles/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /location_profiles/:id

Description

Get a Location Profile by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:location_profile)

Delete an Location Profile

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/location_profiles/1"

Endpoint

[:DELETE] /location_profiles/:id

Description

Delete an Location Profile.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Returns

200 – deleted

Create a Location

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"location",
"external_ids":[],
"functions":[],
"building":"36 E 5th Street",
"floor":"9",
"room":"2",
"area":"Back",
"barcode":"10000110011110101100",
"temporary":"conservation"}' \
  "http://localhost:8089/locations"

Endpoint

[:POST] /locations

Description

Create a Location.

Accepts Payload of Type

JSONModel(:location)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

Get a list of locations

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/locations?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/locations?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/locations?all_ids=true"

Endpoint

[:GET] /locations

Description

Get a list of locations.

Parameters

Returns

200 – [(:location)]

Update a Location

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"location",
"external_ids":[],
"functions":[],
"building":"36 E 5th Street",
"floor":"9",
"room":"2",
"area":"Back",
"barcode":"10000110011110101100",
"temporary":"conservation"}' \
  "http://localhost:8089/locations/1"

Endpoint

[:POST] /locations/:id

Description

Update a Location.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Accepts Payload of Type

JSONModel(:location)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get a Location by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/locations/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /locations/:id

Description

Get a Location by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:location)

Delete a Location

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/locations/1"

Endpoint

[:DELETE] /locations/:id

Description

Delete a Location.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Returns

200 – deleted

Create a Batch of Locations

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/locations/batch?dry_run=true"

Endpoint

[:POST] /locations/batch

Description

Create a Batch of Locations.

Parameters

Parameter Description Type Optional?
dry_run If true, don’t create the locations, just list them RESTHelpers::BooleanParam true

Accepts Payload of Type

JSONModel(:location_batch)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Update a Location

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/locations/batch_update"

Endpoint

[:POST] /locations/batch_update

Description

Update a Location.

Accepts Payload of Type

JSONModel(:location_batch_update)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Log out the current session

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/logout"

Endpoint

[:POST] /logout

Description

Log out the current session.

Returns

200 – Session logged out

Carry out a merge request against Agent records

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/merge_requests/agent"

Endpoint

[:POST] /merge_requests/agent

Description

Carry out a merge request against Agent records.

Accepts Payload of Type

JSONModel(:merge_request)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Carry out a detailed merge request against Agent records

curl -H 'Content-Type: application/json' \
    -H "X-ArchivesSpace-Session: $SESSION" \
    -d '{"dry_run":true, \
         "merge_request_detail":{ \
           "jsonmodel_type":"merge_request_detail", \
           "victims":[{"ref":"/agents/people/3"}], \
           "target":{"ref":"/agents/people/4"}, \
           "selections":{
             "names":[{"primary_name":"REPLACE", "position":"0"}], \
             "agent_record_identifiers":[{"append":"APPEND", "position":"0"}], \
             "agent_conventions_declarations":[
               {"append":"REPLACE", "position":"1"}, \
               {"append":"REPLACE", "position":"0"} \
              ],
           } \
        } \
      } \
    "http://localhost:8089/merge_requests/agent_detail"

Endpoint

[:POST] /merge_requests/agent_detail

Description

Carry out a detailed merge request against Agent records.

Parameters

Parameter Description Type Optional?
dry_run If true, don’t process the merge, just display the merged record RESTHelpers::BooleanParam true

Accepts Payload of Type

JSONModel(:merge_request_detail)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Carry out a merge request against Container Profile records

curl -H 'Content-Type: application/json' \
    -H "X-ArchivesSpace-Session: $SESSION" \
    -d '{"uri": "merge_requests/container_profile", "target": {"ref": "/container_profiles/1" },"victims": [{"ref": "/container_profiles/2"}]}' \
    "http://localhost:8089/merge_requests/container_profile"

from asnake.client import ASnakeClient
client = ASnakeClient()
client.authorize()
client.post('/merge_requests/container_profile',
        json={
            'uri': 'merge_requests/container_profile',
            'target': {
                'ref': '/container_profiles/1'
              },
            'victims': [
                {
                    'ref': '/container_profiles/2'
                }
              ]
            }
      )

Endpoint

[:POST] /merge_requests/container_profile

Description

Carry out a merge request against Container Profile records.

Accepts Payload of Type

JSONModel(:merge_request)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Carry out a merge request against Digital_Object records

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/merge_requests/digital_object"

Endpoint

[:POST] /merge_requests/digital_object

Description

Carry out a merge request against Digital_Object records.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:merge_request)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Carry out a merge request against Resource records

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/merge_requests/resource"

Endpoint

[:POST] /merge_requests/resource

Description

Carry out a merge request against Resource records.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:merge_request)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Carry out a merge request against Subject records

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/merge_requests/subject"

Endpoint

[:POST] /merge_requests/subject

Description

Carry out a merge request against Subject records.

Accepts Payload of Type

JSONModel(:merge_request)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Carry out a merge request against Top Container records

curl -H 'Content-Type: application/json' \
    -H "X-ArchivesSpace-Session: $SESSION" \
    -d '{"uri": "merge_requests/top_container", "target": {"ref": "/repositories/2/top_containers/1" },"victims": [{"ref": "/repositories/2/top_containers/2"}]}' \
    "http://localhost:8089/merge_requests/top_container?repo_id=2"

from asnake.client import ASnakeClient
client = ASnakeClient()
client.authorize()
client.post('/merge_requests/top_container?repo_id=2',
        json={
            'uri': 'merge_requests/top_container',
            'target': {
                'ref': '/repositories/2/top_containers/80'
              },
            'victims': [
                {
                    'ref': '/repositories/2/top_containers/171'
                }
              ]
            }
      )

Endpoint

[:POST] /merge_requests/top_container

Description

Carry out a merge request against Top Container records.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:merge_request)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get a stream of notifications

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/notifications?last_sequence=1"

Endpoint

[:GET] /notifications

Description

Get a stream of notifications.

Parameters

Parameter Description Type Optional?
last_sequence The last sequence number seen Integer true

Returns

200 – a list of notifications

Get a list of Permissions

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/permissions?level=LGJCG"

Endpoint

[:GET] /permissions

Description

Get a list of Permissions.

Parameters

Parameter Description Type Optional?
level The permission level to get (one of: repository, global, all)
Note: Must be one of repository, global, all
String

Returns

200 – [(:permission)]

List all reports

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/reports"

Endpoint

[:GET] /reports

Description

List all reports.

Returns

200 – report list in json

Get a list of availiable options for custom reports

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/reports/custom_data"

Endpoint

[:GET] /reports/custom_data

Description

Get a list of availiable options for custom reports.

Returns

200 –

h – a

Get a static asset for a report

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/reports/static/*?splat=ER911YQ"

Endpoint

[:GET] /reports/static/*

Description

Get a static asset for a report.

Parameters

Parameter Description Type Optional?
splat The requested asset String

Returns

200 – the asset

Create a Repository

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"repository",
"name":"Description: 2",
"is_slug_auto":true,
"repo_code":"ASPACE REPO 2 -- 119175",
"org_code":"IQNTA",
"image_url":"http://www.example-2-1632179079.com",
"url":"http://www.example-3-1632179079.com",
"country":"US"}' \
  "http://localhost:8089/repositories"

Endpoint

[:POST] /repositories

Description

Create a Repository.

Accepts Payload of Type

JSONModel(:repository)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

403 – access_denied

Get a list of Repositories

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories

Description

Get a list of Repositories.

Parameters

Parameter Description Type Optional?
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – [(:repository)]

Update a repository

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"repository",
"name":"Description: 2",
"is_slug_auto":true,
"repo_code":"ASPACE REPO 2 -- 119175",
"org_code":"IQNTA",
"image_url":"http://www.example-2-1632179079.com",
"url":"http://www.example-3-1632179079.com",
"country":"US"}' \
  "http://localhost:8089/repositories/1"

Endpoint

[:POST] /repositories/:id

Description

Update a repository.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Accepts Payload of Type

JSONModel(:repository)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get a Repository by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:id

Description

Get a Repository by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:repository)

404 – Not found

Delete a Repository

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2"

Endpoint

[:DELETE] /repositories/:repo_id

Description

Delete a Repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Create an Accession

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"accession",
"external_ids":[],
"is_slug_auto":true,
"related_accessions":[],
"accession_date":"2008-10-27",
"classifications":[],
"subjects":[],
"linked_events":[],
"extents":[],
"lang_materials":[],
"dates":[],
"external_documents":[],
"rights_statements":[],
"deaccessions":[],
"related_resources":[],
"restrictions_apply":false,
"access_restrictions":false,
"use_restrictions":false,
"linked_agents":[],
"instances":[],
"metadata_rights_declarations":[],
"id_0":"825292U360R",
"id_1":"201828N940I",
"id_2":"P28SRK",
"id_3":"225WRIG",
"title":"Accession Title: 10",
"content_description":"Description: 10",
"condition_description":"Description: 11"}' \
  "http://localhost:8089/repositories/2/accessions"

Endpoint

[:POST] /repositories/:repo_id/accessions

Description

Create an Accession.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:accession)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

Get a list of Accessions for a Repository

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/accessions?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/accessions?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/accessions?all_ids=true"

Endpoint

[:GET] /repositories/:repo_id/accessions

Description

Get a list of Accessions for a Repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:accession)]

Update an Accession

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"accession",
"external_ids":[],
"is_slug_auto":true,
"related_accessions":[],
"accession_date":"2008-10-27",
"classifications":[],
"subjects":[],
"linked_events":[],
"extents":[],
"lang_materials":[],
"dates":[],
"external_documents":[],
"rights_statements":[],
"deaccessions":[],
"related_resources":[],
"restrictions_apply":false,
"access_restrictions":false,
"use_restrictions":false,
"linked_agents":[],
"instances":[],
"metadata_rights_declarations":[],
"id_0":"825292U360R",
"id_1":"201828N940I",
"id_2":"P28SRK",
"id_3":"225WRIG",
"title":"Accession Title: 10",
"content_description":"Description: 10",
"condition_description":"Description: 11"}' \
  "http://localhost:8089/repositories/2/accessions/1"

Endpoint

[:POST] /repositories/:repo_id/accessions/:id

Description

Update an Accession.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:accession)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get an Accession by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/accessions/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/accessions/:id

Description

Get an Accession by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:accession)

Delete an Accession

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/accessions/1"

Endpoint

[:DELETE] /repositories/:repo_id/accessions/:id

Description

Delete an Accession.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Suppress this record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/accessions/1/suppressed?suppressed=true"

Endpoint

[:POST] /repositories/:repo_id/accessions/:id/suppressed

Description

Suppress this record.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
suppressed Suppression state RESTHelpers::BooleanParam
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Suppressed”, :id => (id of updated object), :suppressed_state => (true|false)}

Get Top Containers linked to an Accession

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/accessions/1/top_containers?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/accessions/:id/top_containers

Description

Get Top Containers linked to an Accession.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – a list of linked top containers

404 – Not found

Transfer this record to a different repository

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/accessions/1/transfer?target_repo=209XW199J"

Endpoint

[:POST] /repositories/:repo_id/accessions/:id/transfer

Description

Transfer this record to a different repository.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
target_repo The URI of the target repository String
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – moved

Get metadata for an MARC Auth export of a corporate entity

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/agents/corporate_entities/marc21/1.:fmt/metadata"

Endpoint

[:GET] /repositories/:repo_id/agents/corporate_entities/marc21/:id.:fmt/metadata

Description

Get metadata for an MARC Auth export of a corporate entity.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – The export metadata

Get a MARC Auth representation of a Corporate Entity

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/agents/corporate_entities/marc21/1.xml"

Endpoint

[:GET] /repositories/:repo_id/agents/corporate_entities/marc21/:id.xml

Description

Get a MARC Auth representation of a Corporate Entity.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:agent)

Get metadata for an MARC Auth export of a family

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/agents/families/marc21/1.:fmt/metadata"

Endpoint

[:GET] /repositories/:repo_id/agents/families/marc21/:id.:fmt/metadata

Description

Get metadata for an MARC Auth export of a family.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – The export metadata

Get an MARC Auth representation of a Family

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/agents/families/marc21/1.xml"

Endpoint

[:GET] /repositories/:repo_id/agents/families/marc21/:id.xml

Description

Get an MARC Auth representation of a Family.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:agent)

Get metadata for an MARC Auth export of a person

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/agents/people/marc21/1.:fmt/metadata"

Endpoint

[:GET] /repositories/:repo_id/agents/people/marc21/:id.:fmt/metadata

Description

Get metadata for an MARC Auth export of a person.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – The export metadata

Get an MARC Auth representation of an Person

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/agents/people/marc21/1.xml"

Endpoint

[:GET] /repositories/:repo_id/agents/people/marc21/:id.xml

Description

Get an MARC Auth representation of an Person.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:agent)

Get metadata for an EAC-CPF export of a corporate entity

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/archival_contexts/corporate_entities/1238.:fmt/metadata"

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

eac_cpf_corp_fmt = client.get("/repositories/2/archival_contexts/corporate_entities/1238.:fmt/metadata")
# replace 2 for your repository ID and 1238 with your corporate agent ID. Find these at the URI on the staff interface

print(eac_cpf_corp_fmt.content)
# Sample output: {"filename":"title_20210218_182435_UTC__eac.xml","mimetype":"application/xml"}

# For error handling, print or log the returned value of client.get with .json() - print(eac_cpf_corp_fmt.json())

Endpoint

[:GET] /repositories/:repo_id/archival_contexts/corporate_entities/:id.:fmt/metadata

Description

Get metadata for an EAC-CPF export of a corporate entity.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – The export metadata

Get an EAC-CPF representation of a Corporate Entity

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/archival_contexts/corporate_entities/1238.xml" --output eac_cpf_corp.xml

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

eac_cpf_corp_xml = client.get("/repositories/2/archival_contexts/corporate_entities/1238.xml")
# replace 2 for your repository ID and 1238 with your corporate agent ID. Find these at the URI on the staff interface

with open("eac_cpf_corp.xml", "wb") as file:  # save the file
    file.write(eac_cpf_corp_xml.content)  # write the file content to our file.
    file.close()

# For error handling, print or log the returned value of client.get with .json() - print(eac_cpf_corp_xml.json())

Endpoint

[:GET] /repositories/:repo_id/archival_contexts/corporate_entities/:id.xml

Description

Get an EAC-CPF representation of a Corporate Entity.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:agent)

Get metadata for an EAC-CPF export of a family

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/archival_contexts/families/479.:fmt/metadata" --output eac_cpf_fam.fmt

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

eac_cpf_fam_fmt = client.get("/repositories/2/archival_contexts/families/479.:fmt/metadata")
# replace 2 for your repository ID and 479 with your family agent ID. Find these at the URI on the staff interface

print(eac_cpf_fam_fmt.content)
# Sample output: {"filename":"Adams_family_20210218_182435_UTC__eac.xml","mimetype":"application/xml"}

# For error handling, print or log the returned value of client.get with .json() - print(eac_cpf_fam_fmt.json())

Endpoint

[:GET] /repositories/:repo_id/archival_contexts/families/:id.:fmt/metadata

Description

Get metadata for an EAC-CPF export of a family.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – The export metadata

Get an EAC-CPF representation of a Family

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/archival_contexts/families/479.xml" --output eac_cpf_fam.xml

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

eac_cpf_fam_xml = client.get("/repositories/2/archival_contexts/families/479.xml")
# replace 2 for your repository ID and 479 with your family agent ID. Find these at the URI on the staff interface

with open("eac_cpf_fam.xml", "wb") as file:  # save the file
    file.write(eac_cpf_fam_xml.content)  # write the file content to our file.
    file.close()

# For error handling, print or log the returned value of client.get with .json() - print(eac_cpf_fam_xml.json())

Endpoint

[:GET] /repositories/:repo_id/archival_contexts/families/:id.xml

Description

Get an EAC-CPF representation of a Family.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:agent)

Get metadata for an EAC-CPF export of a person

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/archival_contexts/people/159.:fmt/metadata"

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

eac_cpf_fmt = client.get("/repositories/2/archival_contexts/people/159.:fmt/metadata")
# replace 2 for your repository ID and 159 with your agent ID. Find these at the URI on the staff interface

print(eac_cpf_fmt.content)
# Sample output: {"filename":"title_20210218_182435_UTC__eac.xml","mimetype":"application/xml"}

# For error handling, print or log the returned value of client.get with .json() - print(eac_cpf_fmt.json())

Endpoint

[:GET] /repositories/:repo_id/archival_contexts/people/:id.:fmt/metadata

Description

Get metadata for an EAC-CPF export of a person.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – The export metadata

Get an EAC-CPF representation of an Agent

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/archival_contexts/people/159.xml" --output eac_cpf.xml

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

eac_cpf_xml = client.get("/repositories/2/archival_contexts/people/159.xml")
# replace 2 for your repository ID and 159 with your agent ID. Find these at the URI on the staff interface

with open("eac_cpf.xml", "wb") as file:  # save the file
    file.write(eac_cpf_xml.content)  # write the file content to our file.
    file.close()

# For error handling, print or log the returned value of client.get with .json() - print(eac_cpf_xml.json())

Endpoint

[:GET] /repositories/:repo_id/archival_contexts/people/:id.xml

Description

Get an EAC-CPF representation of an Agent.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:agent)

Get metadata for an EAC-CPF export of a software

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/archival_contexts/softwares/1.:fmt/metadata"

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

eac_cpf_soft_fmt = client.get("/repositories/2/archival_contexts/softwares/1.:fmt/metadata")
# replace 2 for your repository ID and 1 with your software agent ID. Find these at the URI on the staff interface

print(eac_cpf_soft_fmt.content)
# Sample output: {"filename":"ArchivesSpace_20210218_182253_UTC__eac.xml","mimetype":"application/xml"}

# For error handling, print or log the returned value of client.get with .json() - print(eac_cpf_soft_fmt.json())

Endpoint

[:GET] /repositories/:repo_id/archival_contexts/softwares/:id.:fmt/metadata

Description

Get metadata for an EAC-CPF export of a software.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – The export metadata

Get an EAC-CPF representation of a Software agent

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/archival_contexts/softwares/1.xml" --output eac_cpf_soft.xml

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

eac_cpf_soft_xml = client.get("/repositories/2/archival_contexts/softwares/1.xml")
# replace 2 for your repository ID and 1 with your software agent ID. Find these at the URI on the staff interface

with open("eac_cpf_soft.xml", "wb") as file:  # save the file
    file.write(eac_cpf_soft_xml.content)  # write the file content to our file.
    file.close()

# For error handling, print or log the returned value of client.get with .json() - print(eac_cpf_soft_xml.json())

Endpoint

[:GET] /repositories/:repo_id/archival_contexts/softwares/:id.xml

Description

Get an EAC-CPF representation of a Software agent.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:agent)

Create an Archival Object

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"archival_object",
"external_ids":[],
"subjects":[],
"linked_events":[],
"extents":[],
"lang_materials":[],
"dates":[],
"external_documents":[],
"rights_statements":[],
"linked_agents":[],
"is_slug_auto":true,
"restrictions_apply":false,
"ancestors":[],
"instances":[],
"notes":[],
"ref_id":"278DLJ927",
"level":"subseries",
"title":"Archival Object Title: 11",
"resource":{ "ref":"/repositories/2/resources/3"}}' \
  "http://localhost:8089/repositories/2/archival_objects"

Endpoint

[:POST] /repositories/:repo_id/archival_objects

Description

Create an Archival Object.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:archival_object)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Get a list of Archival Objects for a Repository

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/archival_objects?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/archival_objects?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/archival_objects?all_ids=true"

Endpoint

[:GET] /repositories/:repo_id/archival_objects

Description

Get a list of Archival Objects for a Repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:archival_object)]

Update an Archival Object

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"archival_object",
"external_ids":[],
"subjects":[],
"linked_events":[],
"extents":[],
"lang_materials":[],
"dates":[],
"external_documents":[],
"rights_statements":[],
"linked_agents":[],
"is_slug_auto":true,
"restrictions_apply":false,
"ancestors":[],
"instances":[],
"notes":[],
"ref_id":"278DLJ927",
"level":"subseries",
"title":"Archival Object Title: 11",
"resource":{ "ref":"/repositories/2/resources/3"}}' \
  "http://localhost:8089/repositories/2/archival_objects/1"

Endpoint

[:POST] /repositories/:repo_id/archival_objects/:id

Description

Update an Archival Object.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:archival_object)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Get an Archival Object by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/archival_objects/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/archival_objects/:id

Description

Get an Archival Object by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:archival_object)

404 – Not found

Delete an Archival Object

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/archival_objects/1"

Endpoint

[:DELETE] /repositories/:repo_id/archival_objects/:id

Description

Delete an Archival Object.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Move existing Archival Objects to become children of an Archival Object

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/archival_objects/1/accept_children?children=BDP950A&position=1"

Endpoint

[:POST] /repositories/:repo_id/archival_objects/:id/accept_children

Description

Move existing Archival Objects to become children of an Archival Object.

Parameters

Parameter Description Type Optional?
children The children to move to the Archival Object [String] true
id The ID of the Archival Object to move children to Integer
position The index for the first child to be moved to Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

409 – {:error => (description of error)}

Get the children of an Archival Object

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/archival_objects/1/children"

Endpoint

[:GET] /repositories/:repo_id/archival_objects/:id/children

Description

Get the children of an Archival Object.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – a list of archival object references

404 – Not found

Batch create several Archival Objects as children of an existing Archival Object

  curl -H "X-ArchivesSpace-Session: $SESSION"         -d '{
    "jsonmodel_type": "archival_record_children",
    "children": [
        { "jsonmodel_type":"archival_object",
            "external_ids":[],
            "subjects":[],
            "linked_events":[],
            "extents":[],
            "lang_materials":[],
            "dates":[],
            "external_documents":[],
            "rights_statements":[],
            "linked_agents":[],
            "is_slug_auto":true,
            "restrictions_apply":false,
            "ancestors":[],
            "instances":[],
            "notes":[],
            "level":"subseries",
            "title":"Archival Object Title: 1",
            "resource":{ "ref":"/repositories/2/resources/1"}},
        { "jsonmodel_type":"archival_object",
            "external_ids":[],
            "subjects":[],
            "linked_events":[],
            "extents":[],
            "lang_materials":[],
            "dates":[],
            "external_documents":[],
            "rights_statements":[],
            "linked_agents":[],
            "is_slug_auto":true,
            "restrictions_apply":false,
            "ancestors":[],
            "instances":[],
            "notes":[],
            "level":"subseries",
            "title":"Archival Object Title: 2",
            "resource":{ "ref":"/repositories/2/resources/1"}}
    ]
}'           "http://localhost:8089/repositories/2/archival_objects/1/children"

Endpoint

[:POST] /repositories/:repo_id/archival_objects/:id/children

Description

Batch create several Archival Objects as children of an existing Archival Object.

Parameters

Parameter Description Type Optional?
id The ID of the archival object to add children to Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:archival_record_children)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

409 – {:error => (description of error)}

Get a list of record types in the graph of an archival object

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/archival_objects/1/models_in_graph"

Endpoint

[:GET] /repositories/:repo_id/archival_objects/:id/models_in_graph

Description

Get a list of record types in the graph of an archival object.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – OK

Set the parent/position of an Archival Object in a tree

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/archival_objects/1/parent?parent=1&position=1"

Endpoint

[:POST] /repositories/:repo_id/archival_objects/:id/parent

Description

Set the parent/position of an Archival Object in a tree.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
parent The parent of this node in the tree Integer true
position The position of this node in the tree Integer true
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Get the previous record in the tree for an Archival Object

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/archival_objects/1/previous"

Endpoint

[:GET] /repositories/:repo_id/archival_objects/:id/previous

Description

Get the previous record in the tree for an Archival Object.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:archival_object)

404 – No previous node

Publish an Archival Object and all its sub-records and components

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/archival_objects/1/publish"

Endpoint

[:POST] /repositories/:repo_id/archival_objects/:id/publish

Description

Publish an Archival Object and all its sub-records and components.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Suppress this record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/archival_objects/1/suppressed?suppressed=true"

Endpoint

[:POST] /repositories/:repo_id/archival_objects/:id/suppressed

Description

Suppress this record.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
suppressed Suppression state RESTHelpers::BooleanParam
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Suppressed”, :id => (id of updated object), :suppressed_state => (true|false)}

Unpublish an Archival Object and all its sub-records and components

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/archival_objects/1/unpublish"

Endpoint

[:POST] /repositories/:repo_id/archival_objects/:id/unpublish

Description

Unpublish an Archival Object and all its sub-records and components.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Update this repository’s assessment attribute definitions

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/repositories/2/assessment_attribute_definitions"

Endpoint

[:POST] /repositories/:repo_id/assessment_attribute_definitions

Description

Update this repository’s assessment attribute definitions.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:assessment_attribute_definitions)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get this repository’s assessment attribute definitions

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/assessment_attribute_definitions"

Endpoint

[:GET] /repositories/:repo_id/assessment_attribute_definitions

Description

Get this repository’s assessment attribute definitions.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:assessment_attribute_definitions)

Create an Assessment

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/repositories/2/assessments"

Endpoint

[:POST] /repositories/:repo_id/assessments

Description

Create an Assessment.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:assessment)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

Get a list of Assessments for a Repository

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/assessments?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/assessments?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/assessments?all_ids=true"

Endpoint

[:GET] /repositories/:repo_id/assessments

Description

Get a list of Assessments for a Repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:assessment)]

Update an Assessment

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/repositories/2/assessments/1"

Endpoint

[:POST] /repositories/:repo_id/assessments/:id

Description

Update an Assessment.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:assessment)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get an Assessment by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/assessments/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/assessments/:id

Description

Get an Assessment by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:assessment)

Delete an Assessment

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/assessments/1"

Endpoint

[:DELETE] /repositories/:repo_id/assessments/:id

Description

Delete an Assessment.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Import a batch of records

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"body_stream"' \
  "http://localhost:8089/repositories/2/batch_imports?migration=PR274441352&skip_results=true"

Endpoint

[:POST] /repositories/:repo_id/batch_imports

Description

Import a batch of records.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer
migration Param to indicate we are using a migrator String true
skip_results If true, don’t return the list of created record URIs RESTHelpers::BooleanParam true

Accepts Payload of Type

body_stream

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

409 – {:error => (description of error)}

Create a Classification Term

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"classification_term",
"publish":true,
"path_from_root":[],
"linked_records":[],
"is_slug_auto":true,
"identifier":"MXBFX",
"title":"Classification Title: 8",
"description":"Description: 8",
"classification":{ "ref":"/repositories/2/classifications/1"}}' \
  "http://localhost:8089/repositories/2/classification_terms"

Endpoint

[:POST] /repositories/:repo_id/classification_terms

Description

Create a Classification Term.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:classification_term)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Get a list of Classification Terms for a Repository

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/classification_terms?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/classification_terms?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/classification_terms?all_ids=true"

Endpoint

[:GET] /repositories/:repo_id/classification_terms

Description

Get a list of Classification Terms for a Repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:classification_term)]

Update a Classification Term

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"classification_term",
"publish":true,
"path_from_root":[],
"linked_records":[],
"is_slug_auto":true,
"identifier":"MXBFX",
"title":"Classification Title: 8",
"description":"Description: 8",
"classification":{ "ref":"/repositories/2/classifications/1"}}' \
  "http://localhost:8089/repositories/2/classification_terms/1"

Endpoint

[:POST] /repositories/:repo_id/classification_terms/:id

Description

Update a Classification Term.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:classification_term)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Get a Classification Term by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/classification_terms/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/classification_terms/:id

Description

Get a Classification Term by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:classification_term)

404 – Not found

Delete a Classification Term

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/classification_terms/1"

Endpoint

[:DELETE] /repositories/:repo_id/classification_terms/:id

Description

Delete a Classification Term.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Move existing Classification Terms to become children of another Classification Term

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/classification_terms/1/accept_children?children=993SF70589&position=1"

Endpoint

[:POST] /repositories/:repo_id/classification_terms/:id/accept_children

Description

Move existing Classification Terms to become children of another Classification Term.

Parameters

Parameter Description Type Optional?
children The children to move to the Classification Term [String] true
id The ID of the Classification Term to move children to Integer
position The index for the first child to be moved to Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

409 – {:error => (description of error)}

Get the children of a Classification Term

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/classification_terms/1/children"

Endpoint

[:GET] /repositories/:repo_id/classification_terms/:id/children

Description

Get the children of a Classification Term.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – a list of classification term references

404 – Not found

Set the parent/position of a Classification Term in a tree

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/classification_terms/1/parent?parent=1&position=1"

Endpoint

[:POST] /repositories/:repo_id/classification_terms/:id/parent

Description

Set the parent/position of a Classification Term in a tree.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
parent The parent of this node in the tree Integer true
position The position of this node in the tree Integer true
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Create a Classification

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"classification",
"publish":true,
"path_from_root":[],
"linked_records":[],
"is_slug_auto":true,
"identifier":"SFSB930",
"title":"Classification Title: 2",
"description":"Description: 3"}' \
  "http://localhost:8089/repositories/2/classifications"

Endpoint

[:POST] /repositories/:repo_id/classifications

Description

Create a Classification.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:classification)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Get a list of Classifications for a Repository

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/classifications?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/classifications?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/classifications?all_ids=true"

Endpoint

[:GET] /repositories/:repo_id/classifications

Description

Get a list of Classifications for a Repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:classification)]

Get a Classification

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/classifications/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/classifications/:id

Description

Get a Classification.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:classification)

Update a Classification

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"classification",
"publish":true,
"path_from_root":[],
"linked_records":[],
"is_slug_auto":true,
"identifier":"SFSB930",
"title":"Classification Title: 2",
"description":"Description: 3"}' \
  "http://localhost:8089/repositories/2/classifications/1"

Endpoint

[:POST] /repositories/:repo_id/classifications/:id

Description

Update a Classification.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:classification)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Delete a Classification

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/classifications/1"

Endpoint

[:DELETE] /repositories/:repo_id/classifications/:id

Description

Delete a Classification.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Move existing Classification Terms to become children of a Classification

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/classifications/1/accept_children?children=V253874967358&position=1"

Endpoint

[:POST] /repositories/:repo_id/classifications/:id/accept_children

Description

Move existing Classification Terms to become children of a Classification.

Parameters

Parameter Description Type Optional?
children The children to move to the Classification [String] true
id The ID of the Classification to move children to Integer
position The index for the first child to be moved to Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

409 – {:error => (description of error)}

Get a Classification tree

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/classifications/1/tree"

Endpoint

[:GET] /repositories/:repo_id/classifications/:id/tree

Description

Get a Classification tree.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – OK

Fetch tree information for an Classification Term record within a tree

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/classifications/1/tree/node?node_uri=/repositories/2/classification_terms/1"

Endpoint

[:GET] /repositories/:repo_id/classifications/:id/tree/node

Description

Fetch tree information for an Classification Term record within a tree.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
node_uri The URI of the Classification Term record of interest String
published_only Whether to restrict to published/unsuppressed items RESTHelpers::BooleanParam

Returns

200 – Returns a JSON object describing enough information about a specific node. Includes:

Fetch tree path from the root record to Classification Terms

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/classifications/1/tree/node_from_root?node_ids[]=1"

Endpoint

[:GET] /repositories/:repo_id/classifications/:id/tree/node_from_root

Description

Fetch tree path from the root record to Classification Terms.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
node_ids The IDs of the Classification Term records of interest [Integer]
published_only Whether to restrict to published/unsuppressed items RESTHelpers::BooleanParam

Returns

200 – Returns a JSON array describing the path to a node, starting from the root of the tree. Each path element provides:

Fetch tree information for the top-level classification record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/classifications/1/tree/root"

Endpoint

[:GET] /repositories/:repo_id/classifications/:id/tree/root

Description

Fetch tree information for the top-level classification record.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
published_only Whether to restrict to published/unsuppressed items RESTHelpers::BooleanParam

Returns

200 – Returns a JSON object describing enough information about this tree’s root record to render the rest. Includes:

Fetch the record slice for a given tree waypoint

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/classifications/1/tree/waypoint?offset=0&parent_node=/repositories/2/classification_terms/1"

Endpoint

[:GET] /repositories/:repo_id/classifications/:id/tree/waypoint

Description

Fetch the record slice for a given tree waypoint.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
offset The page of records to return Integer
parent_node The URI of the parent of this waypoint (none for the root record) String true
published_only Whether to restrict to published/unsuppressed items RESTHelpers::BooleanParam

Returns

200 – Returns a JSON array containing information for the records contained in a given waypoint. Each array element is an object that includes:

Get a Collection Management Record by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/collection_management/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/collection_management/:id

Description

Get a Collection Management Record by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:collection_management)

Transfer components from one resource to another

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/component_transfers?target_resource=790XWMI&component=906F246N369"

Endpoint

[:POST] /repositories/:repo_id/component_transfers

Description

Transfer components from one resource to another.

Parameters

Parameter Description Type Optional?
target_resource The URI of the resource to transfer into String
component The URI of the archival object to transfer String
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

409 – {:error => (description of error)}

Get the Preferences records for the current repository and user.

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/current_preferences"

Endpoint

[:GET] /repositories/:repo_id/current_preferences

Description

Get the Preferences records for the current repository and user..

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {(:preference)}

Create a Custom Report Template

curl -H 'Content-Type: application/json' \
  -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{
        "lock_version": 0,
        "name": "A New Custom Template",
        "description": "A custom report template returning old accessions sorted by title.",
        "data": "{"fields":{"access_restrictions":{"value":"true"},"accession_date":{"include":"1","narrow_by":"1","range_start":"2011-01-01","range_end":"2019-12-31"},"publish":{"value":"true"},"restrictions_apply":{"value":"true"},"title":{"include":"1"},"use_restrictions":{"value":"true"},"create_time":{"range_start":"","range_end":""},"user_mtime":{"range_start":"","range_end":""}},"sort_by":"title","custom_record_type":"accession"}",
        "limit": 100,
        "jsonmodel_type": "custom_report_template",
        "repository": {
            "ref": "/repositories/2"
        }
      }' \
  "http://localhost:8089/repositories/2/custom_report_templates"

Endpoint

[:POST] /repositories/:repo_id/custom_report_templates

Description

Create a Custom Report Template.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:custom_report_template)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

Get a list of Custom Report Templates

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/custom_report_templates?page=1"

Endpoint

[:GET] /repositories/:repo_id/custom_report_templates

Description

Get a list of Custom Report Templates.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:custom_report_template)]

Update a CustomReportTemplate

curl -H 'Content-Type: application/json' \
  -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{
        "lock_version": 0,
        "name": "A Newer Custom Template",
        "description": "A custom report template returning old accessions sorted by title.",
        "data": "{"fields":{"access_restrictions":{"value":"true"},"accession_date":{"include":"1","narrow_by":"1","range_start":"2011-01-01","range_end":"2019-12-31"},"publish":{"value":"true"},"restrictions_apply":{"value":"true"},"title":{"include":"1"},"use_restrictions":{"value":"true"},"create_time":{"range_start":"","range_end":""},"user_mtime":{"range_start":"","range_end":""}},"sort_by":"title","custom_record_type":"accession"}",
        "limit": 100,
        "jsonmodel_type": "custom_report_template",
        "repository": {
            "ref": "/repositories/2"
        }
      }' \
  "http://localhost:8089/repositories/2/custom_report_templates/1"

Endpoint

[:POST] /repositories/:repo_id/custom_report_templates/:id

Description

Update a CustomReportTemplate.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:custom_report_template)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get a Custom Report Template by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/custom_report_templates/1"

Endpoint

[:GET] /repositories/:repo_id/custom_report_templates/:id

Description

Get a Custom Report Template by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
resolve A list of references to resolve and embed in the response [String] true
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:custom_report_template)

Delete an Custom Report Template

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/custom_report_templates/1"

Endpoint

[:DELETE] /repositories/:repo_id/custom_report_templates/:id

Description

Delete an Custom Report Template.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Save defaults for a record type

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/repositories/2/default_values/1"

Endpoint

[:POST] /repositories/:repo_id/default_values/:record_type

Description

Save defaults for a record type.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer
record_type String

Accepts Payload of Type

JSONModel(:default_values)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Get default values for a record type

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/default_values/1"

Endpoint

[:GET] /repositories/:repo_id/default_values/:record_type

Description

Get default values for a record type.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer
record_type String

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Create an Digital Object Component

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"digital_object_component",
"external_ids":[],
"subjects":[],
"linked_events":[],
"extents":[],
"lang_materials":[],
"dates":[],
"external_documents":[],
"rights_statements":[],
"linked_agents":[],
"file_versions":[],
"is_slug_auto":true,
"notes":[],
"component_id":"KY414VI",
"title":"Digital Object Component Title: 6",
"digital_object":{ "ref":"/repositories/2/digital_objects/1"},
"position":7,
"has_unpublished_ancestor":true}' \
  "http://localhost:8089/repositories/2/digital_object_components"

Endpoint

[:POST] /repositories/:repo_id/digital_object_components

Description

Create an Digital Object Component.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:digital_object_component)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Get a list of Digital Object Components for a Repository

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/digital_object_components?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/digital_object_components?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/digital_object_components?all_ids=true"

Endpoint

[:GET] /repositories/:repo_id/digital_object_components

Description

Get a list of Digital Object Components for a Repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:digital_object_component)]

Update an Digital Object Component

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"digital_object_component",
"external_ids":[],
"subjects":[],
"linked_events":[],
"extents":[],
"lang_materials":[],
"dates":[],
"external_documents":[],
"rights_statements":[],
"linked_agents":[],
"file_versions":[],
"is_slug_auto":true,
"notes":[],
"component_id":"KY414VI",
"title":"Digital Object Component Title: 6",
"digital_object":{ "ref":"/repositories/2/digital_objects/1"},
"position":7,
"has_unpublished_ancestor":true}' \
  "http://localhost:8089/repositories/2/digital_object_components/1"

Endpoint

[:POST] /repositories/:repo_id/digital_object_components/:id

Description

Update an Digital Object Component.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:digital_object_component)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Get an Digital Object Component by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/digital_object_components/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/digital_object_components/:id

Description

Get an Digital Object Component by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:digital_object_component)

404 – Not found

Delete a Digital Object Component

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/digital_object_components/1"

Endpoint

[:DELETE] /repositories/:repo_id/digital_object_components/:id

Description

Delete a Digital Object Component.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Move existing Digital Object Components to become children of a Digital Object Component

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/digital_object_components/1/accept_children?children=910806A22411&position=1"

Endpoint

[:POST] /repositories/:repo_id/digital_object_components/:id/accept_children

Description

Move existing Digital Object Components to become children of a Digital Object Component.

Parameters

Parameter Description Type Optional?
children The children to move to the Digital Object Component [String] true
id The ID of the Digital Object Component to move children to Integer
position The index for the first child to be moved to Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

409 – {:error => (description of error)}

Batch create several Digital Object Components as children of an existing Digital Object Component

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/repositories/2/digital_object_components/1/children"

Endpoint

[:POST] /repositories/:repo_id/digital_object_components/:id/children

Description

Batch create several Digital Object Components as children of an existing Digital Object Component.

Parameters

Parameter Description Type Optional?
id The ID of the digital object component to add children to Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:digital_record_children)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

409 – {:error => (description of error)}

Get the children of an Digital Object Component

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/digital_object_components/1/children"

Endpoint

[:GET] /repositories/:repo_id/digital_object_components/:id/children

Description

Get the children of an Digital Object Component.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:digital_object_component)]

404 – Not found

Set the parent/position of an Digital Object Component in a tree

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/digital_object_components/1/parent?parent=1&position=1"

Endpoint

[:POST] /repositories/:repo_id/digital_object_components/:id/parent

Description

Set the parent/position of an Digital Object Component in a tree.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
parent The parent of this node in the tree Integer true
position The position of this node in the tree Integer true
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Suppress this record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/digital_object_components/1/suppressed?suppressed=true"

Endpoint

[:POST] /repositories/:repo_id/digital_object_components/:id/suppressed

Description

Suppress this record.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
suppressed Suppression state RESTHelpers::BooleanParam
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Suppressed”, :id => (id of updated object), :suppressed_state => (true|false)}

Create a Digital Object

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"digital_object",
"external_ids":[],
"subjects":[],
"linked_events":[],
"extents":[{ "jsonmodel_type":"extent",
"portion":"whole",
"number":"71",
"extent_type":"cassettes",
"dimensions":"OSKJE",
"physical_details":"XFYGT"}],
"lang_materials":[{ "jsonmodel_type":"lang_material",
"notes":[],
"language_and_script":{ "jsonmodel_type":"language_and_script",
"language":"csb",
"script":"Nkgb"}}],
"dates":[],
"external_documents":[],
"rights_statements":[],
"linked_agents":[],
"is_slug_auto":true,
"file_versions":[],
"restrictions":false,
"classifications":[],
"notes":[],
"linked_instances":[],
"metadata_rights_declarations":[],
"title":"Digital Object Title: 1",
"digital_object_id":"281FD869991"}' \
  "http://localhost:8089/repositories/2/digital_objects"

Endpoint

[:POST] /repositories/:repo_id/digital_objects

Description

Create a Digital Object.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:digital_object)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Get a list of Digital Objects for a Repository

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/digital_objects?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/digital_objects?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/digital_objects?all_ids=true"

Endpoint

[:GET] /repositories/:repo_id/digital_objects

Description

Get a list of Digital Objects for a Repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:digital_object)]

Get a Digital Object

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/digital_objects/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/digital_objects/:id

Description

Get a Digital Object.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:digital_object)

Update a Digital Object

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"digital_object",
"external_ids":[],
"subjects":[],
"linked_events":[],
"extents":[{ "jsonmodel_type":"extent",
"portion":"whole",
"number":"71",
"extent_type":"cassettes",
"dimensions":"OSKJE",
"physical_details":"XFYGT"}],
"lang_materials":[{ "jsonmodel_type":"lang_material",
"notes":[],
"language_and_script":{ "jsonmodel_type":"language_and_script",
"language":"csb",
"script":"Nkgb"}}],
"dates":[],
"external_documents":[],
"rights_statements":[],
"linked_agents":[],
"is_slug_auto":true,
"file_versions":[],
"restrictions":false,
"classifications":[],
"notes":[],
"linked_instances":[],
"metadata_rights_declarations":[],
"title":"Digital Object Title: 1",
"digital_object_id":"281FD869991"}' \
  "http://localhost:8089/repositories/2/digital_objects/1"

Endpoint

[:POST] /repositories/:repo_id/digital_objects/:id

Description

Update a Digital Object.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:digital_object)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Delete a Digital Object

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/digital_objects/1"

Endpoint

[:DELETE] /repositories/:repo_id/digital_objects/:id

Description

Delete a Digital Object.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Move existing Digital Object components to become children of a Digital Object

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/digital_objects/1/accept_children?children=DTLG481&position=1"

Endpoint

[:POST] /repositories/:repo_id/digital_objects/:id/accept_children

Description

Move existing Digital Object components to become children of a Digital Object.

Parameters

Parameter Description Type Optional?
children The children to move to the Digital Object [String] true
id The ID of the Digital Object to move children to Integer
position The index for the first child to be moved to Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

409 – {:error => (description of error)}

Batch create several Digital Object Components as children of an existing Digital Object

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/repositories/2/digital_objects/1/children"

Endpoint

[:POST] /repositories/:repo_id/digital_objects/:id/children

Description

Batch create several Digital Object Components as children of an existing Digital Object.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:digital_record_children)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

409 – {:error => (description of error)}

Publish a digital object and all its sub-records and components

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/digital_objects/1/publish"

Endpoint

[:POST] /repositories/:repo_id/digital_objects/:id/publish

Description

Publish a digital object and all its sub-records and components.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Suppress this record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/digital_objects/1/suppressed?suppressed=true"

Endpoint

[:POST] /repositories/:repo_id/digital_objects/:id/suppressed

Description

Suppress this record.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
suppressed Suppression state RESTHelpers::BooleanParam
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Suppressed”, :id => (id of updated object), :suppressed_state => (true|false)}

Transfer this record to a different repository

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/digital_objects/1/transfer?target_repo=K540852ET"

Endpoint

[:POST] /repositories/:repo_id/digital_objects/:id/transfer

Description

Transfer this record to a different repository.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
target_repo The URI of the target repository String
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – moved

Get a Digital Object tree

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/digital_objects/1/tree"

Endpoint

[:GET] /repositories/:repo_id/digital_objects/:id/tree

Description

Get a Digital Object tree.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – OK

Fetch tree information for an Digital Object Component record within a tree

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/digital_objects/1/tree/node?node_uri=/repositories/2/digital_object_components/1"

Endpoint

[:GET] /repositories/:repo_id/digital_objects/:id/tree/node

Description

Fetch tree information for an Digital Object Component record within a tree.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
node_uri The URI of the Digital Object Component record of interest String
published_only Whether to restrict to published/unsuppressed items RESTHelpers::BooleanParam

Returns

200 – Returns a JSON object describing enough information about a specific node. Includes:

Fetch tree paths from the root record to Digital Object Components

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/digital_objects/1/tree/node_from_root?node_ids[]=1"

Endpoint

[:GET] /repositories/:repo_id/digital_objects/:id/tree/node_from_root

Description

Fetch tree paths from the root record to Digital Object Components.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
node_ids The IDs of the Digital Object Component records of interest [Integer]
published_only Whether to restrict to published/unsuppressed items RESTHelpers::BooleanParam

Returns

200 – Returns a JSON array describing the path to a node, starting from the root of the tree. Each path element provides:

Fetch tree information for the top-level digital object record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/digital_objects/1/tree/root"

Endpoint

[:GET] /repositories/:repo_id/digital_objects/:id/tree/root

Description

Fetch tree information for the top-level digital object record.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
published_only Whether to restrict to published/unsuppressed items RESTHelpers::BooleanParam

Returns

200 – Returns a JSON object describing enough information about this tree’s root record to render the rest. Includes:

Fetch the record slice for a given tree waypoint

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/digital_objects/1/tree/waypoint?offset=0&parent_node=/repositories/2/digital_object_components/1"

Endpoint

[:GET] /repositories/:repo_id/digital_objects/:id/tree/waypoint

Description

Fetch the record slice for a given tree waypoint.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
offset The page of records to return Integer
parent_node The URI of the parent of this waypoint (none for the root record) String true
published_only Whether to restrict to published/unsuppressed items RESTHelpers::BooleanParam

Returns

200 – Returns a JSON array containing information for the records contained in a given waypoint. Each array element is an object that includes:

Get metadata for a Dublin Core export

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/digital_objects/dublin_core/48.:fmt/metadata"

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

do_dc = client.get("/repositories/2/digital_objects/dublin_core/48.fmt/metadata")
# replace 2 for your repository ID and 48 with your digital object ID. Find these at the URI on the staff interface

print(do_dc_fmt.content)
# Sample output: {"filename":"identifier_youtube_20210218_182435_UTC__dc.xml","mimetype":"application/xml"}

# For error handling, print or log the returned value of client.get with .json() - print(do_dc.json())

Endpoint

[:GET] /repositories/:repo_id/digital_objects/dublin_core/:id.:fmt/metadata

Description

Get metadata for a Dublin Core export.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – The export metadata

Get a Dublin Core representation of a Digital Object

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/digital_objects/dublin_core/48.xml" --output do_dublincore.xml

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

do_dc = client.get("/repositories/2/digital_objects/dublin_core/48.xml")
# replace 2 for your repository ID and 48 with your digital object ID. Find these at the URI on the staff interface

with open("do_dc.xml", "wb") as file:  # save the file
    file.write(do_dc.content)  # write the file content to our file.
    file.close()

Endpoint

[:GET] /repositories/:repo_id/digital_objects/dublin_core/:id.xml

Description

Get a Dublin Core representation of a Digital Object.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:digital_object)

Get metadata for a METS export

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/digital_objects/mets/48.:fmt/metadata"

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

mets_fmt = client.get("/repositories/2/digital_objects/mets/48.fmt/metadata")
# replace 2 for your repository ID and 48 with your digital object ID. Find these at the URI on the staff interface

print(mets_fmt.content)
# Sample output: {"filename":"identifier_youtube_20210218_182435_UTC__mets.xml","mimetype":"application/xml"}

# For error handling, print or log the returned value of client.get with .json() - print(mets_fmt.json())

Endpoint

[:GET] /repositories/:repo_id/digital_objects/mets/:id.:fmt/metadata

Description

Get metadata for a METS export.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – The export metadata

Get a METS representation of a Digital Object

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/digital_objects/mets/48.xml?dmd=PKG410P" --output do_mets.xml

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

mets_xml = client.get("/repositories/2/digital_objects/mets/48.xml",
                      params={"dmd": "PKG410P"})
# replace 2 for your repository ID and 48 with your digital object ID. Find these at the URI on the staff interface
# replace PKG410P with your preferred DMD schema

with open("do_mets.xml", "wb") as file:  # save the file
    file.write(mets_xml.content)  # write the file content to our file.
    file.close()

Endpoint

[:GET] /repositories/:repo_id/digital_objects/mets/:id.xml

Description

Get a METS representation of a Digital Object.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
dmd DMD Scheme to use String true

Returns

200 – (:digital_object)

Get metadata for a MODS export

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/digital_objects/mods/48.fmt/metadata"

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

mods_fmt = client.get("/repositories/2/digital_objects/mods/48.:fmt/metadata")
# replace 2 for your repository ID and 48 with your digital object ID. Find these at the URI on the staff interface

print(mods_fmt.content)
# Sample output: {"filename":"identifier_youtube_20210218_182435_UTC__mods.xml","mimetype":"application/xml"}

# For error handling, print or log the returned value of client.get with .json() - print(mods_fmt.json())

Endpoint

[:GET] /repositories/:repo_id/digital_objects/mods/:id.:fmt/metadata

Description

Get metadata for a MODS export.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – The export metadata

Get a MODS representation of a Digital Object

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/digital_objects/mods/48.xml" --output do_mods.xml

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

mods_xml = client.get("/repositories/2/digital_objects/mods/48.xml")
# replace 2 for your repository ID and 48 with your digital object ID. Find these at the URI on the staff interface

with open("do_mods.xml", "wb") as file:  # save the file
    file.write(mods_xml.content)  # write the file content to our file.
    file.close()

Endpoint

[:GET] /repositories/:repo_id/digital_objects/mods/:id.xml

Description

Get a MODS representation of a Digital Object .

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:digital_object)

Create an Event

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"event",
"external_ids":[],
"external_documents":[],
"linked_agents":[{ "ref":"/agents/people/2",
"role":"authorizer"}],
"linked_records":[{ "ref":"/repositories/2/accessions/1",
"role":"outcome"}],
"date":{ "jsonmodel_type":"date",
"date_type":"single",
"label":"creation",
"begin":"1994-11-01",
"end":"1994-11-01",
"certainty":"inferred",
"era":"ce",
"calendar":"gregorian",
"expression":"J568L635G"},
"event_type":"acknowledgement_received"}' \
  "http://localhost:8089/repositories/2/events"

Endpoint

[:POST] /repositories/:repo_id/events

Description

Create an Event.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:event)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Get a list of Events for a Repository

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/events?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/events?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/events?all_ids=true"

Endpoint

[:GET] /repositories/:repo_id/events

Description

Get a list of Events for a Repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:event)]

Update an Event

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"event",
"external_ids":[],
"external_documents":[],
"linked_agents":[{ "ref":"/agents/people/2",
"role":"authorizer"}],
"linked_records":[{ "ref":"/repositories/2/accessions/1",
"role":"outcome"}],
"date":{ "jsonmodel_type":"date",
"date_type":"single",
"label":"creation",
"begin":"1994-11-01",
"end":"1994-11-01",
"certainty":"inferred",
"era":"ce",
"calendar":"gregorian",
"expression":"J568L635G"},
"event_type":"acknowledgement_received"}' \
  "http://localhost:8089/repositories/2/events/1"

Endpoint

[:POST] /repositories/:repo_id/events/:id

Description

Update an Event.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:event)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get an Event by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/events/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/events/:id

Description

Get an Event by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:event)

404 – Not found

Delete an event record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/events/1"

Endpoint

[:DELETE] /repositories/:repo_id/events/:id

Description

Delete an event record.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Suppress this record from non-managers

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/events/1/suppressed?suppressed=true"

Endpoint

[:POST] /repositories/:repo_id/events/:id/suppressed

Description

Suppress this record from non-managers.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
suppressed Suppression state RESTHelpers::BooleanParam
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Suppressed”, :id => (id of updated object), :suppressed_state => (true|false)}

Find Archival Objects by ref_id or component_id

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/find_by_id/archival_objects?ref_id=88210V856273&component_id=PYU984F&resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/find_by_id/archival_objects

Description

Find Archival Objects by ref_id or component_id.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer
ref_id An archival object’s Ref ID (param may be repeated) [String] true
component_id An archival object’s component ID (param may be repeated) [String] true
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – JSON array of refs

Find Digital Object Components by component_id

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/find_by_id/digital_object_components?component_id=F429M646L&resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/find_by_id/digital_object_components

Description

Find Digital Object Components by component_id.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer
component_id A digital object component’s component ID (param may be repeated) [String] true
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – JSON array of refs

Find Digital Objects by digital_object_id

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/find_by_id/digital_objects?digital_object_id=KX8543124&resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/find_by_id/digital_objects

Description

Find Digital Objects by digital_object_id.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer
digital_object_id A digital object’s digital object ID (param may be repeated) [String] true
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – JSON array of refs

Find Resources by their identifiers

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/find_by_id/resources?identifier=884JYQF&resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/find_by_id/resources

Description

Find Resources by their identifiers.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer
identifier A 4-part identifier expressed as a JSON array (of up to 4 strings) comprised of the id_0 to id_3 fields (though empty fields will be handled if not provided) [String] true
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – JSON array of refs

Create a group within a repository

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"group",
"description":"Description: 7",
"member_usernames":[],
"grants_permissions":[],
"group_code":"926200700201S"}' \
  "http://localhost:8089/repositories/2/groups"

Endpoint

[:POST] /repositories/:repo_id/groups

Description

Create a group within a repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:group)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

409 – conflict

Get a list of groups for a repository

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/groups?group_code=XBFAS"

Endpoint

[:GET] /repositories/:repo_id/groups

Description

Get a list of groups for a repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer
group_code Get groups by group code String true

Returns

200 – [(:resource)]

Update a group

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"group",
"description":"Description: 7",
"member_usernames":[],
"grants_permissions":[],
"group_code":"926200700201S"}' \
  "http://localhost:8089/repositories/2/groups/1?with_members=true"

Endpoint

[:POST] /repositories/:repo_id/groups/:id

Description

Update a group.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
with_members If 'true’ (the default) replace the membership list with the list provided RESTHelpers::BooleanParam

Accepts Payload of Type

JSONModel(:group)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

409 – conflict

Get a group by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/groups/1?with_members=true"

Endpoint

[:GET] /repositories/:repo_id/groups/:id

Description

Get a group by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
with_members If 'true’ (the default) return the list of members with the group RESTHelpers::BooleanParam

Returns

200 – (:group)

404 – Not found

Delete a group by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/groups/1"

Endpoint

[:DELETE] /repositories/:repo_id/groups/:id

Description

Delete a group by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:group)

404 – Not found

Create a new job

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"job",
"status":"queued",
"job":{ "jsonmodel_type":"import_job",
"filenames":["M393VQ206",
"417H221QR",
"245F152428V",
"BAK910257"],
"import_type":"marcxml"}}' \
  "http://localhost:8089/repositories/2/jobs"

Endpoint

[:POST] /repositories/:repo_id/jobs

Description

Create a new job.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:job)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get a list of Jobs for a Repository

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs?all_ids=true"

Endpoint

[:GET] /repositories/:repo_id/jobs

Description

Get a list of Jobs for a Repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:job)]

Delete a Job

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/jobs/1"

Endpoint

[:DELETE] /repositories/:repo_id/jobs/:id

Description

Delete a Job.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Get a Job by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/jobs/:id

Description

Get a Job by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
resolve A list of references to resolve and embed in the response [String] true
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:job)

Cancel a Job

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/jobs/1/cancel"

Endpoint

[:POST] /repositories/:repo_id/jobs/:id/cancel

Description

Cancel a Job.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get a Job’s log by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs/1/log?offset=NonNegativeInteger"

Endpoint

[:GET] /repositories/:repo_id/jobs/:id/log

Description

Get a Job’s log by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
offset The byte offset of the log file to show RESTHelpers::NonNegativeInteger

Returns

200 – The section of the import log between 'offset’ and the end of file

Get a list of Job’s output files by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs/1/output_files"

Endpoint

[:GET] /repositories/:repo_id/jobs/:id/output_files

Description

Get a list of Job’s output files by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – An array of output files

Get a Job’s output file by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs/1/output_files/1"

Endpoint

[:GET] /repositories/:repo_id/jobs/:id/output_files/:file_id

Description

Get a Job’s output file by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
file_id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – Returns the file

Get a Job’s list of created URIs

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs/1/records?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs/1/records?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs/1/records?all_ids=true"

Endpoint

[:GET] /repositories/:repo_id/jobs/:id/records

Description

Get a Job’s list of created URIs.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – An array of created records

Get a list of all active Jobs for a Repository

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs/active?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/jobs/active

Description

Get a list of all active Jobs for a Repository.

Parameters

Parameter Description Type Optional?
resolve A list of references to resolve and embed in the response [String] true
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:job)]

Get a list of all archived Jobs for a Repository

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs/archived?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs/archived?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs/archived?all_ids=true"

Endpoint

[:GET] /repositories/:repo_id/jobs/archived

Description

Get a list of all archived Jobs for a Repository.

Parameters

Parameter Description Type Optional?
resolve A list of references to resolve and embed in the response [String] true
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:job)]

List all supported import job types

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/jobs/import_types"

Endpoint

[:GET] /repositories/:repo_id/jobs/import_types

Description

List all supported import job types.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – A list of supported import types

Create a new job and post input files

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/jobs_with_files?job={"jsonmodel_type"=>"job", "status"=>"queued", "job"=>{"jsonmodel_type"=>"import_job", "filenames"=>["M393VQ206", "417H221QR", "245F152428V", "BAK910257"], "import_type"=>"marcxml"}}&files=UploadFile"

Endpoint

[:POST] /repositories/:repo_id/jobs_with_files

Description

Create a new job and post input files.

Parameters

Parameter Description Type Optional?
job JSONModel(:job)
files [RESTHelpers::UploadFile]
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Create a Preferences record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"preference",
"defaults":{ "jsonmodel_type":"defaults",
"show_suppressed":false,
"publish":false,
"default_values":false,
"note_order":[]}}' \
  "http://localhost:8089/repositories/2/preferences"

Endpoint

[:POST] /repositories/:repo_id/preferences

Description

Create a Preferences record.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:preference)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Get a list of Preferences for a Repository and optionally a user

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/preferences?user_id=1"

Endpoint

[:GET] /repositories/:repo_id/preferences

Description

Get a list of Preferences for a Repository and optionally a user.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer
user_id The username to retrieve defaults for Integer true

Returns

200 – [(:preference)]

Get a Preferences record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/preferences/1"

Endpoint

[:GET] /repositories/:repo_id/preferences/:id

Description

Get a Preferences record.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:preference)

Update a Preferences record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"preference",
"defaults":{ "jsonmodel_type":"defaults",
"show_suppressed":false,
"publish":false,
"default_values":false,
"note_order":[]}}' \
  "http://localhost:8089/repositories/2/preferences/1"

Endpoint

[:POST] /repositories/:repo_id/preferences/:id

Description

Update a Preferences record.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:preference)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Delete a Preferences record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/preferences/1"

Endpoint

[:DELETE] /repositories/:repo_id/preferences/:id

Description

Delete a Preferences record.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Get the default set of Preferences for a Repository and optionally a user

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/preferences/defaults?username=OA611291A"

Endpoint

[:GET] /repositories/:repo_id/preferences/defaults

Description

Get the default set of Preferences for a Repository and optionally a user.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer
username The username to retrieve defaults for String true

Returns

200 – (defaults)

Create an RDE template

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/repositories/2/rde_templates"

Endpoint

[:POST] /repositories/:repo_id/rde_templates

Description

Create an RDE template.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:rde_template)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Get a list of RDE Templates

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/rde_templates"

Endpoint

[:GET] /repositories/:repo_id/rde_templates

Description

Get a list of RDE Templates.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:rde_template)]

Get an RDE template record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/rde_templates/1"

Endpoint

[:GET] /repositories/:repo_id/rde_templates/:id

Description

Get an RDE template record.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:rde_template)

Delete an RDE Template

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/rde_templates/1"

Endpoint

[:DELETE] /repositories/:repo_id/rde_templates/:id

Description

Delete an RDE Template.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Require fields for a record type

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/repositories/2/required_fields/1"

Endpoint

[:POST] /repositories/:repo_id/required_fields/:record_type

Description

Require fields for a record type.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer
record_type String

Accepts Payload of Type

JSONModel(:required_fields)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Get required fields for a record type

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/required_fields/1"

Endpoint

[:GET] /repositories/:repo_id/required_fields/:record_type

Description

Get required fields for a record type.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer
record_type String

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Get export metadata for a Resource Description

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/resources/resource_descriptions/577.:fmt/metadata?fmt=864442169P755"

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

res_fmt = client.get("/repositories/2/resource_descriptions/577.:fmt/metadata",
                     params={"fmt": "864442169P755"})
# replace 2 for your repository ID and 577 with your resource ID. Find these at the URI on the staff interface
# set fmt to the format of the request you would like to export

print(res_fmt.content)
# Sample output: {"filename":"identifier_20210218_182435_UTC__ead.fmt","mimetype":"application/:fmt"}

# For error handling, print or log the returned value of client.get with .json() - print(res_fmt.json())

Endpoint

[:GET] /repositories/:repo_id/resource_descriptions/:id.:fmt/metadata

Description

Get export metadata for a Resource Description.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
fmt Format of the request String true

Returns

200 – The export metadata

Get a PDF representation of a Resource

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/resource_descriptions/577.pdf?include_unpublished=false&include_daos=true&numbered_cs=true&print_pdf=false&ead3=false" //
--output ead.pdf

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

ead_pdf = client.get("repositories/2/resource_descriptions/577.pdf",
                      params={"include_unpublished": False,
                              "include_daos": True,
                              "numbered_cs": True,
                              "print_pdf": True,
                              "ead3": False})
# replace 2 for your repository ID and 577 with your resource ID. Find these at the URI on the staff interface
# set parameters to True or False

with open("ead.pdf", "wb") as file:  # save the file
    file.write(ead_pdf.content)  # write the file content to our file.
    file.close()

# For error handling, print or log the returned value of client.get with .json() - print(ead_pdf.json())

Endpoint

[:GET] /repositories/:repo_id/resource_descriptions/:id.pdf

Description

Get a PDF representation of a Resource.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
include_unpublished Include unpublished records RESTHelpers::BooleanParam true
include_daos Include digital objects in dao tags RESTHelpers::BooleanParam true
numbered_cs Use numbered tags in ead RESTHelpers::BooleanParam true
print_pdf Print EAD to pdf RESTHelpers::BooleanParam true
repo_id The Repository ID
Note: The Repository must exist
Integer
ead3 Export using EAD3 schema RESTHelpers::BooleanParam true

Returns

200 – (:resource)

Get an EAD representation of a Resource

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/resource_descriptions/577.xml?include_unpublished=false&include_daos=true&numbered_cs=true&print_pdf=false&ead3=false" //
--output ead.xml

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

ead_xml = client.get("repositories/2/resource_descriptions/577.xml",
                     params={"include_unpublished": False,
                             "include_daos": True,
                             "numbered_cs": True,
                             "print_pdf": False,
                             "ead3": False})
# replace 2 for your repository ID and 577 with your resource ID. Find these at the URI on the staff interface
# set parameters to True or False

with open("ead.xml", "wb") as file:  # save the file
    file.write(ead_xml.content)  # write the file content to our file.
    file.close()

# For error handling, print or log the returned value of client.get with .json() - print(ead_xml.json())

Endpoint

[:GET] /repositories/:repo_id/resource_descriptions/:id.xml

Description

Get an EAD representation of a Resource.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
include_unpublished Include unpublished records RESTHelpers::BooleanParam true
include_daos Include digital objects in dao tags RESTHelpers::BooleanParam true
numbered_cs Use numbered tags in ead RESTHelpers::BooleanParam true
print_pdf Print EAD to pdf RESTHelpers::BooleanParam true
repo_id The Repository ID
Note: The Repository must exist
Integer
ead3 Export using EAD3 schema RESTHelpers::BooleanParam true

Returns

200 – (:resource)

Get export metadata for Resource labels

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/resource_labels/577.:fmt/metadata" --output labels.fmt

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

labels_fmt = client.get("/repositories/2/resource_labels/577.:fmt/metadata")
# replace 2 for your repository ID and 577 with your resource ID. Find these at the URI on the staff interface

print(labels_fmt.content)
# Sample output: {"filename":"identifier_20210218_182435_UTC__labels.tsv","mimetype":"text/tab-separated-values"}

# For error handling, print or log the returned value of client.get with .json() - print(labels_fmt.json())

Endpoint

[:GET] /repositories/:repo_id/resource_labels/:id.:fmt/metadata

Description

Get export metadata for Resource labels.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – The export metadata

Get a tsv list of printable labels for a Resource

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/resource_labels/577.tsv" --output container_labels.tsv

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

request_labels = client.get("repositories/2/resource_labels/577.tsv")
# replace 2 for your repository ID and 577 with your resource ID. Find these at the URI on the staff interface

with open("container_labels.tsv", "wb") as local_file:
    local_file.write(request_labels.content)  # write the file content to our file.
    local_file.close()

# For error handling, print or log the returned value of client.get with .json() - print(request_labels.json())

Endpoint

[:GET] /repositories/:repo_id/resource_labels/:id.tsv

Description

Get a tsv list of printable labels for a Resource.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:resource)

Create a Resource

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"resource",
"external_ids":[],
"subjects":[],
"linked_events":[],
"extents":[{ "jsonmodel_type":"extent",
"portion":"part",
"number":"71",
"extent_type":"gigabytes",
"dimensions":"B203799UY",
"physical_details":"K858764S612"}],
"lang_materials":[{ "jsonmodel_type":"lang_material",
"notes":[],
"language_and_script":{ "jsonmodel_type":"language_and_script",
"language":"tam",
"script":"Lana"}}],
"dates":[{ "jsonmodel_type":"date",
"date_type":"single",
"label":"creation",
"begin":"1974-05-28",
"end":"1974-05-28",
"certainty":"inferred",
"era":"ce",
"calendar":"gregorian",
"expression":"ORWA961"},
{ "jsonmodel_type":"date",
"date_type":"single",
"label":"creation",
"begin":"1974-06-20",
"certainty":"inferred",
"era":"ce",
"calendar":"gregorian",
"expression":"FVRCK"}],
"external_documents":[],
"rights_statements":[],
"linked_agents":[],
"is_slug_auto":true,
"restrictions":false,
"revision_statements":[{ "jsonmodel_type":"revision_statement",
"date":"QPGEF",
"description":"EW94855R"}],
"instances":[{ "jsonmodel_type":"instance",
"is_representative":false,
"instance_type":"text",
"sub_container":{ "jsonmodel_type":"sub_container",
"top_container":{ "ref":"/repositories/2/top_containers/4"},
"type_2":"folder",
"indicator_2":"266FQ148I",
"barcode_2":"LS62V742",
"type_3":"carton",
"indicator_3":"NF145364W"}}],
"deaccessions":[],
"related_accessions":[],
"classifications":[],
"notes":[],
"metadata_rights_declarations":[],
"title":"Resource Title: <emph render='italic'>2</emph>",
"id_0":"U810V283640",
"level":"subseries",
"finding_aid_description_rules":"cco",
"ead_id":"675JIQU",
"finding_aid_date":"72467793U313",
"finding_aid_series_statement":"CW513QL",
"finding_aid_language":"amh",
"finding_aid_script":"Ogam",
"finding_aid_note":"613NXJO",
"ead_location":"T798623PX"}' \
  "http://localhost:8089/repositories/2/resources"

Endpoint

[:POST] /repositories/:repo_id/resources

Description

Create a Resource.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:resource)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Get a list of Resources for a Repository

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/resources?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/resources?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/resources?all_ids=true"

Endpoint

[:GET] /repositories/:repo_id/resources

Description

Get a list of Resources for a Repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:resource)]

Get a Resource

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/resources/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/resources/:id

Description

Get a Resource.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:resource)

Update a Resource

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"resource",
"external_ids":[],
"subjects":[],
"linked_events":[],
"extents":[{ "jsonmodel_type":"extent",
"portion":"part",
"number":"71",
"extent_type":"gigabytes",
"dimensions":"B203799UY",
"physical_details":"K858764S612"}],
"lang_materials":[{ "jsonmodel_type":"lang_material",
"notes":[],
"language_and_script":{ "jsonmodel_type":"language_and_script",
"language":"tam",
"script":"Lana"}}],
"dates":[{ "jsonmodel_type":"date",
"date_type":"single",
"label":"creation",
"begin":"1974-05-28",
"end":"1974-05-28",
"certainty":"inferred",
"era":"ce",
"calendar":"gregorian",
"expression":"ORWA961"},
{ "jsonmodel_type":"date",
"date_type":"single",
"label":"creation",
"begin":"1974-06-20",
"certainty":"inferred",
"era":"ce",
"calendar":"gregorian",
"expression":"FVRCK"}],
"external_documents":[],
"rights_statements":[],
"linked_agents":[],
"is_slug_auto":true,
"restrictions":false,
"revision_statements":[{ "jsonmodel_type":"revision_statement",
"date":"QPGEF",
"description":"EW94855R"}],
"instances":[{ "jsonmodel_type":"instance",
"is_representative":false,
"instance_type":"text",
"sub_container":{ "jsonmodel_type":"sub_container",
"top_container":{ "ref":"/repositories/2/top_containers/4"},
"type_2":"folder",
"indicator_2":"266FQ148I",
"barcode_2":"LS62V742",
"type_3":"carton",
"indicator_3":"NF145364W"}}],
"deaccessions":[],
"related_accessions":[],
"classifications":[],
"notes":[],
"metadata_rights_declarations":[],
"title":"Resource Title: <emph render='italic'>2</emph>",
"id_0":"U810V283640",
"level":"subseries",
"finding_aid_description_rules":"cco",
"ead_id":"675JIQU",
"finding_aid_date":"72467793U313",
"finding_aid_series_statement":"CW513QL",
"finding_aid_language":"amh",
"finding_aid_script":"Ogam",
"finding_aid_note":"613NXJO",
"ead_location":"T798623PX"}' \
  "http://localhost:8089/repositories/2/resources/1"

Endpoint

[:POST] /repositories/:repo_id/resources/:id

Description

Update a Resource.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:resource)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Delete a Resource

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/resources/1"

Endpoint

[:DELETE] /repositories/:repo_id/resources/:id

Description

Delete a Resource.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Move existing Archival Objects to become children of a Resource

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/resources/1/accept_children?children=OA67R363&position=1"

Endpoint

[:POST] /repositories/:repo_id/resources/:id/accept_children

Description

Move existing Archival Objects to become children of a Resource.

Parameters

Parameter Description Type Optional?
children The children to move to the Resource [String] true
id The ID of the Resource to move children to Integer
position The index for the first child to be moved to Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

409 – {:error => (description of error)}

Batch create several Archival Objects as children of an existing Resource

  curl -H "X-ArchivesSpace-Session: $SESSION"         -d '{
    "jsonmodel_type": "archival_record_children",
    "children": [
        { "jsonmodel_type":"archival_object",
            "external_ids":[],
            "subjects":[],
            "linked_events":[],
            "extents":[],
            "lang_materials":[],
            "dates":[],
            "external_documents":[],
            "rights_statements":[],
            "linked_agents":[],
            "is_slug_auto":true,
            "restrictions_apply":false,
            "ancestors":[],
            "instances":[],
            "notes":[],
            "level":"subseries",
            "title":"Archival Object Title: 1",
            "resource":{ "ref":"/repositories/2/resources/1"}},
        { "jsonmodel_type":"archival_object",
            "external_ids":[],
            "subjects":[],
            "linked_events":[],
            "extents":[],
            "lang_materials":[],
            "dates":[],
            "external_documents":[],
            "rights_statements":[],
            "linked_agents":[],
            "is_slug_auto":true,
            "restrictions_apply":false,
            "ancestors":[],
            "instances":[],
            "notes":[],
            "level":"subseries",
            "title":"Archival Object Title: 2",
            "resource":{ "ref":"/repositories/2/resources/1"}}
    ]
}'           "http://localhost:8089/repositories/2/resources/1/children"

Endpoint

[:POST] /repositories/:repo_id/resources/:id/children

Description

Batch create several Archival Objects as children of an existing Resource.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:archival_record_children)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

409 – {:error => (description of error)}

Get a list of record types in the graph of a resource

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/resources/1/models_in_graph"

Endpoint

[:GET] /repositories/:repo_id/resources/:id/models_in_graph

Description

Get a list of record types in the graph of a resource.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – OK

Get the list of URIs of this published resource and all published archival objects contained within.Ordered by tree order (i.e. if you fully expanded the record tree and read from top to bottom)

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/resources/1/ordered_records"

Endpoint

[:GET] /repositories/:repo_id/resources/:id/ordered_records

Description

Get the list of URIs of this published resource and all published archival objects contained within.Ordered by tree order (i.e. if you fully expanded the record tree and read from top to bottom).

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – JSONModel(:resource_ordered_records)

Publish a resource and all its sub-records and components

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/resources/1/publish"

Endpoint

[:POST] /repositories/:repo_id/resources/:id/publish

Description

Publish a resource and all its sub-records and components.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Suppress this record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/resources/1/suppressed?suppressed=true"

Endpoint

[:POST] /repositories/:repo_id/resources/:id/suppressed

Description

Suppress this record.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
suppressed Suppression state RESTHelpers::BooleanParam
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Suppressed”, :id => (id of updated object), :suppressed_state => (true|false)}

Get a CSV template useful for bulk-creating containers for archival objects of a resource

# Saves the csv to file 'resource_1_top_container_creation.csv'
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/resources/1/templates/top_container_creation.csv" \
  > resource_1_top_container_creation.csv

from asnake.client import ASnakeClient

client = ASnakeClient()
client.authorize()

with open('resource_1_top_container_creation.csv', 'wb') as file:
    resp = client.get('repositories/2/resources/1/templates/top_container_creation.csv')
    if resp.status_code == 200:
        file.write(resp.content)

Endpoint

[:GET] /repositories/:repo_id/resources/:id/templates/top_container_creation.csv

Description

Get a CSV template useful for bulk-creating containers for archival objects of a resource.

This method returns a spreadsheet representing all the archival objects in a resource, with the following fields:

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – The CSV template

Get Top Containers linked to a published resource and published archival ojbects contained within.

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/resources/1/top_containers?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/resources/:id/top_containers

Description

Get Top Containers linked to a published resource and published archival ojbects contained within..

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – a list of linked top containers

404 – Not found

Transfer this record to a different repository

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/resources/1/transfer?target_repo=XH598327220"

Endpoint

[:POST] /repositories/:repo_id/resources/:id/transfer

Description

Transfer this record to a different repository.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
target_repo The URI of the target repository String
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – moved

Get a Resource tree

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/resources/1/tree?limit_to=U106CSG"

Endpoint

[:GET] /repositories/:repo_id/resources/:id/tree

Description

Get a Resource tree.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
limit_to An Archival Object URI or 'root’ String true
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – OK

Fetch tree information for an Archival Object record within a tree

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/resources/1/tree/node?node_uri=/repositories/2/archival_objects/1"

Endpoint

[:GET] /repositories/:repo_id/resources/:id/tree/node

Description

Fetch tree information for an Archival Object record within a tree.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
node_uri The URI of the Archival Object record of interest String
published_only Whether to restrict to published/unsuppressed items RESTHelpers::BooleanParam

Returns

200 – Returns a JSON object describing enough information about a specific node. Includes:

Fetch tree paths from the root record to Archival Objects

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/resources/1/tree/node_from_root?node_ids[]=1"

Endpoint

[:GET] /repositories/:repo_id/resources/:id/tree/node_from_root

Description

Fetch tree paths from the root record to Archival Objects.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
node_ids The IDs of the Archival Object records of interest [Integer]
published_only Whether to restrict to published/unsuppressed items RESTHelpers::BooleanParam

Returns

200 – Returns a JSON array describing the path to a node, starting from the root of the tree. Each path element provides:

Fetch tree information for the top-level resource record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/resources/1/tree/root"

Endpoint

[:GET] /repositories/:repo_id/resources/:id/tree/root

Description

Fetch tree information for the top-level resource record.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
published_only Whether to restrict to published/unsuppressed items RESTHelpers::BooleanParam

Returns

200 – Returns a JSON object describing enough information about this tree’s root record to render the rest. Includes:

Fetch the record slice for a given tree waypoint

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/resources/1/tree/waypoint?offset=0&parent_node=/repositories/2/archival_objects/1"

Endpoint

[:GET] /repositories/:repo_id/resources/:id/tree/waypoint

Description

Fetch the record slice for a given tree waypoint.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
offset The page of records to return Integer
parent_node The URI of the parent of this waypoint (none for the root record) String true
published_only Whether to restrict to published/unsuppressed items RESTHelpers::BooleanParam

Returns

200 – Returns a JSON array containing information for the records contained in a given waypoint. Each array element is an object that includes:

Unpublish a resource and all its sub-records and components

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/resources/1/unpublish"

Endpoint

[:POST] /repositories/:repo_id/resources/:id/unpublish

Description

Unpublish a resource and all its sub-records and components.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Get metadata for a MARC21 export

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/resources/marc21/577.:fmt/metadata?include_unpublished_marc=true"

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

marc21_fmt = client.get("/repositories/2/resources/marc21/577.:fmt/metadata",
                        params={"include_unpublished_marc": True})
# replace 2 for your repository ID and 577 with your resource ID. Find these at the URI on the staff interface
# set include_unpublished_marc to True or False

print(marc21_fmt.content)
# Sample output: {"filename":"identifier_20210218_182435_UTC__marc21.xml","mimetype":"application/xml"}

# For error handling, print or log the returned value of client.get with .json() - print(marc21_fmt.json())

Endpoint

[:GET] /repositories/:repo_id/resources/marc21/:id.:fmt/metadata

Description

Get metadata for a MARC21 export.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
include_unpublished_marc Include unpublished notes RESTHelpers::BooleanParam true

Returns

200 – The export metadata

Get a MARC 21 representation of a Resource

curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/resources/marc21/577.xml?include_unpublished_marc=true;include_unpublished_notes=false" //
--output marc21.xml

from asnake.client import ASnakeClient  # import the ArchivesSnake client

client = ASnakeClient(baseurl="http://localhost:8089", username="admin", password="admin")
# replace http://localhost:8089 with your ArchivesSpace API URL and admin for your username and password

client.authorize()  # authorizes the client

marc21_xml = client.get("/repositories/2/resources/marc21/577.xml",
                        params={"include_unpublished_marc": True,
                                "include_unpublished_notes": False})
# replace 2 for your repository ID and 577 with your resource ID. Find these at the URI on the staff interface
# set parameters to True or False

with open("marc21.xml", "wb") as file:  # save the file
    file.write(marc21_xml.content)  # write the file content to our file.
    file.close()

Endpoint

[:GET] /repositories/:repo_id/resources/marc21/:id.xml

Description

Get a MARC 21 representation of a Resource.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
include_unpublished_marc Include unpublished notes RESTHelpers::BooleanParam true

Returns

200 – (:resource)

Search this repository


curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"WJQ40460"' \
  "http://localhost:8089/repositories/2/search?q=WJQ40460&aq=["Example Missing"]&type=KLNIJ&sort=228S786TL&facet=G917642826&facet_mincount=1&filter=["Example Missing"]&filter_query=985H286HR&exclude=LH297O71&hl=true&root_record=E337W452R&dt=806NE491396&fields=679FWRT"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/repositories/2/search?q=WJQ40460&aq=["Example Missing"]&type=KLNIJ&sort=228S786TL&facet=G917642826&facet_mincount=1&filter=["Example Missing"]&filter_query=985H286HR&exclude=LH297O71&hl=true&root_record=E337W452R&dt=806NE491396&fields=679FWRT"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"KLNIJ"' \
  "http://localhost:8089/repositories/2/search?q=WJQ40460&aq=["Example Missing"]&type=KLNIJ&sort=228S786TL&facet=G917642826&facet_mincount=1&filter=["Example Missing"]&filter_query=985H286HR&exclude=LH297O71&hl=true&root_record=E337W452R&dt=806NE491396&fields=679FWRT"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"228S786TL"' \
  "http://localhost:8089/repositories/2/search?q=WJQ40460&aq=["Example Missing"]&type=KLNIJ&sort=228S786TL&facet=G917642826&facet_mincount=1&filter=["Example Missing"]&filter_query=985H286HR&exclude=LH297O71&hl=true&root_record=E337W452R&dt=806NE491396&fields=679FWRT"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"G917642826"' \
  "http://localhost:8089/repositories/2/search?q=WJQ40460&aq=["Example Missing"]&type=KLNIJ&sort=228S786TL&facet=G917642826&facet_mincount=1&filter=["Example Missing"]&filter_query=985H286HR&exclude=LH297O71&hl=true&root_record=E337W452R&dt=806NE491396&fields=679FWRT"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"1"' \
  "http://localhost:8089/repositories/2/search?q=WJQ40460&aq=["Example Missing"]&type=KLNIJ&sort=228S786TL&facet=G917642826&facet_mincount=1&filter=["Example Missing"]&filter_query=985H286HR&exclude=LH297O71&hl=true&root_record=E337W452R&dt=806NE491396&fields=679FWRT"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/repositories/2/search?q=WJQ40460&aq=["Example Missing"]&type=KLNIJ&sort=228S786TL&facet=G917642826&facet_mincount=1&filter=["Example Missing"]&filter_query=985H286HR&exclude=LH297O71&hl=true&root_record=E337W452R&dt=806NE491396&fields=679FWRT"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"985H286HR"' \
  "http://localhost:8089/repositories/2/search?q=WJQ40460&aq=["Example Missing"]&type=KLNIJ&sort=228S786TL&facet=G917642826&facet_mincount=1&filter=["Example Missing"]&filter_query=985H286HR&exclude=LH297O71&hl=true&root_record=E337W452R&dt=806NE491396&fields=679FWRT"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"LH297O71"' \
  "http://localhost:8089/repositories/2/search?q=WJQ40460&aq=["Example Missing"]&type=KLNIJ&sort=228S786TL&facet=G917642826&facet_mincount=1&filter=["Example Missing"]&filter_query=985H286HR&exclude=LH297O71&hl=true&root_record=E337W452R&dt=806NE491396&fields=679FWRT"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"BooleanParam"' \
  "http://localhost:8089/repositories/2/search?q=WJQ40460&aq=["Example Missing"]&type=KLNIJ&sort=228S786TL&facet=G917642826&facet_mincount=1&filter=["Example Missing"]&filter_query=985H286HR&exclude=LH297O71&hl=true&root_record=E337W452R&dt=806NE491396&fields=679FWRT"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"E337W452R"' \
  "http://localhost:8089/repositories/2/search?q=WJQ40460&aq=["Example Missing"]&type=KLNIJ&sort=228S786TL&facet=G917642826&facet_mincount=1&filter=["Example Missing"]&filter_query=985H286HR&exclude=LH297O71&hl=true&root_record=E337W452R&dt=806NE491396&fields=679FWRT"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"806NE491396"' \
  "http://localhost:8089/repositories/2/search?q=WJQ40460&aq=["Example Missing"]&type=KLNIJ&sort=228S786TL&facet=G917642826&facet_mincount=1&filter=["Example Missing"]&filter_query=985H286HR&exclude=LH297O71&hl=true&root_record=E337W452R&dt=806NE491396&fields=679FWRT"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"679FWRT"' \
  "http://localhost:8089/repositories/2/search?q=WJQ40460&aq=["Example Missing"]&type=KLNIJ&sort=228S786TL&facet=G917642826&facet_mincount=1&filter=["Example Missing"]&filter_query=985H286HR&exclude=LH297O71&hl=true&root_record=E337W452R&dt=806NE491396&fields=679FWRT"


Endpoint

[:GET, :POST] /repositories/:repo_id/search

Description

Search this repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer
q A search query string. Uses Lucene 4.0 syntax: http://lucene.apache.org/core/4_0_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html Search index structure can be found in solr/schema.xml String true
aq A json string containing the advanced query JSONModel(:advanced_query) true
type The record type to search (defaults to all types if not specified) [String] true
sort The attribute to sort and the direction e.g. &sort=title desc&… String true
facet The list of the fields to produce facets for [String] true
facet_mincount The minimum count for a facet field to be included in the response Integer true
filter A json string containing the advanced query to filter by JSONModel(:advanced_query) true
filter_query Search queries to be applied as a filter to the results. [String] true
exclude A list of document IDs that should be excluded from results [String] true
hl Whether to use highlighting RESTHelpers::BooleanParam true
root_record Search within a collection of records (defined by the record at the root of the tree) String true
dt Format to return (JSON default) String true
fields The list of fields to include in the results [String] true

Returns

200 –

Create a top container

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"top_container",
"active_restrictions":[],
"container_locations":[],
"series":[],
"collection":[],
"indicator":"130UI788D",
"type":"box",
"barcode":"dfd3661ae04731b705c32e3af31585d1",
"ils_holding_id":"SJ885I20",
"ils_item_id":"UR88943Q",
"exported_to_ils":"2021-09-20T19:04:39-04:00"}' \
  "http://localhost:8089/repositories/2/top_containers"

Endpoint

[:POST] /repositories/:repo_id/top_containers

Description

Create a top container.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:top_container)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

Get a list of TopContainers for a Repository

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/top_containers?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/top_containers?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/top_containers?all_ids=true"

Endpoint

[:GET] /repositories/:repo_id/top_containers

Description

Get a list of TopContainers for a Repository.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – [(:top_container)]

Update a top container

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"top_container",
"active_restrictions":[],
"container_locations":[],
"series":[],
"collection":[],
"indicator":"130UI788D",
"type":"box",
"barcode":"dfd3661ae04731b705c32e3af31585d1",
"ils_holding_id":"SJ885I20",
"ils_item_id":"UR88943Q",
"exported_to_ils":"2021-09-20T19:04:39-04:00"}' \
  "http://localhost:8089/repositories/2/top_containers/1"

Endpoint

[:POST] /repositories/:repo_id/top_containers/:id

Description

Update a top container.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

JSONModel(:top_container)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get a top container by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/top_containers/1?resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /repositories/:repo_id/top_containers/:id

Description

Get a top container by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – (:top_container)

Delete a top container

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/repositories/2/top_containers/1"

Endpoint

[:DELETE] /repositories/:repo_id/top_containers/:id

Description

Delete a top container.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – deleted

Update container profile for a batch of top containers

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/top_containers/batch/container_profile?ids=1&container_profile_uri=LQAKT"

Endpoint

[:POST] /repositories/:repo_id/top_containers/batch/container_profile

Description

Update container profile for a batch of top containers.

Parameters

Parameter Description Type Optional?
ids [Integer]
container_profile_uri The uri of the container profile String
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Update ils_holding_id for a batch of top containers

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/top_containers/batch/ils_holding_id?ids=1&ils_holding_id=D743831543V"

Endpoint

[:POST] /repositories/:repo_id/top_containers/batch/ils_holding_id

Description

Update ils_holding_id for a batch of top containers.

Parameters

Parameter Description Type Optional?
ids [Integer]
ils_holding_id Value to set for ils_holding_id String
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Update location for a batch of top containers

curl -H "X-ArchivesSpace-Session: $SESSION" \
 -d 'ids[]=[1,2,3,4,5]' \
 -d 'location_uri=locations/1234' \
 "http://localhost:8089/repositories/2/top_containers/batch/location"

client = ASnakeClient()
client.post('repositories/2/top_containers/batch/location',
      params={ 'ids': [1,2,3,4,5],
               'location_uri': 'locations/1234' })

Endpoint

[:POST] /repositories/:repo_id/top_containers/batch/location

Description

Update location for a batch of top containers.

This route takes the ids of one or more containers, and associates the containers with the location referenced by location_uri.

Parameters

Parameter Description Type Optional?
ids [Integer]
location_uri The uri of the location String
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Bulk update barcodes

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"187I490W739"' \
  "http://localhost:8089/repositories/2/top_containers/bulk/barcodes"

Endpoint

[:POST] /repositories/:repo_id/top_containers/bulk/barcodes

Description

Bulk update barcodes.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

String

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Bulk update locations

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"340715FGM"' \
  "http://localhost:8089/repositories/2/top_containers/bulk/locations"

Endpoint

[:POST] /repositories/:repo_id/top_containers/bulk/locations

Description

Bulk update locations.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer

Accepts Payload of Type

String

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Search for top containers

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/top_containers/search?q=GHCN877&aq=["Example Missing"]&type=84PNEI&sort=K532949177D&facet=ALECI&facet_mincount=1&filter=["Example Missing"]&filter_query=OUO397Q&exclude=635582G404L&hl=true&root_record=935855R946150&dt=TMNSI&fields=UJM341F"

Endpoint

[:GET] /repositories/:repo_id/top_containers/search

Description

Search for top containers.

Parameters

Parameter Description Type Optional?
repo_id The Repository ID
Note: The Repository must exist
Integer
q A search query string. Uses Lucene 4.0 syntax: http://lucene.apache.org/core/4_0_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html Search index structure can be found in solr/schema.xml String true
aq A json string containing the advanced query JSONModel(:advanced_query) true
type The record type to search (defaults to all types if not specified) [String] true
sort The attribute to sort and the direction e.g. &sort=title desc&… String true
facet The list of the fields to produce facets for [String] true
facet_mincount The minimum count for a facet field to be included in the response Integer true
filter A json string containing the advanced query to filter by JSONModel(:advanced_query) true
filter_query Search queries to be applied as a filter to the results. [String] true
exclude A list of document IDs that should be excluded from results [String] true
hl Whether to use highlighting RESTHelpers::BooleanParam true
root_record Search within a collection of records (defined by the record at the root of the tree) String true
dt Format to return (JSON default) String true
fields The list of fields to include in the results [String] true

Returns

200 – [(:top_container)]

Transfer this record to a different repository

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/repositories/2/transfer?target_repo=N727350I363"

Endpoint

[:POST] /repositories/:repo_id/transfer

Description

Transfer this record to a different repository.

Parameters

Parameter Description Type Optional?
target_repo The URI of the target repository String
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – moved

Get a user’s details including their groups for the current repository

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/2/users/1"

Endpoint

[:GET] /repositories/:repo_id/users/:id

Description

Get a user’s details including their groups for the current repository.

Parameters

Parameter Description Type Optional?
id The username id to fetch Integer
repo_id The Repository ID
Note: The Repository must exist
Integer

Returns

200 – (:user)

Create a Repository with an agent representation

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"repository_with_agent",
"repository":{ "jsonmodel_type":"repository",
"name":"Description: 6",
"is_slug_auto":true,
"repo_code":"ASPACE REPO 3 -- 719662",
"org_code":"D814N666A",
"image_url":"http://www.example-12-1632179083.com",
"url":"http://www.example-13-1632179083.com",
"country":"US"},
"agent_representation":{ "jsonmodel_type":"agent_corporate_entity",
"agent_contacts":[{ "jsonmodel_type":"agent_contact",
"telephones":[{ "jsonmodel_type":"telephone",
"number_type":"home",
"number":"688 46464 60677 557",
"ext":"RCKGO"}],
"notes":[{ "jsonmodel_type":"note_contact_note",
"date_of_contact":"T18080661996",
"contact_notes":"EGP788L"}],
"is_representative":false,
"name":"Name Number 10",
"address_2":"291ROXL",
"country":"927O548VJ",
"post_code":"YL414118188",
"fax":"901WA708P",
"email":"OXETC"}],
"agent_record_controls":[],
"agent_alternate_sets":[],
"agent_conventions_declarations":[],
"agent_other_agency_codes":[],
"agent_maintenance_histories":[],
"agent_record_identifiers":[],
"agent_identifiers":[],
"agent_sources":[],
"agent_places":[],
"agent_occupations":[],
"agent_functions":[],
"agent_topics":[],
"agent_resources":[],
"linked_agent_roles":[],
"external_documents":[],
"notes":[],
"used_within_repositories":[],
"used_within_published_repositories":[],
"dates_of_existence":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"used_languages":[],
"metadata_rights_declarations":[],
"is_slug_auto":true,
"names":[{ "jsonmodel_type":"name_corporate_entity",
"use_dates":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"authorized":false,
"is_display_name":false,
"sort_name_auto_generate":true,
"conference_meeting":false,
"jurisdiction":false,
"parallel_names":[],
"rules":"dacs",
"primary_name":"Name Number 9",
"subordinate_name_1":"ROO833945",
"subordinate_name_2":"EI980GL",
"number":"619N410JN",
"sort_name":"SORT y - 7",
"qualifier":"J880IJ290",
"dates":"JEGBY",
"authority_id":"http://www.example-14-1632179083.com",
"source":"ingest"}],
"related_agents":[],
"agent_type":"agent_corporate_entity"}}' \
  "http://localhost:8089/repositories/with_agent"

Endpoint

[:POST] /repositories/with_agent

Description

Create a Repository with an agent representation.

Accepts Payload of Type

JSONModel(:repository_with_agent)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

403 – access_denied

Get a Repository by ID, including its agent representation

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/repositories/with_agent/1"

Endpoint

[:GET] /repositories/with_agent/:id

Description

Get a Repository by ID, including its agent representation.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Returns

200 – (:repository_with_agent)

404 – Not found

Update a repository with an agent representation

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"repository_with_agent",
"repository":{ "jsonmodel_type":"repository",
"name":"Description: 6",
"is_slug_auto":true,
"repo_code":"ASPACE REPO 3 -- 719662",
"org_code":"D814N666A",
"image_url":"http://www.example-12-1632179083.com",
"url":"http://www.example-13-1632179083.com",
"country":"US"},
"agent_representation":{ "jsonmodel_type":"agent_corporate_entity",
"agent_contacts":[{ "jsonmodel_type":"agent_contact",
"telephones":[{ "jsonmodel_type":"telephone",
"number_type":"home",
"number":"688 46464 60677 557",
"ext":"RCKGO"}],
"notes":[{ "jsonmodel_type":"note_contact_note",
"date_of_contact":"T18080661996",
"contact_notes":"EGP788L"}],
"is_representative":false,
"name":"Name Number 10",
"address_2":"291ROXL",
"country":"927O548VJ",
"post_code":"YL414118188",
"fax":"901WA708P",
"email":"OXETC"}],
"agent_record_controls":[],
"agent_alternate_sets":[],
"agent_conventions_declarations":[],
"agent_other_agency_codes":[],
"agent_maintenance_histories":[],
"agent_record_identifiers":[],
"agent_identifiers":[],
"agent_sources":[],
"agent_places":[],
"agent_occupations":[],
"agent_functions":[],
"agent_topics":[],
"agent_resources":[],
"linked_agent_roles":[],
"external_documents":[],
"notes":[],
"used_within_repositories":[],
"used_within_published_repositories":[],
"dates_of_existence":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"used_languages":[],
"metadata_rights_declarations":[],
"is_slug_auto":true,
"names":[{ "jsonmodel_type":"name_corporate_entity",
"use_dates":[{ "jsonmodel_type":"structured_date_label",
"date_type_structured":"single",
"date_label":"existence",
"structured_date_single":{ "jsonmodel_type":"structured_date_single",
"date_role":"begin",
"date_expression":"Yesterday",
"date_standardized":"2019-06-01",
"date_standardized_type":"standard"},
"date_certainty":"approximate",
"date_era":"ce",
"date_calendar":"gregorian"}],
"authorized":false,
"is_display_name":false,
"sort_name_auto_generate":true,
"conference_meeting":false,
"jurisdiction":false,
"parallel_names":[],
"rules":"dacs",
"primary_name":"Name Number 9",
"subordinate_name_1":"ROO833945",
"subordinate_name_2":"EI980GL",
"number":"619N410JN",
"sort_name":"SORT y - 7",
"qualifier":"J880IJ290",
"dates":"JEGBY",
"authority_id":"http://www.example-14-1632179083.com",
"source":"ingest"}],
"related_agents":[],
"agent_type":"agent_corporate_entity"}}' \
  "http://localhost:8089/repositories/with_agent/1"

Endpoint

[:POST] /repositories/with_agent/:id

Description

Update a repository with an agent representation.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Accepts Payload of Type

JSONModel(:repository_with_agent)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get all ArchivesSpace schemas

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/schemas"

Endpoint

[:GET] /schemas

Description

Get all ArchivesSpace schemas.

Returns

200 – ArchivesSpace (schemas)

Get an ArchivesSpace schema

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/schemas/1"

Endpoint

[:GET] /schemas/:schema

Description

Get an ArchivesSpace schema.

Parameters

Parameter Description Type Optional?
schema Schema name to retrieve String

Returns

200 – ArchivesSpace (:schema)

404 – Schema not found

Search this archive


curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"ID864Q390"' \
  "http://localhost:8089/search?q=ID864Q390&aq=["Example Missing"]&type=P112AC485&sort=IT657GE&facet=WH117240N&facet_mincount=1&filter=["Example Missing"]&filter_query=CFO862A&exclude=FHK650148&hl=true&root_record=39N711T301&dt=HNY808U&fields=E622369RV"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/search?q=ID864Q390&aq=["Example Missing"]&type=P112AC485&sort=IT657GE&facet=WH117240N&facet_mincount=1&filter=["Example Missing"]&filter_query=CFO862A&exclude=FHK650148&hl=true&root_record=39N711T301&dt=HNY808U&fields=E622369RV"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"P112AC485"' \
  "http://localhost:8089/search?q=ID864Q390&aq=["Example Missing"]&type=P112AC485&sort=IT657GE&facet=WH117240N&facet_mincount=1&filter=["Example Missing"]&filter_query=CFO862A&exclude=FHK650148&hl=true&root_record=39N711T301&dt=HNY808U&fields=E622369RV"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"IT657GE"' \
  "http://localhost:8089/search?q=ID864Q390&aq=["Example Missing"]&type=P112AC485&sort=IT657GE&facet=WH117240N&facet_mincount=1&filter=["Example Missing"]&filter_query=CFO862A&exclude=FHK650148&hl=true&root_record=39N711T301&dt=HNY808U&fields=E622369RV"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"WH117240N"' \
  "http://localhost:8089/search?q=ID864Q390&aq=["Example Missing"]&type=P112AC485&sort=IT657GE&facet=WH117240N&facet_mincount=1&filter=["Example Missing"]&filter_query=CFO862A&exclude=FHK650148&hl=true&root_record=39N711T301&dt=HNY808U&fields=E622369RV"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"1"' \
  "http://localhost:8089/search?q=ID864Q390&aq=["Example Missing"]&type=P112AC485&sort=IT657GE&facet=WH117240N&facet_mincount=1&filter=["Example Missing"]&filter_query=CFO862A&exclude=FHK650148&hl=true&root_record=39N711T301&dt=HNY808U&fields=E622369RV"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/search?q=ID864Q390&aq=["Example Missing"]&type=P112AC485&sort=IT657GE&facet=WH117240N&facet_mincount=1&filter=["Example Missing"]&filter_query=CFO862A&exclude=FHK650148&hl=true&root_record=39N711T301&dt=HNY808U&fields=E622369RV"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"CFO862A"' \
  "http://localhost:8089/search?q=ID864Q390&aq=["Example Missing"]&type=P112AC485&sort=IT657GE&facet=WH117240N&facet_mincount=1&filter=["Example Missing"]&filter_query=CFO862A&exclude=FHK650148&hl=true&root_record=39N711T301&dt=HNY808U&fields=E622369RV"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"FHK650148"' \
  "http://localhost:8089/search?q=ID864Q390&aq=["Example Missing"]&type=P112AC485&sort=IT657GE&facet=WH117240N&facet_mincount=1&filter=["Example Missing"]&filter_query=CFO862A&exclude=FHK650148&hl=true&root_record=39N711T301&dt=HNY808U&fields=E622369RV"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"BooleanParam"' \
  "http://localhost:8089/search?q=ID864Q390&aq=["Example Missing"]&type=P112AC485&sort=IT657GE&facet=WH117240N&facet_mincount=1&filter=["Example Missing"]&filter_query=CFO862A&exclude=FHK650148&hl=true&root_record=39N711T301&dt=HNY808U&fields=E622369RV"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"39N711T301"' \
  "http://localhost:8089/search?q=ID864Q390&aq=["Example Missing"]&type=P112AC485&sort=IT657GE&facet=WH117240N&facet_mincount=1&filter=["Example Missing"]&filter_query=CFO862A&exclude=FHK650148&hl=true&root_record=39N711T301&dt=HNY808U&fields=E622369RV"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"HNY808U"' \
  "http://localhost:8089/search?q=ID864Q390&aq=["Example Missing"]&type=P112AC485&sort=IT657GE&facet=WH117240N&facet_mincount=1&filter=["Example Missing"]&filter_query=CFO862A&exclude=FHK650148&hl=true&root_record=39N711T301&dt=HNY808U&fields=E622369RV"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"E622369RV"' \
  "http://localhost:8089/search?q=ID864Q390&aq=["Example Missing"]&type=P112AC485&sort=IT657GE&facet=WH117240N&facet_mincount=1&filter=["Example Missing"]&filter_query=CFO862A&exclude=FHK650148&hl=true&root_record=39N711T301&dt=HNY808U&fields=E622369RV"


Endpoint

[:GET, :POST] /search

Description

Search this archive.

Parameters

Parameter Description Type Optional?
q A search query string. Uses Lucene 4.0 syntax: http://lucene.apache.org/core/4_0_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html Search index structure can be found in solr/schema.xml String true
aq A json string containing the advanced query JSONModel(:advanced_query) true
type The record type to search (defaults to all types if not specified) [String] true
sort The attribute to sort and the direction e.g. &sort=title desc&… String true
facet The list of the fields to produce facets for [String] true
facet_mincount The minimum count for a facet field to be included in the response Integer true
filter A json string containing the advanced query to filter by JSONModel(:advanced_query) true
filter_query Search queries to be applied as a filter to the results. [String] true
exclude A list of document IDs that should be excluded from results [String] true
hl Whether to use highlighting RESTHelpers::BooleanParam true
root_record Search within a collection of records (defined by the record at the root of the tree) String true
dt Format to return (JSON default) String true
fields The list of fields to include in the results [String] true

Returns

200 –

Search across Location Profiles

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/search/location_profile?q=A992KBO&aq=["Example Missing"]&type=XJHIX&sort=RFQEQ&facet=JJ963722K&facet_mincount=1&filter=["Example Missing"]&filter_query=OC622IB&exclude=HPP888591&hl=true&root_record=EE58873583&dt=350XD200458&fields=YKWVS?page=1&page_size=10"

Endpoint

[:GET] /search/location_profile

Description

Search across Location Profiles.

Parameters

Parameter Description Type Optional?
q A search query string. Uses Lucene 4.0 syntax: http://lucene.apache.org/core/4_0_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html Search index structure can be found in solr/schema.xml String true
aq A json string containing the advanced query JSONModel(:advanced_query) true
type The record type to search (defaults to all types if not specified) [String] true
sort The attribute to sort and the direction e.g. &sort=title desc&… String true
facet The list of the fields to produce facets for [String] true
facet_mincount The minimum count for a facet field to be included in the response Integer true
filter A json string containing the advanced query to filter by JSONModel(:advanced_query) true
filter_query Search queries to be applied as a filter to the results. [String] true
exclude A list of document IDs that should be excluded from results [String] true
hl Whether to use highlighting RESTHelpers::BooleanParam true
root_record Search within a collection of records (defined by the record at the root of the tree) String true
dt Format to return (JSON default) String true
fields The list of fields to include in the results [String] true

Returns

200 –

Find the tree view for a particular archival record

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/search/published_tree?node_uri=164JTTC"

Endpoint

[:GET] /search/published_tree

Description

Find the tree view for a particular archival record.

Parameters

Parameter Description Type Optional?
node_uri The URI of the archival record to find the tree view for String

Returns

200 – OK

404 – Not found

Return the counts of record types of interest by repository


curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"I287M420987"' \
  "http://localhost:8089/search/record_types_by_repository?record_types=I287M420987&repo_uri=F582HQB"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"F582HQB"' \
  "http://localhost:8089/search/record_types_by_repository?record_types=I287M420987&repo_uri=F582HQB"


Endpoint

[:GET, :POST] /search/record_types_by_repository

Description

Return the counts of record types of interest by repository.

Parameters

Parameter Description Type Optional?
record_types The list of record types to tally [String]
repo_uri An optional repository URI. If given, just return counts for the single repository String true

Returns

200 – If repository is given, returns a map like {'record_type’ => }. Otherwise, {'repo_uri’ => {'record_type’ => }}

Return a set of records by URI


curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"384C102CP"' \
  "http://localhost:8089/search/records?uri=384C102CP&resolve[]=[record_types, to_resolve]"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"H863392HG"' \
  "http://localhost:8089/search/records?uri=384C102CP&resolve[]=[record_types, to_resolve]"


Endpoint

[:GET, :POST] /search/records

Description

Return a set of records by URI.

Parameters

Parameter Description Type Optional?
uri The list of record URIs to fetch [String]
resolve The list of result fields to resolve (if any) [String] true

Returns

200 – a JSON map of records

Search across repositories


curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"D24324P189"' \
  "http://localhost:8089/search/repositories?q=D24324P189&aq=["Example Missing"]&type=518510LHY&sort=56XK567C&facet=P76614O91&facet_mincount=1&filter=["Example Missing"]&filter_query=GTG829O&exclude=RXGC214&hl=true&root_record=BH386RX&dt=YNR297K&fields=980X614Q738"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/search/repositories?q=D24324P189&aq=["Example Missing"]&type=518510LHY&sort=56XK567C&facet=P76614O91&facet_mincount=1&filter=["Example Missing"]&filter_query=GTG829O&exclude=RXGC214&hl=true&root_record=BH386RX&dt=YNR297K&fields=980X614Q738"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"518510LHY"' \
  "http://localhost:8089/search/repositories?q=D24324P189&aq=["Example Missing"]&type=518510LHY&sort=56XK567C&facet=P76614O91&facet_mincount=1&filter=["Example Missing"]&filter_query=GTG829O&exclude=RXGC214&hl=true&root_record=BH386RX&dt=YNR297K&fields=980X614Q738"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"56XK567C"' \
  "http://localhost:8089/search/repositories?q=D24324P189&aq=["Example Missing"]&type=518510LHY&sort=56XK567C&facet=P76614O91&facet_mincount=1&filter=["Example Missing"]&filter_query=GTG829O&exclude=RXGC214&hl=true&root_record=BH386RX&dt=YNR297K&fields=980X614Q738"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"P76614O91"' \
  "http://localhost:8089/search/repositories?q=D24324P189&aq=["Example Missing"]&type=518510LHY&sort=56XK567C&facet=P76614O91&facet_mincount=1&filter=["Example Missing"]&filter_query=GTG829O&exclude=RXGC214&hl=true&root_record=BH386RX&dt=YNR297K&fields=980X614Q738"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"1"' \
  "http://localhost:8089/search/repositories?q=D24324P189&aq=["Example Missing"]&type=518510LHY&sort=56XK567C&facet=P76614O91&facet_mincount=1&filter=["Example Missing"]&filter_query=GTG829O&exclude=RXGC214&hl=true&root_record=BH386RX&dt=YNR297K&fields=980X614Q738"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/search/repositories?q=D24324P189&aq=["Example Missing"]&type=518510LHY&sort=56XK567C&facet=P76614O91&facet_mincount=1&filter=["Example Missing"]&filter_query=GTG829O&exclude=RXGC214&hl=true&root_record=BH386RX&dt=YNR297K&fields=980X614Q738"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"GTG829O"' \
  "http://localhost:8089/search/repositories?q=D24324P189&aq=["Example Missing"]&type=518510LHY&sort=56XK567C&facet=P76614O91&facet_mincount=1&filter=["Example Missing"]&filter_query=GTG829O&exclude=RXGC214&hl=true&root_record=BH386RX&dt=YNR297K&fields=980X614Q738"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"RXGC214"' \
  "http://localhost:8089/search/repositories?q=D24324P189&aq=["Example Missing"]&type=518510LHY&sort=56XK567C&facet=P76614O91&facet_mincount=1&filter=["Example Missing"]&filter_query=GTG829O&exclude=RXGC214&hl=true&root_record=BH386RX&dt=YNR297K&fields=980X614Q738"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"BooleanParam"' \
  "http://localhost:8089/search/repositories?q=D24324P189&aq=["Example Missing"]&type=518510LHY&sort=56XK567C&facet=P76614O91&facet_mincount=1&filter=["Example Missing"]&filter_query=GTG829O&exclude=RXGC214&hl=true&root_record=BH386RX&dt=YNR297K&fields=980X614Q738"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"BH386RX"' \
  "http://localhost:8089/search/repositories?q=D24324P189&aq=["Example Missing"]&type=518510LHY&sort=56XK567C&facet=P76614O91&facet_mincount=1&filter=["Example Missing"]&filter_query=GTG829O&exclude=RXGC214&hl=true&root_record=BH386RX&dt=YNR297K&fields=980X614Q738"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"YNR297K"' \
  "http://localhost:8089/search/repositories?q=D24324P189&aq=["Example Missing"]&type=518510LHY&sort=56XK567C&facet=P76614O91&facet_mincount=1&filter=["Example Missing"]&filter_query=GTG829O&exclude=RXGC214&hl=true&root_record=BH386RX&dt=YNR297K&fields=980X614Q738"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"980X614Q738"' \
  "http://localhost:8089/search/repositories?q=D24324P189&aq=["Example Missing"]&type=518510LHY&sort=56XK567C&facet=P76614O91&facet_mincount=1&filter=["Example Missing"]&filter_query=GTG829O&exclude=RXGC214&hl=true&root_record=BH386RX&dt=YNR297K&fields=980X614Q738"


Endpoint

[:GET, :POST] /search/repositories

Description

Search across repositories.

Parameters

Parameter Description Type Optional?
q A search query string. Uses Lucene 4.0 syntax: http://lucene.apache.org/core/4_0_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html Search index structure can be found in solr/schema.xml String true
aq A json string containing the advanced query JSONModel(:advanced_query) true
type The record type to search (defaults to all types if not specified) [String] true
sort The attribute to sort and the direction e.g. &sort=title desc&… String true
facet The list of the fields to produce facets for [String] true
facet_mincount The minimum count for a facet field to be included in the response Integer true
filter A json string containing the advanced query to filter by JSONModel(:advanced_query) true
filter_query Search queries to be applied as a filter to the results. [String] true
exclude A list of document IDs that should be excluded from results [String] true
hl Whether to use highlighting RESTHelpers::BooleanParam true
root_record Search within a collection of records (defined by the record at the root of the tree) String true
dt Format to return (JSON default) String true
fields The list of fields to include in the results [String] true

Returns

200 –

Search across subjects


curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"226X195670557"' \
  "http://localhost:8089/search/subjects?q=226X195670557&aq=["Example Missing"]&type=WD701NB&sort=PX726JG&facet=JLM647E&facet_mincount=1&filter=["Example Missing"]&filter_query=511G779NF&exclude=USJIJ&hl=true&root_record=SXC543E&dt=I275315ML&fields=Q738454959539"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/search/subjects?q=226X195670557&aq=["Example Missing"]&type=WD701NB&sort=PX726JG&facet=JLM647E&facet_mincount=1&filter=["Example Missing"]&filter_query=511G779NF&exclude=USJIJ&hl=true&root_record=SXC543E&dt=I275315ML&fields=Q738454959539"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"WD701NB"' \
  "http://localhost:8089/search/subjects?q=226X195670557&aq=["Example Missing"]&type=WD701NB&sort=PX726JG&facet=JLM647E&facet_mincount=1&filter=["Example Missing"]&filter_query=511G779NF&exclude=USJIJ&hl=true&root_record=SXC543E&dt=I275315ML&fields=Q738454959539"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"PX726JG"' \
  "http://localhost:8089/search/subjects?q=226X195670557&aq=["Example Missing"]&type=WD701NB&sort=PX726JG&facet=JLM647E&facet_mincount=1&filter=["Example Missing"]&filter_query=511G779NF&exclude=USJIJ&hl=true&root_record=SXC543E&dt=I275315ML&fields=Q738454959539"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"JLM647E"' \
  "http://localhost:8089/search/subjects?q=226X195670557&aq=["Example Missing"]&type=WD701NB&sort=PX726JG&facet=JLM647E&facet_mincount=1&filter=["Example Missing"]&filter_query=511G779NF&exclude=USJIJ&hl=true&root_record=SXC543E&dt=I275315ML&fields=Q738454959539"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"1"' \
  "http://localhost:8089/search/subjects?q=226X195670557&aq=["Example Missing"]&type=WD701NB&sort=PX726JG&facet=JLM647E&facet_mincount=1&filter=["Example Missing"]&filter_query=511G779NF&exclude=USJIJ&hl=true&root_record=SXC543E&dt=I275315ML&fields=Q738454959539"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/search/subjects?q=226X195670557&aq=["Example Missing"]&type=WD701NB&sort=PX726JG&facet=JLM647E&facet_mincount=1&filter=["Example Missing"]&filter_query=511G779NF&exclude=USJIJ&hl=true&root_record=SXC543E&dt=I275315ML&fields=Q738454959539"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"511G779NF"' \
  "http://localhost:8089/search/subjects?q=226X195670557&aq=["Example Missing"]&type=WD701NB&sort=PX726JG&facet=JLM647E&facet_mincount=1&filter=["Example Missing"]&filter_query=511G779NF&exclude=USJIJ&hl=true&root_record=SXC543E&dt=I275315ML&fields=Q738454959539"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"USJIJ"' \
  "http://localhost:8089/search/subjects?q=226X195670557&aq=["Example Missing"]&type=WD701NB&sort=PX726JG&facet=JLM647E&facet_mincount=1&filter=["Example Missing"]&filter_query=511G779NF&exclude=USJIJ&hl=true&root_record=SXC543E&dt=I275315ML&fields=Q738454959539"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"BooleanParam"' \
  "http://localhost:8089/search/subjects?q=226X195670557&aq=["Example Missing"]&type=WD701NB&sort=PX726JG&facet=JLM647E&facet_mincount=1&filter=["Example Missing"]&filter_query=511G779NF&exclude=USJIJ&hl=true&root_record=SXC543E&dt=I275315ML&fields=Q738454959539"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"SXC543E"' \
  "http://localhost:8089/search/subjects?q=226X195670557&aq=["Example Missing"]&type=WD701NB&sort=PX726JG&facet=JLM647E&facet_mincount=1&filter=["Example Missing"]&filter_query=511G779NF&exclude=USJIJ&hl=true&root_record=SXC543E&dt=I275315ML&fields=Q738454959539"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"I275315ML"' \
  "http://localhost:8089/search/subjects?q=226X195670557&aq=["Example Missing"]&type=WD701NB&sort=PX726JG&facet=JLM647E&facet_mincount=1&filter=["Example Missing"]&filter_query=511G779NF&exclude=USJIJ&hl=true&root_record=SXC543E&dt=I275315ML&fields=Q738454959539"

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '"Q738454959539"' \
  "http://localhost:8089/search/subjects?q=226X195670557&aq=["Example Missing"]&type=WD701NB&sort=PX726JG&facet=JLM647E&facet_mincount=1&filter=["Example Missing"]&filter_query=511G779NF&exclude=USJIJ&hl=true&root_record=SXC543E&dt=I275315ML&fields=Q738454959539"


Endpoint

[:GET, :POST] /search/subjects

Description

Search across subjects.

Parameters

Parameter Description Type Optional?
q A search query string. Uses Lucene 4.0 syntax: http://lucene.apache.org/core/4_0_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html Search index structure can be found in solr/schema.xml String true
aq A json string containing the advanced query JSONModel(:advanced_query) true
type The record type to search (defaults to all types if not specified) [String] true
sort The attribute to sort and the direction e.g. &sort=title desc&… String true
facet The list of the fields to produce facets for [String] true
facet_mincount The minimum count for a facet field to be included in the response Integer true
filter A json string containing the advanced query to filter by JSONModel(:advanced_query) true
filter_query Search queries to be applied as a filter to the results. [String] true
exclude A list of document IDs that should be excluded from results [String] true
hl Whether to use highlighting RESTHelpers::BooleanParam true
root_record Search within a collection of records (defined by the record at the root of the tree) String true
dt Format to return (JSON default) String true
fields The list of fields to include in the results [String] true

Returns

200 –

Find the record given the slug, return id, repo_id, and table name

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/slug?slug=slug&controller=controller&action=action"

Endpoint

[:GET] /slug

Description

Find the record given the slug, return id, repo_id, and table name.

Parameters

Parameter Description Type Optional?
s u l
c n o
a t c

Returns

200 –

Get a Location by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/space_calculator/buildings"

Endpoint

[:GET] /space_calculator/buildings

Description

Get a Location by ID.

Returns

200 – Location building data as JSON

Calculate how many containers will fit in locations for a given building

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/space_calculator/by_building?container_profile_uri=960O927S810&building=191R568271C&floor=YY34693L&room=211AFKU&area=RI649MF"

Endpoint

[:GET] /space_calculator/by_building

Description

Calculate how many containers will fit in locations for a given building.

Parameters

Parameter Description Type Optional?
container_profile_uri The uri of the container profile String
building The building to check for space in String
floor The floor to check for space in String true
room The room to check for space in String true
area The area to check for space in String true

Returns

200 – Calculation results

Calculate how many containers will fit in a list of locations

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/space_calculator/by_location?container_profile_uri=17845380NR&location_uris=260882NKD"

Endpoint

[:GET] /space_calculator/by_location

Description

Calculate how many containers will fit in a list of locations.

Parameters

Parameter Description Type Optional?
container_profile_uri The uri of the container profile String
location_uris A list of location uris to calculate space for [String]

Returns

200 – Calculation results

Create a Subject

curl -H "X-ArchivesSpace-Session: $SESSION"       -d '{ "jsonmodel_type":"subject",
"external_ids":[],
"publish":true,
"is_slug_auto":true,
"used_within_repositories":[],
"used_within_published_repositories":[],
"terms":[{ "jsonmodel_type":"term",
"term":"Term 1",
"term_type":"topical",
"vocabulary":"/vocabularies/2"}],
"external_documents":[],
"vocabulary":"/vocabularies/3",
"authority_id":"http://www.example-18.com",
"scope_note":"440FVOO",
"source":"lcsh"}'         "http://localhost:8089/subjects"

from asnake.aspace import ASpace
from asnake.jsonmodel import JM
# create a new subject
# minimum requirements:
# -  at least one Term object, with a term, a valid term_type, and  vocabulary (set to `/vocabularies/1')
# - a defined source (e.g.: ingest, lcsh) and vocabulary (set to `/vocabularies/1')
subj_json = JM.subject(source='ingest', vocabulary='/vocabularies/1' )
term = JM.term(term='Black lives matter movement', term_type='topical',vocabulary='/vocabularies/1' )
subj_json["terms"] = [term]
res = aspace.client.post('/subjects', json=subj_json)
subj_id = None
if res.status_code ==  200:
  subj_id = res.json()["id"]

Endpoint

[:POST] /subjects

Description

Create a Subject.

Accepts Payload of Type

JSONModel(:subject)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

Get a list of Subjects

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/subjects?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/subjects?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/subjects?all_ids=true"

Endpoint

[:GET] /subjects

Description

Get a list of Subjects.

Parameters

Returns

200 – [(:subject)]

Update a Subject

  curl -H "X-ArchivesSpace-Session: $SESSION"         -d '{ "jsonmodel_type":"subject",
"external_ids":[],
"publish":true,
"is_slug_auto":true,
"used_within_repositories":[],
"used_within_published_repositories":[],
"terms":[{ "jsonmodel_type":"term",
"term":"Term 1",
"term_type":"topical",
"vocabulary":"/vocabularies/2"}],
"external_documents":[],
"vocabulary":"/vocabularies/3",
"authority_id":"http://www.example-18.com",
"scope_note":"440FVOO",
"source":"lcsh"}'         "http://localhost:8089/subjects/1"

from asnake.aspace import ASpace
subj = aspace.subjects(1)
# test to be sure that you got something
if subj.__class__.__name__ == 'JSONModelObject':
  json_subj = subj.json()
  json_subj['source'] = 'lcsh'
  json_subj['authority_id'] = 'http://id.loc.gov/authorities/subjects/sh2016001442'  
  res = aspace.client.post(json_subj['uri'], json=json_subj)
  if res.status_code != 200:
    print(f'ERROR: {res.status_code}')

Endpoint

[:POST] /subjects/:id

Description

Update a Subject.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Accepts Payload of Type

JSONModel(:subject)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get a Subject by ID

url -H "X-ArchivesSpace-Session: $SESSION"       "http://localhost:8089/subjects/1"

from asnake.aspace import ASpace
subj = aspace.subjects(1)
# test to be sure that you got something
if subj.__class__.__name__ == 'JSONModelObject':
    json_subj = subj.json()
    print(f'Title: {json_subj["title"]}; Source: {json_subj["source"]}')
    if 'authority_id' in json_subj:
      print(f'Authority ID: {json_subj["authority_id"]}')
    else:
        print('Authority ID not defined')

Endpoint

[:GET] /subjects/:id

Description

Get a Subject by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Returns

200 – (:subject)

Delete a Subject

curl -H "X-ArchivesSpace-Session: $SESSION"       -X DELETE       "http://localhost:8089/subjects/1"  

from asnake.aspace import ASpace
res = aspace.client.delete("http://localhost:8089/subjects/1")

Endpoint

[:DELETE] /subjects/:id

Description

Delete a Subject.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Returns

200 – deleted

Get a list of Terms matching a prefix

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/terms?q=A238D789B"

Endpoint

[:GET] /terms

Description

Get a list of Terms matching a prefix.

Parameters

Parameter Description Type Optional?
q The prefix to match String

Returns

200 – [(:term)]

Get a stream of updated records

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/update-feed?last_sequence=1&resolve[]=[record_types, to_resolve]"

Endpoint

[:GET] /update-feed

Description

Get a stream of updated records.

Parameters

Parameter Description Type Optional?
last_sequence The last sequence number seen Integer true
resolve A list of references to resolve and embed in the response [String] true

Returns

200 – a list of records and sequence numbers

Refresh the list of currently known edits

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '["Example Missing"]' \
  "http://localhost:8089/update_monitor"

Endpoint

[:POST] /update_monitor

Description

Refresh the list of currently known edits.

Accepts Payload of Type

JSONModel(:active_edits)

Returns

200 – A list of records, the user editing it and the lock version for each

Create a local user

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"user",
"groups":[],
"is_active_user":true,
"is_admin":false,
"username":"username_1",
"name":"Name Number 16"}' \
  "http://localhost:8089/users?password=857P2UQ&groups=764B69082K"

Endpoint

[:POST] /users

Description

Create a local user.

Parameters

Parameter Description Type Optional?
password The user’s password String
groups Array of groups URIs to assign the user to [String] true

Accepts Payload of Type

JSONModel(:user)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

400 – {:error => (description of error)}

Get a list of users

# return first 10 records
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/users?page=1&page_size=10"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/users?id_set=1,2,3,5,8"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/users?all_ids=true"

Endpoint

[:GET] /users

Description

Get a list of users.

Parameters

Returns

200 – [(:resource)]

Get a user’s details (including their current permissions)

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/users/1"

Endpoint

[:GET] /users/:id

Description

Get a user’s details (including their current permissions).

Parameters

Parameter Description Type Optional?
id The username id to fetch Integer

Returns

200 – (:user)

Update a user’s account

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"user",
"groups":[],
"is_active_user":true,
"is_admin":false,
"username":"username_1",
"name":"Name Number 16"}' \
  "http://localhost:8089/users/1?password=BKE531J"

Endpoint

[:POST] /users/:id

Description

Update a user’s account.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
password The user’s password String true

Accepts Payload of Type

JSONModel(:user)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Delete a user

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -X DELETE \
  "http://localhost:8089/users/1"

Endpoint

[:DELETE] /users/:id

Description

Delete a user.

Parameters

Parameter Description Type Optional?
id The user to delete Integer

Returns

200 – deleted

Set a user to be activated

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/users/1/activate"

Endpoint

[:GET] /users/:id/activate

Description

Set a user to be activated.

Parameters

Parameter Description Type Optional?
id The username id to fetch Integer

Returns

200 – (:user)

Set a user to be deactivated

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/users/1/deactivate"

Endpoint

[:GET] /users/:id/deactivate

Description

Set a user to be deactivated.

Parameters

Parameter Description Type Optional?
id The username id to fetch Integer

Returns

200 – (:user)

Update a user’s groups

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/users/1/groups?groups=XCBNR&remove_groups=true"

Endpoint

[:POST] /users/:id/groups

Description

Update a user’s groups.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer
groups Array of groups URIs to assign the user to [String] true
remove_groups Remove all groups from the user for the current repo_id if true RESTHelpers::BooleanParam
repo_id The Repository groups to clear Integer

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

400 – {:error => (description of error)}

Become a different user

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/users/1/become-user"

Endpoint

[:POST] /users/:username/become-user

Description

Become a different user.

Parameters

Parameter Description Type Optional?
username The username to become Username

Returns

200 – Accepted

404 – User not found

Log in

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d 'Example Missing' \
  "http://localhost:8089/users/1/login?password=D43596X752&expiring=true"

Endpoint

[:POST] /users/:username/login

Description

Log in.

Parameters

Parameter Description Type Optional?
username Your username Username
password Your password String
expiring If true, the session will expire after 604800000 seconds of inactivity. If false, it will expire after 604800 seconds of inactivity. NOTE: Previously this parameter would cause the created session to last forever, but this generally isn’t what you want. The parameter name is unfortunate, but we’re keeping it for backward-compatibility. RESTHelpers::BooleanParam

Returns

200 – Login accepted

403 – Login failed

Get a list of system users

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/users/complete?query=372TOUD"

Endpoint

[:GET] /users/complete

Description

Get a list of system users.

Parameters

Parameter Description Type Optional?
query A prefix to search for String

Returns

200 – A list of usernames

Get the currently logged in user

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/users/current-user"

Endpoint

[:GET] /users/current-user

Description

Get the currently logged in user.

Returns

200 – (:user)

404 – Not logged in

Get the ArchivesSpace application version

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/version"

Endpoint

[:GET] /version

Description

Get the ArchivesSpace application version.

Returns

200 – ArchivesSpace (version)

Create a Vocabulary

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"vocabulary",
"terms":[],
"name":"Vocabulary 5 - 2021-09-20 19:04:41 -0400",
"ref_id":"vocab_ref_5 - 2021-09-20 19:04:41 -0400"}' \
  "http://localhost:8089/vocabularies"

Endpoint

[:POST] /vocabularies

Description

Create a Vocabulary.

Accepts Payload of Type

JSONModel(:vocabulary)

Returns

200 – {:status => “Created”, :id => (id of created object), :warnings => {(warnings)}}

Get a list of Vocabularies

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/vocabularies?ref_id=KY268932E"

Endpoint

[:GET] /vocabularies

Description

Get a list of Vocabularies.

Parameters

Parameter Description Type Optional?
ref_id An alternate, externally-created ID for the vocabulary String true

Returns

200 – [(:vocabulary)]

Update a Vocabulary

curl -H "X-ArchivesSpace-Session: $SESSION" \
  -d '{ "jsonmodel_type":"vocabulary",
"terms":[],
"name":"Vocabulary 5 - 2021-09-20 19:04:41 -0400",
"ref_id":"vocab_ref_5 - 2021-09-20 19:04:41 -0400"}' \
  "http://localhost:8089/vocabularies/1"

Endpoint

[:POST] /vocabularies/:id

Description

Update a Vocabulary.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Accepts Payload of Type

JSONModel(:vocabulary)

Returns

200 – {:status => “Updated”, :id => (id of updated object)}

Get a Vocabulary by ID

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/vocabularies/1"

Endpoint

[:GET] /vocabularies/:id

Description

Get a Vocabulary by ID.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Returns

200 – OK

Get a list of Terms for a Vocabulary

curl -H "X-ArchivesSpace-Session: $SESSION" \
  "http://localhost:8089/vocabularies/1/terms"

Endpoint

[:GET] /vocabularies/:id/terms

Description

Get a list of Terms for a Vocabulary.

Parameters

Parameter Description Type Optional?
id The ID of the record Integer

Returns

200 – [(:term)]

Routes by URI

An index of routes available in the ArchivesSpace API, alphabetically by URI.

Route Method(s) Description
/agents/corporate_entities POST Create a corporate entity agent
/agents/corporate_entities GET List all corporate entity agents
/agents/corporate_entities/:id POST Update a corporate entity agent
/agents/corporate_entities/:id GET Get a corporate entity by ID
/agents/corporate_entities/:id DELETE Delete a corporate entity agent
/agents/corporate_entities/:id/publish POST Publish a corporate entity agent and all its sub-records
/agents/families POST Create a family agent
/agents/families GET List all family agents
/agents/families/:id POST Update a family agent
/agents/families/:id GET Get a family by ID
/agents/families/:id DELETE Delete an agent family
/agents/families/:id/publish POST Publish a family agent and all its sub-records
/agents/people POST Create a person agent
/agents/people GET List all person agents
/agents/people/:id POST Update a person agent
/agents/people/:id GET Get a person by ID
/agents/people/:id DELETE Delete an agent person
/agents/people/:id/publish POST Publish an agent person and all its sub-records
/agents/software POST Create a software agent
/agents/software GET List all software agents
/agents/software/:id POST Update a software agent
/agents/software/:id GET Get a software agent by ID
/agents/software/:id DELETE Delete a software agent
/agents/software/:id/publish POST Publish a software agent and all its sub-records
/ark*/:naan/:id GET Redirect to resource identified by ARK Name
/batch_delete POST Carry out delete requests against a list of records
/by-external-id GET List records by their external ID(s)
/config/enumeration_values/:enum_val_id GET Get an Enumeration Value
/config/enumeration_values/:enum_val_id POST Update an enumeration value
/config/enumeration_values/:enum_val_id/position POST Update the position of an ennumeration value
/config/enumeration_values/:enum_val_id/suppressed POST Suppress this value
/config/enumerations GET List all defined enumerations
/config/enumerations POST Create an enumeration
/config/enumerations/:enum_id POST Update an enumeration
/config/enumerations/:enum_id GET Get an Enumeration
/config/enumerations/csv GET List all defined enumerations as a csv
/config/enumerations/migration POST Migrate all records from one value to another
/config/enumerations/names/:enum_name GET Get an Enumeration by Name
/container_profiles POST Create a Container_Profile
/container_profiles GET Get a list of Container Profiles
/container_profiles/:id POST Update a Container Profile
/container_profiles/:id GET Get a Container Profile by ID
/container_profiles/:id DELETE Delete an Container Profile
/current_global_preferences GET Get the global Preferences records for the current user.
/date_calculator GET Calculate the dates of an archival object tree
/delete-feed GET Get a stream of deleted records
/extent_calculator GET Calculate the extent of an archival object tree
/job_types GET List all supported job types
/location_profiles POST Create a Location_Profile
/location_profiles GET Get a list of Location Profiles
/location_profiles/:id POST Update a Location Profile
/location_profiles/:id GET Get a Location Profile by ID
/location_profiles/:id DELETE Delete an Location Profile
/locations POST Create a Location
/locations GET Get a list of locations
/locations/:id POST Update a Location
/locations/:id GET Get a Location by ID
/locations/:id DELETE Delete a Location
/locations/batch POST Create a Batch of Locations
/locations/batch_update POST Update a Location
/logout POST Log out the current session
/merge_requests/agent POST Carry out a merge request against Agent records
/merge_requests/agent_detail POST Carry out a detailed merge request against Agent records
/merge_requests/container_profile POST Carry out a merge request against Container Profile records
/merge_requests/digital_object POST Carry out a merge request against Digital_Object records
/merge_requests/resource POST Carry out a merge request against Resource records
/merge_requests/subject POST Carry out a merge request against Subject records
/merge_requests/top_container POST Carry out a merge request against Top Container records
/notifications GET Get a stream of notifications
/permissions GET Get a list of Permissions
/reports GET List all reports
/reports/custom_data GET Get a list of availiable options for custom reports
/reports/static/* GET Get a static asset for a report
/repositories POST Create a Repository
/repositories GET Get a list of Repositories
/repositories/:id POST Update a repository
/repositories/:id GET Get a Repository by ID
/repositories/:repo_id DELETE Delete a Repository
/repositories/:repo_id/accessions POST Create an Accession
/repositories/:repo_id/accessions GET Get a list of Accessions for a Repository
/repositories/:repo_id/accessions/:id POST Update an Accession
/repositories/:repo_id/accessions/:id GET Get an Accession by ID
/repositories/:repo_id/accessions/:id DELETE Delete an Accession
/repositories/:repo_id/accessions/:id/suppressed POST Suppress this record
/repositories/:repo_id/accessions/:id/top_containers GET Get Top Containers linked to an Accession
/repositories/:repo_id/accessions/:id/transfer POST Transfer this record to a different repository
/repositories/:repo_id/agents/corporate_entities/marc21/:id.:fmt/metadata GET Get metadata for an MARC Auth export of a corporate entity
/repositories/:repo_id/agents/corporate_entities/marc21/:id.xml GET Get a MARC Auth representation of a Corporate Entity
/repositories/:repo_id/agents/families/marc21/:id.:fmt/metadata GET Get metadata for an MARC Auth export of a family
/repositories/:repo_id/agents/families/marc21/:id.xml GET Get an MARC Auth representation of a Family
/repositories/:repo_id/agents/people/marc21/:id.:fmt/metadata GET Get metadata for an MARC Auth export of a person
/repositories/:repo_id/agents/people/marc21/:id.xml GET Get an MARC Auth representation of an Person
/repositories/:repo_id/archival_contexts/corporate_entities/:id.:fmt/metadata GET Get metadata for an EAC-CPF export of a corporate entity
/repositories/:repo_id/archival_contexts/corporate_entities/:id.xml GET Get an EAC-CPF representation of a Corporate Entity
/repositories/:repo_id/archival_contexts/families/:id.:fmt/metadata GET Get metadata for an EAC-CPF export of a family
/repositories/:repo_id/archival_contexts/families/:id.xml GET Get an EAC-CPF representation of a Family
/repositories/:repo_id/archival_contexts/people/:id.:fmt/metadata GET Get metadata for an EAC-CPF export of a person
/repositories/:repo_id/archival_contexts/people/:id.xml GET Get an EAC-CPF representation of an Agent
/repositories/:repo_id/archival_contexts/softwares/:id.:fmt/metadata GET Get metadata for an EAC-CPF export of a software
/repositories/:repo_id/archival_contexts/softwares/:id.xml GET Get an EAC-CPF representation of a Software agent
/repositories/:repo_id/archival_objects POST Create an Archival Object
/repositories/:repo_id/archival_objects GET Get a list of Archival Objects for a Repository
/repositories/:repo_id/archival_objects/:id POST Update an Archival Object
/repositories/:repo_id/archival_objects/:id GET Get an Archival Object by ID
/repositories/:repo_id/archival_objects/:id DELETE Delete an Archival Object
/repositories/:repo_id/archival_objects/:id/accept_children POST Move existing Archival Objects to become children of an Archival Object
/repositories/:repo_id/archival_objects/:id/children GET Get the children of an Archival Object
/repositories/:repo_id/archival_objects/:id/children POST Batch create several Archival Objects as children of an existing Archival Object
/repositories/:repo_id/archival_objects/:id/models_in_graph GET Get a list of record types in the graph of an archival object
/repositories/:repo_id/archival_objects/:id/parent POST Set the parent/position of an Archival Object in a tree
/repositories/:repo_id/archival_objects/:id/previous GET Get the previous record in the tree for an Archival Object
/repositories/:repo_id/archival_objects/:id/publish POST Publish an Archival Object and all its sub-records and components
/repositories/:repo_id/archival_objects/:id/suppressed POST Suppress this record
/repositories/:repo_id/archival_objects/:id/unpublish POST Unpublish an Archival Object and all its sub-records and components
/repositories/:repo_id/assessment_attribute_definitions POST Update this repository’s assessment attribute definitions
/repositories/:repo_id/assessment_attribute_definitions GET Get this repository’s assessment attribute definitions
/repositories/:repo_id/assessments POST Create an Assessment
/repositories/:repo_id/assessments GET Get a list of Assessments for a Repository
/repositories/:repo_id/assessments/:id POST Update an Assessment
/repositories/:repo_id/assessments/:id GET Get an Assessment by ID
/repositories/:repo_id/assessments/:id DELETE Delete an Assessment
/repositories/:repo_id/batch_imports POST Import a batch of records
/repositories/:repo_id/classification_terms POST Create a Classification Term
/repositories/:repo_id/classification_terms GET Get a list of Classification Terms for a Repository
/repositories/:repo_id/classification_terms/:id POST Update a Classification Term
/repositories/:repo_id/classification_terms/:id GET Get a Classification Term by ID
/repositories/:repo_id/classification_terms/:id DELETE Delete a Classification Term
/repositories/:repo_id/classification_terms/:id/accept_children POST Move existing Classification Terms to become children of another Classification Term
/repositories/:repo_id/classification_terms/:id/children GET Get the children of a Classification Term
/repositories/:repo_id/classification_terms/:id/parent POST Set the parent/position of a Classification Term in a tree
/repositories/:repo_id/classifications POST Create a Classification
/repositories/:repo_id/classifications GET Get a list of Classifications for a Repository
/repositories/:repo_id/classifications/:id GET Get a Classification
/repositories/:repo_id/classifications/:id POST Update a Classification
/repositories/:repo_id/classifications/:id DELETE Delete a Classification
/repositories/:repo_id/classifications/:id/accept_children POST Move existing Classification Terms to become children of a Classification
/repositories/:repo_id/classifications/:id/tree GET Get a Classification tree
/repositories/:repo_id/classifications/:id/tree/node GET Fetch tree information for an Classification Term record within a tree
/repositories/:repo_id/classifications/:id/tree/node_from_root GET Fetch tree path from the root record to Classification Terms
/repositories/:repo_id/classifications/:id/tree/root GET Fetch tree information for the top-level classification record
/repositories/:repo_id/classifications/:id/tree/waypoint GET Fetch the record slice for a given tree waypoint
/repositories/:repo_id/collection_management/:id GET Get a Collection Management Record by ID
/repositories/:repo_id/component_transfers POST Transfer components from one resource to another
/repositories/:repo_id/current_preferences GET Get the Preferences records for the current repository and user.
/repositories/:repo_id/custom_report_templates POST Create a Custom Report Template
/repositories/:repo_id/custom_report_templates GET Get a list of Custom Report Templates
/repositories/:repo_id/custom_report_templates/:id POST Update a CustomReportTemplate
/repositories/:repo_id/custom_report_templates/:id GET Get a Custom Report Template by ID
/repositories/:repo_id/custom_report_templates/:id DELETE Delete an Custom Report Template
/repositories/:repo_id/default_values/:record_type POST Save defaults for a record type
/repositories/:repo_id/default_values/:record_type GET Get default values for a record type
/repositories/:repo_id/digital_object_components POST Create an Digital Object Component
/repositories/:repo_id/digital_object_components GET Get a list of Digital Object Components for a Repository
/repositories/:repo_id/digital_object_components/:id POST Update an Digital Object Component
/repositories/:repo_id/digital_object_components/:id GET Get an Digital Object Component by ID
/repositories/:repo_id/digital_object_components/:id DELETE Delete a Digital Object Component
/repositories/:repo_id/digital_object_components/:id/accept_children POST Move existing Digital Object Components to become children of a Digital Object Component
/repositories/:repo_id/digital_object_components/:id/children POST Batch create several Digital Object Components as children of an existing Digital Object Component
/repositories/:repo_id/digital_object_components/:id/children GET Get the children of an Digital Object Component
/repositories/:repo_id/digital_object_components/:id/parent POST Set the parent/position of an Digital Object Component in a tree
/repositories/:repo_id/digital_object_components/:id/suppressed POST Suppress this record
/repositories/:repo_id/digital_objects POST Create a Digital Object
/repositories/:repo_id/digital_objects GET Get a list of Digital Objects for a Repository
/repositories/:repo_id/digital_objects/:id GET Get a Digital Object
/repositories/:repo_id/digital_objects/:id POST Update a Digital Object
/repositories/:repo_id/digital_objects/:id DELETE Delete a Digital Object
/repositories/:repo_id/digital_objects/:id/accept_children POST Move existing Digital Object components to become children of a Digital Object
/repositories/:repo_id/digital_objects/:id/children POST Batch create several Digital Object Components as children of an existing Digital Object
/repositories/:repo_id/digital_objects/:id/publish POST Publish a digital object and all its sub-records and components
/repositories/:repo_id/digital_objects/:id/suppressed POST Suppress this record
/repositories/:repo_id/digital_objects/:id/transfer POST Transfer this record to a different repository
/repositories/:repo_id/digital_objects/:id/tree GET Get a Digital Object tree
/repositories/:repo_id/digital_objects/:id/tree/node GET Fetch tree information for an Digital Object Component record within a tree
/repositories/:repo_id/digital_objects/:id/tree/node_from_root GET Fetch tree paths from the root record to Digital Object Components
/repositories/:repo_id/digital_objects/:id/tree/root GET Fetch tree information for the top-level digital object record
/repositories/:repo_id/digital_objects/:id/tree/waypoint GET Fetch the record slice for a given tree waypoint
/repositories/:repo_id/digital_objects/dublin_core/:id.:fmt/metadata GET Get metadata for a Dublin Core export
/repositories/:repo_id/digital_objects/dublin_core/:id.xml GET Get a Dublin Core representation of a Digital Object
/repositories/:repo_id/digital_objects/mets/:id.:fmt/metadata GET Get metadata for a METS export
/repositories/:repo_id/digital_objects/mets/:id.xml GET Get a METS representation of a Digital Object
/repositories/:repo_id/digital_objects/mods/:id.:fmt/metadata GET Get metadata for a MODS export
/repositories/:repo_id/digital_objects/mods/:id.xml GET Get a MODS representation of a Digital Object
/repositories/:repo_id/events POST Create an Event
/repositories/:repo_id/events GET Get a list of Events for a Repository
/repositories/:repo_id/events/:id POST Update an Event
/repositories/:repo_id/events/:id GET Get an Event by ID
/repositories/:repo_id/events/:id DELETE Delete an event record
/repositories/:repo_id/events/:id/suppressed POST Suppress this record from non-managers
/repositories/:repo_id/find_by_id/archival_objects GET Find Archival Objects by ref_id or component_id
/repositories/:repo_id/find_by_id/digital_object_components GET Find Digital Object Components by component_id
/repositories/:repo_id/find_by_id/digital_objects GET Find Digital Objects by digital_object_id
/repositories/:repo_id/find_by_id/resources GET Find Resources by their identifiers
/repositories/:repo_id/groups POST Create a group within a repository
/repositories/:repo_id/groups GET Get a list of groups for a repository
/repositories/:repo_id/groups/:id POST Update a group
/repositories/:repo_id/groups/:id GET Get a group by ID
/repositories/:repo_id/groups/:id DELETE Delete a group by ID
/repositories/:repo_id/jobs POST Create a new job
/repositories/:repo_id/jobs GET Get a list of Jobs for a Repository
/repositories/:repo_id/jobs/:id DELETE Delete a Job
/repositories/:repo_id/jobs/:id GET Get a Job by ID
/repositories/:repo_id/jobs/:id/cancel POST Cancel a Job
/repositories/:repo_id/jobs/:id/log GET Get a Job’s log by ID
/repositories/:repo_id/jobs/:id/output_files GET Get a list of Job’s output files by ID
/repositories/:repo_id/jobs/:id/output_files/:file_id GET Get a Job’s output file by ID
/repositories/:repo_id/jobs/:id/records GET Get a Job’s list of created URIs
/repositories/:repo_id/jobs/active GET Get a list of all active Jobs for a Repository
/repositories/:repo_id/jobs/archived GET Get a list of all archived Jobs for a Repository
/repositories/:repo_id/jobs/import_types GET List all supported import job types
/repositories/:repo_id/jobs_with_files POST Create a new job and post input files
/repositories/:repo_id/preferences POST Create a Preferences record
/repositories/:repo_id/preferences GET Get a list of Preferences for a Repository and optionally a user
/repositories/:repo_id/preferences/:id GET Get a Preferences record
/repositories/:repo_id/preferences/:id POST Update a Preferences record
/repositories/:repo_id/preferences/:id DELETE Delete a Preferences record
/repositories/:repo_id/preferences/defaults GET Get the default set of Preferences for a Repository and optionally a user
/repositories/:repo_id/rde_templates POST Create an RDE template
/repositories/:repo_id/rde_templates GET Get a list of RDE Templates
/repositories/:repo_id/rde_templates/:id GET Get an RDE template record
/repositories/:repo_id/rde_templates/:id DELETE Delete an RDE Template
/repositories/:repo_id/required_fields/:record_type POST Require fields for a record type
/repositories/:repo_id/required_fields/:record_type GET Get required fields for a record type
/repositories/:repo_id/resource_descriptions/:id.:fmt/metadata GET Get export metadata for a Resource Description
/repositories/:repo_id/resource_descriptions/:id.pdf GET Get a PDF representation of a Resource
/repositories/:repo_id/resource_descriptions/:id.xml GET Get an EAD representation of a Resource
/repositories/:repo_id/resource_labels/:id.:fmt/metadata GET Get export metadata for Resource labels
/repositories/:repo_id/resource_labels/:id.tsv GET Get a tsv list of printable labels for a Resource
/repositories/:repo_id/resources POST Create a Resource
/repositories/:repo_id/resources GET Get a list of Resources for a Repository
/repositories/:repo_id/resources/:id GET Get a Resource
/repositories/:repo_id/resources/:id POST Update a Resource
/repositories/:repo_id/resources/:id DELETE Delete a Resource
/repositories/:repo_id/resources/:id/accept_children POST Move existing Archival Objects to become children of a Resource
/repositories/:repo_id/resources/:id/children POST Batch create several Archival Objects as children of an existing Resource
/repositories/:repo_id/resources/:id/models_in_graph GET Get a list of record types in the graph of a resource
/repositories/:repo_id/resources/:id/ordered_records GET Get the list of URIs of this published resource and all published archival objects contained within.Ordered by tree order (i.e. if you fully expanded the record tree and read from top to bottom)
/repositories/:repo_id/resources/:id/publish POST Publish a resource and all its sub-records and components
/repositories/:repo_id/resources/:id/suppressed POST Suppress this record
/repositories/:repo_id/resources/:id/templates/top_container_creation.csv GET Get a CSV template useful for bulk-creating containers for archival objects of a resource
/repositories/:repo_id/resources/:id/top_containers GET Get Top Containers linked to a published resource and published archival ojbects contained within.
/repositories/:repo_id/resources/:id/transfer POST Transfer this record to a different repository
/repositories/:repo_id/resources/:id/tree GET Get a Resource tree
/repositories/:repo_id/resources/:id/tree/node GET Fetch tree information for an Archival Object record within a tree
/repositories/:repo_id/resources/:id/tree/node_from_root GET Fetch tree paths from the root record to Archival Objects
/repositories/:repo_id/resources/:id/tree/root GET Fetch tree information for the top-level resource record
/repositories/:repo_id/resources/:id/tree/waypoint GET Fetch the record slice for a given tree waypoint
/repositories/:repo_id/resources/:id/unpublish POST Unpublish a resource and all its sub-records and components
/repositories/:repo_id/resources/marc21/:id.:fmt/metadata GET Get metadata for a MARC21 export
/repositories/:repo_id/resources/marc21/:id.xml GET Get a MARC 21 representation of a Resource
/repositories/:repo_id/search GET, POST Search this repository
/repositories/:repo_id/top_containers POST Create a top container
/repositories/:repo_id/top_containers GET Get a list of TopContainers for a Repository
/repositories/:repo_id/top_containers/:id POST Update a top container
/repositories/:repo_id/top_containers/:id GET Get a top container by ID
/repositories/:repo_id/top_containers/:id DELETE Delete a top container
/repositories/:repo_id/top_containers/batch/container_profile POST Update container profile for a batch of top containers
/repositories/:repo_id/top_containers/batch/ils_holding_id POST Update ils_holding_id for a batch of top containers
/repositories/:repo_id/top_containers/batch/location POST Update location for a batch of top containers
/repositories/:repo_id/top_containers/bulk/barcodes POST Bulk update barcodes
/repositories/:repo_id/top_containers/bulk/locations POST Bulk update locations
/repositories/:repo_id/top_containers/search GET Search for top containers
/repositories/:repo_id/transfer POST Transfer this record to a different repository
/repositories/:repo_id/users/:id GET Get a user’s details including their groups for the current repository
/repositories/with_agent POST Create a Repository with an agent representation
/repositories/with_agent/:id GET Get a Repository by ID, including its agent representation
/repositories/with_agent/:id POST Update a repository with an agent representation
/schemas GET Get all ArchivesSpace schemas
/schemas/:schema GET Get an ArchivesSpace schema
/search GET, POST Search this archive
/search/location_profile GET Search across Location Profiles
/search/published_tree GET Find the tree view for a particular archival record
/search/record_types_by_repository GET, POST Return the counts of record types of interest by repository
/search/records GET, POST Return a set of records by URI
/search/repositories GET, POST Search across repositories
/search/subjects GET, POST Search across subjects
/slug GET Find the record given the slug, return id, repo_id, and table name
/space_calculator/buildings GET Get a Location by ID
/space_calculator/by_building GET Calculate how many containers will fit in locations for a given building
/space_calculator/by_location GET Calculate how many containers will fit in a list of locations
/subjects POST Create a Subject
/subjects GET Get a list of Subjects
/subjects/:id POST Update a Subject
/subjects/:id GET Get a Subject by ID
/subjects/:id DELETE Delete a Subject
/terms GET Get a list of Terms matching a prefix
/update-feed GET Get a stream of updated records
/update_monitor POST Refresh the list of currently known edits
/users POST Create a local user
/users GET Get a list of users
/users/:id GET Get a user’s details (including their current permissions)
/users/:id POST Update a user’s account
/users/:id DELETE Delete a user
/users/:id/activate GET Set a user to be activated
/users/:id/deactivate GET Set a user to be deactivated
/users/:id/groups POST Update a user’s groups
/users/:username/become-user POST Become a different user
/users/:username/login POST Log in
/users/complete GET Get a list of system users
/users/current-user GET Get the currently logged in user
/version GET Get the ArchivesSpace application version
/vocabularies POST Create a Vocabulary
/vocabularies GET Get a list of Vocabularies
/vocabularies/:id POST Update a Vocabulary
/vocabularies/:id GET Get a Vocabulary by ID
/vocabularies/:id/terms GET Get a list of Terms for a Vocabulary

Errors

The ArchivesSpace API uses the following error codes:

Error Code Meaning
400 Bad Request – Your request sucks
401 Unauthorized – Your session key is wrong
403 Forbidden – The record requested is hidden for administrators only
404 Not Found – The endpoint could not be found
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarially offline for maintanance. Please try again later.