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.
This documentation refers to ArchivesSpace 4.0.0
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": 147,
"username": "admin",
"name": "Administrator",
"source": "DBAuth",
"is_system_user": true,
"create_time": "2016-08-22T18:48:50Z",
"system_mtime": "2024-11-23T15:28:19Z",
"user_mtime": "2024-11-23T15:28:19Z",
"is_active_user": true,
"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",
"update_container_profile_record",
"update_location_profile_record",
"update_enumeration_record",
"administer_system",
"manage_users",
"become_user",
"view_all_records",
"create_repository",
"delete_repository",
"transfer_repository",
"index_system",
"manage_repository",
"update_accession_record",
"update_resource_record",
"update_digital_object_record",
"update_event_record",
"delete_event_record",
"suppress_archival_record",
"transfer_archival_record",
"delete_archival_record",
"view_suppressed",
"view_repository",
"update_classification_record",
"delete_classification_record",
"mediate_edits",
"import_records",
"cancel_importer_job",
"manage_subject_record",
"manage_agent_record",
"manage_vocabulary_record",
"merge_agents_and_subjects",
"merge_archival_record",
"manage_rde_templates",
"update_container_record",
"manage_container_record",
"manage_container_profile_record",
"manage_location_profile_record",
"create_job",
"cancel_job",
"manage_enumeration_record",
"update_assessment_record",
"delete_assessment_record",
"manage_assessment_attributes",
"view_agent_contact_record",
"manage_custom_report_templates"
],
"_archivesspace": [
"administer_system",
"manage_users",
"become_user",
"view_all_records",
"create_repository",
"delete_repository",
"transfer_repository",
"index_system",
"manage_repository",
"update_accession_record",
"update_resource_record",
"update_digital_object_record",
"update_event_record",
"delete_event_record",
"suppress_archival_record",
"transfer_archival_record",
"delete_archival_record",
"view_suppressed",
"view_repository",
"update_classification_record",
"delete_classification_record",
"mediate_edits",
"import_records",
"cancel_importer_job",
"manage_subject_record",
"manage_agent_record",
"manage_vocabulary_record",
"merge_agents_and_subjects",
"merge_archival_record",
"manage_rde_templates",
"update_container_record",
"manage_container_record",
"manage_container_profile_record",
"manage_location_profile_record",
"create_job",
"cancel_job",
"manage_enumeration_record",
"update_assessment_record",
"delete_assessment_record",
"manage_assessment_attributes",
"view_agent_contact_record",
"manage_custom_report_templates",
"edit_user_self",
"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",
"update_container_profile_record",
"update_location_profile_record",
"update_enumeration_record"
]
}
}
}```
> It's a good idea to save the session key since this will be used for later requests:
```shell
# 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:
- paged access to objects (via :page)
- listing all matching ids (via :all_ids)
- fetching specific known objects via their database ids (via :id_set)
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 this archive
- Search across repositories
- Search this repository
- Search across subjects
- Search for top containers
- Search across location profiles
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:
- both SOLR documents and JSONModel Objects are expressed in JSON
- in general, documents will always contain some subset of the JSONModel object they represent
But they also differ in quite a few important ways:
- SOLR documents don't necessarily have all fields from a JSONModel object
- SOLR documents do not automatically contain nested JSONModel Objects
- SOLR documents can have fields defined that are arbitrary "search representations" of fields in associated records, or combinations of fields in a record
- SOLR documents don't have a
jsonmodel_type
field - thejsonmodel_type
of the record is stored asprimary_type
in SOLR
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 2024-12-02 17:45:35.58389 +0200 the following REST endpoints exist in the master branch of the development repository:
Create a corporate entity agent
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/corporate_entities" \
-d '{
"jsonmodel_type": "agent_corporate_entity",
"agent_contacts": [
{
"jsonmodel_type": "agent_contact",
"telephones": [
{
"jsonmodel_type": "telephone",
"number_type": "cell",
"number": "87078 33242 614",
"ext": "GNVE591"
}
],
"notes": [
{
"jsonmodel_type": "note_contact_note",
"date_of_contact": "980884775I120",
"contact_notes": "89786540HD"
}
],
"is_representative": false,
"name": "Name Number 5",
"address_2": "XL561312825",
"address_3": "48136M348M",
"country": "XF988UM",
"email": "PYJCQ"
}
],
"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"
}
],
"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": "none",
"primary_name": "Name Number 4",
"subordinate_name_1": "M657588XX",
"subordinate_name_2": "MSM504J",
"number": "AQFGI",
"sort_name": "SORT e - 3",
"qualifier": "AY806937C",
"dates": "HDT999J",
"authority_id": "http://www.example-9-1733154332.com",
"source": "naf"
}
],
"agent_type": "agent_corporate_entity"
}'
Endpoint
[:POST] /agents/corporate_entities
Description
Create a corporate entity agent.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_agent_record
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"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/corporate_entities?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/corporate_entities?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /agents/corporate_entities
Description
List all corporate entity agents.
Permissions
This endpoint does not require authentication.
Parameters
Returns
200 -- [(:agent_corporate_entity)]
Update a corporate entity agent
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/corporate_entities/1" \
-d '{
"jsonmodel_type": "agent_corporate_entity",
"agent_contacts": [
{
"jsonmodel_type": "agent_contact",
"telephones": [
{
"jsonmodel_type": "telephone",
"number_type": "cell",
"number": "87078 33242 614",
"ext": "GNVE591"
}
],
"notes": [
{
"jsonmodel_type": "note_contact_note",
"date_of_contact": "980884775I120",
"contact_notes": "89786540HD"
}
],
"is_representative": false,
"name": "Name Number 5",
"address_2": "XL561312825",
"address_3": "48136M348M",
"country": "XF988UM",
"email": "PYJCQ"
}
],
"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"
}
],
"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": "none",
"primary_name": "Name Number 4",
"subordinate_name_1": "M657588XX",
"subordinate_name_2": "MSM504J",
"number": "AQFGI",
"sort_name": "SORT e - 3",
"qualifier": "AY806937C",
"dates": "HDT999J",
"authority_id": "http://www.example-9-1733154332.com",
"source": "naf"
}
],
"agent_type": "agent_corporate_entity"
}'
Endpoint
[:POST] /agents/corporate_entities/:id
Description
Update a corporate entity agent.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_agent_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/corporate_entities/1?resolve%5B%5D="
Endpoint
[:GET] /agents/corporate_entities/:id
Description
Get a corporate entity by ID.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_agent_record
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" \
-X POST \
"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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_agent_record
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/families" \
-d '{
"jsonmodel_type": "agent_family",
"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"
}
],
"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": "none",
"family_name": "Name Number 2",
"sort_name": "SORT a - 1",
"dates": "V325C197901",
"qualifier": "EVX316K",
"prefix": "497HNBI",
"authority_id": "http://www.example-3-1733154331.com",
"source": "lcsh"
}
],
"agent_type": "agent_family"
}'
Endpoint
[:POST] /agents/families
Description
Create a family agent.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_agent_record
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"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/families?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/families?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /agents/families
Description
List all family agents.
Permissions
This endpoint does not require authentication.
Parameters
Returns
200 -- [(:agent_family)]
Update a family agent
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/families/1" \
-d '{
"jsonmodel_type": "agent_family",
"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"
}
],
"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": "none",
"family_name": "Name Number 2",
"sort_name": "SORT a - 1",
"dates": "V325C197901",
"qualifier": "EVX316K",
"prefix": "497HNBI",
"authority_id": "http://www.example-3-1733154331.com",
"source": "lcsh"
}
],
"agent_type": "agent_family"
}'
Endpoint
[:POST] /agents/families/:id
Description
Update a family agent.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_agent_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/families/1?resolve%5B%5D="
Endpoint
[:GET] /agents/families/:id
Description
Get a family by ID.
Permissions
This endpoint does not require authentication.
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_family)
404 -- Not found
Delete an agent family
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/agents/families/1"
Endpoint
[:DELETE] /agents/families/:id
Description
Delete an agent family.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_agent_record
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" "http://localhost:8089/agents/families/1/publish"
Endpoint
[:POST] /agents/families/:id/publish
Description
Publish a family agent and all its sub-records.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_agent_record
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/people" \
-d '{
"jsonmodel_type": "agent_person",
"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"
}
],
"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": "rda",
"source": "lcsh",
"primary_name": "Name Number 29",
"sort_name": "SORT q - 21",
"name_order": "inverted",
"number": "VRIG742",
"dates": "35R43AS",
"qualifier": "JVXLS",
"fuller_form": "RIEQT",
"prefix": "HC635704I",
"title": "E976GY92",
"suffix": "417K217YF",
"rest_of_name": "KQT845143",
"authority_id": "http://www.example-51-1733154334.com"
}
],
"agent_type": "agent_person"
}'
Endpoint
[:POST] /agents/people
Description
Create a person agent.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_agent_record
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"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/people?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/people?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /agents/people
Description
List all person agents.
Permissions
This endpoint does not require authentication.
Parameters
Returns
200 -- [(:agent_person)]
Update a person agent
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/people/1" \
-d '{
"jsonmodel_type": "agent_person",
"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"
}
],
"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": "rda",
"source": "lcsh",
"primary_name": "Name Number 29",
"sort_name": "SORT q - 21",
"name_order": "inverted",
"number": "VRIG742",
"dates": "35R43AS",
"qualifier": "JVXLS",
"fuller_form": "RIEQT",
"prefix": "HC635704I",
"title": "E976GY92",
"suffix": "417K217YF",
"rest_of_name": "KQT845143",
"authority_id": "http://www.example-51-1733154334.com"
}
],
"agent_type": "agent_person"
}'
Endpoint
[:POST] /agents/people/:id
Description
Update a person agent.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_agent_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/people/1?resolve%5B%5D="
Endpoint
[:GET] /agents/people/:id
Description
Get a person by ID.
Permissions
This endpoint does not require authentication.
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_person)
404 -- Not found
Delete an agent person
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/agents/people/1"
Endpoint
[:DELETE] /agents/people/:id
Description
Delete an agent person.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_agent_record
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" "http://localhost:8089/agents/people/1/publish"
Endpoint
[:POST] /agents/people/:id/publish
Description
Publish an agent person and all its sub-records.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_agent_record
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/software" \
-d '{
"jsonmodel_type": "agent_software",
"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"
}
],
"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": "aacr",
"source": "snac",
"software_name": "Name Number 26",
"sort_name": "SORT f - 19",
"qualifier": "Y969XVP",
"dates": "397V143374A",
"authority_id": "http://www.example-49-1733154334.com"
}
],
"agent_type": "agent_software"
}'
Endpoint
[:POST] /agents/software
Description
Create a software agent.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_agent_record
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"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/software?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/software?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /agents/software
Description
List all software agents.
Permissions
This endpoint does not require authentication.
Parameters
Returns
200 -- [(:agent_software)]
Update a software agent
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/software/1" \
-d '{
"jsonmodel_type": "agent_software",
"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"
}
],
"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": "aacr",
"source": "snac",
"software_name": "Name Number 26",
"sort_name": "SORT f - 19",
"qualifier": "Y969XVP",
"dates": "397V143374A",
"authority_id": "http://www.example-49-1733154334.com"
}
],
"agent_type": "agent_software"
}'
Endpoint
[:POST] /agents/software/:id
Description
Update a software agent.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_agent_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/agents/software/1?resolve%5B%5D="
Endpoint
[:GET] /agents/software/:id
Description
Get a software agent by ID.
Permissions
This endpoint does not require authentication.
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_software)
404 -- Not found
Delete a software agent
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/agents/software/1"
Endpoint
[:DELETE] /agents/software/:id
Description
Delete a software agent.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_agent_record
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" "http://localhost:8089/agents/software/1/publish"
Endpoint
[:POST] /agents/software/:id/publish
Description
Publish a software agent and all its sub-records.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_agent_record
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)}
Carry out delete requests against a list of records
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/batch_delete"
Endpoint
[:POST] /batch_delete
Description
Carry out delete requests against a list of records.
Permissions
This endpoint does not require authentication.
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
record_uris |
A list of record uris | [String] |
Returns
200 -- deleted
Return XLSX
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/bulk_archival_object_updater/repositories/1/generate_spreadsheet" \
-d '{
"min_subrecords": "1",
"extra_subrecords": "1",
"min_notes": "1"
}'
Endpoint
[:POST] /bulk_archival_object_updater/repositories/:repo_id/generate_spreadsheet
Description
Return XLSX.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
repo_id |
The Repository ID
Note: The Repository must exist |
Integer | |
uri |
The uris of the records to include in the report | [String] | |
min_subrecords |
The minimum number of subrecords to include | Integer | |
extra_subrecords |
The number of extra subrecords to include | Integer | |
min_notes |
The minimum number of note subrecords to include | Integer | |
resource_uri |
The resource URI | String | |
selected_columns |
The set of columns to include | [String] | true |
Returns
200 -- spreadsheet
Generate the archival object tree for a resource
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/bulk_archival_object_updater/repositories/1/resources/1/small_tree"
Endpoint
[:GET] /bulk_archival_object_updater/repositories/:repo_id/resources/:id/small_tree
Description
Generate the archival object tree for a resource.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
repo_id |
The Repository ID
Note: The Repository must exist |
Integer | |
id |
The ID of the record | Integer |
Returns
200 --
List records by their external ID(s)
curl -s -F password="admin" "http://localhost:8089/users/admin/login"
# Replace "admin" with your password and "http://localhost:8089/users/admin/login" with your ASpace API URL
# followed by "/users/{your_username}/login"
set SESSION="session_id"
# If using Git Bash, replace set with export
curl -H "X-ArchivesSpace-Session: $SESSION" "http://localhost:8089/by-external-id?eid='3854'&type[]=resource"
# Replace "http://localhost:8089" with your ASpace API URL, '3854' with the external id you are searching for,
# and type[]=resource with the type of record you want to search for (optional)
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
find_eid = client.get("by-external-id", params={"eid": "3854", "type[]": "resource"})
# Replace "3854" with the external id and "resource" with the type of record(s) you want to search - this is
# optional
print(find_eid.json())
# Output (dict): the JSON for the record returned. Other outputs include:
# 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
Endpoint
[:GET] /by-external-id
Description
List records by their external ID(s).
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_all_records
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
# auto-generated example
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.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/config/enumeration_values/1" \
-d '{
"jsonmodel_type": "enumeration_value",
"value": "302T152372C",
"position": 15
}'
Endpoint
[:POST] /config/enumeration_values/:enum_val_id
Description
Update an enumeration value.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_enumeration_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/config/enumeration_values/1/position"
Endpoint
[:POST] /config/enumeration_values/:enum_val_id/position
Description
Update the position of an ennumeration value.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_enumeration_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/config/enumeration_values/1/suppressed"
Endpoint
[:POST] /config/enumeration_values/:enum_val_id/suppressed
Description
Suppress this value.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_enumeration_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/config/enumerations"
Endpoint
[:GET] /config/enumerations
Description
List all defined enumerations.
Permissions
This endpoint does not require authentication.
Returns
200 -- [(:enumeration)]
Create an enumeration
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/config/enumerations" \
-d '{
"jsonmodel_type": "enumeration",
"relationships": [
"X454GOC"
],
"enumeration_values": [
{
"jsonmodel_type": "enumeration_value",
"value": "HUYNX",
"position": 42
}
],
"values": [
"G387374Q996"
],
"name": "JPL176478"
}'
Endpoint
[:POST] /config/enumerations
Description
Create an enumeration.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_enumeration_record
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/config/enumerations/1" \
-d '{
"jsonmodel_type": "enumeration",
"relationships": [
"X454GOC"
],
"enumeration_values": [
{
"jsonmodel_type": "enumeration_value",
"value": "HUYNX",
"position": 42
}
],
"values": [
"G387374Q996"
],
"name": "JPL176478"
}'
Endpoint
[:POST] /config/enumerations/:enum_id
Description
Update an enumeration.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_enumeration_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/config/enumerations/1"
Endpoint
[:GET] /config/enumerations/:enum_id
Description
Get an Enumeration.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
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.
Permissions
This endpoint does not require authentication.
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_enumeration_record
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/date_type"
Endpoint
[:GET] /config/enumerations/names/:enum_name
Description
Get an Enumeration by Name.
Permissions
This endpoint does not require authentication.
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
enum_name |
The name of the enumeration to retrieve | String |
Returns
200 -- (:enumeration)
Create a Container_Profile
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/container_profiles" \
-d '{
"jsonmodel_type": "container_profile",
"name": "N57B596U",
"url": "G856261847Y",
"dimension_units": "meters",
"extent_dimension": "depth",
"depth": "84",
"height": "42",
"width": "82"
}'
Endpoint
[:POST] /container_profiles
Description
Create a Container_Profile.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_container_profile_record
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"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/container_profiles?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/container_profiles?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /container_profiles
Description
Get a list of Container Profiles.
Permissions
This endpoint does not require authentication.
Parameters
Returns
200 -- [(:container_profile)]
Update a Container Profile
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/container_profiles/1" \
-d '{
"jsonmodel_type": "container_profile",
"name": "N57B596U",
"url": "G856261847Y",
"dimension_units": "meters",
"extent_dimension": "depth",
"depth": "84",
"height": "42",
"width": "82"
}'
Endpoint
[:POST] /container_profiles/:id
Description
Update a Container Profile.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_container_profile_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/container_profiles/1?resolve%5B%5D="
Endpoint
[:GET] /container_profiles/:id
Description
Get a Container Profile by ID.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/container_profiles/1"
Endpoint
[:DELETE] /container_profiles/:id
Description
Delete an Container Profile.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_container_profile_record
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
id |
The ID of the record | Integer |
Returns
200 -- deleted
Get the global Preferences records for the current user.
# auto-generated example
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..
Permissions
This endpoint does not require authentication.
Returns
200 -- {(:preference)}
Calculate the dates of an archival object tree
curl -s -F password="admin" "http://localhost:8089/users/admin/login"
# Replace "admin" with your password and "http://localhost:8089/users/admin/login" with your ASpace API URL
# followed by "/users/{your_username}/login"
set SESSION="session_id"
# If using Git Bash, replace set with export
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/date_calculator?record_uri=/repositories/4/archival_objects/336361"
# Replace "http://localhost:8089" with your ASpace API URL and /repositories/4/archival_objects/336361 with the
# URI of the archival object
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
calc_dates = client.get("date_calculator", params={"record_uri": "/repositories/4/archival_objects/336361"})
# Replace "/repositories/4/archival_objects/336361" with the archival object URI
print(calc_dates.json())
# Output (dict): {'object':
# {'uri': '/repositories/4/archival_objects/336361',
# 'jsonmodel_type': 'archival_object',
# 'title': 'Barrow, Middleton Pope. Papers',
# 'id': 336361},
# 'resource':
# {'uri': '/repositories/4/resources/1820',
# 'title': 'E. Merton Coulter manuscript collection II'},
# 'label': None,
# 'min_begin_date': '1839-01-01',
# 'min_begin': '1839',
# 'max_end_date': '1903-12-31',
# 'max_end': '1903'}
Endpoint
[:GET] /date_calculator
Description
Calculate the dates of an archival object tree.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/delete-feed"
Endpoint
[:GET] /delete-feed
Description
Get a stream of deleted records.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- index_system
Parameters
Returns
200 -- a list of URIs that were deleted
Calculate the extent of an archival object tree. Allowed units include: inches, feet, centimeters,
meters.
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/extent_calculator?record_uri=&unit="
Endpoint
[:GET] /extent_calculator
Description
Calculate the extent of an archival object tree. Allowed units include: inches, feet, centimeters, meters..
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/job_types"
Endpoint
[:GET] /job_types
Description
List all supported job types.
Permissions
This endpoint does not require authentication.
Returns
200 -- A list of supported job types
Create a Location_Profile
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/location_profiles" \
-d '{
"jsonmodel_type": "location_profile",
"name": "HSDR900",
"dimension_units": "yards",
"depth": "28",
"height": "44",
"width": "21"
}'
Endpoint
[:POST] /location_profiles
Description
Create a Location_Profile.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_location_profile_record
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"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/location_profiles?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/location_profiles?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /location_profiles
Description
Get a list of Location Profiles.
Permissions
This endpoint does not require authentication.
Parameters
Returns
200 -- [(:location_profile)]
Update a Location Profile
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/location_profiles/1" \
-d '{
"jsonmodel_type": "location_profile",
"name": "HSDR900",
"dimension_units": "yards",
"depth": "28",
"height": "44",
"width": "21"
}'
Endpoint
[:POST] /location_profiles/:id
Description
Update a Location Profile.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_location_profile_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/location_profiles/1?resolve%5B%5D="
Endpoint
[:GET] /location_profiles/:id
Description
Get a Location Profile by ID.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/location_profiles/1"
Endpoint
[:DELETE] /location_profiles/:id
Description
Delete an Location Profile.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_location_profile_record
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
id |
The ID of the record | Integer |
Returns
200 -- deleted
Create a Location
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/locations" \
-d '{
"jsonmodel_type": "location",
"building": "183 W 7th Street",
"floor": "8",
"room": "18",
"area": "Back",
"barcode": "11110001001101111001",
"temporary": "exhibit"
}'
Endpoint
[:POST] /locations
Description
Create a Location.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_location_record
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"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/locations?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/locations?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /locations
Description
Get a list of locations.
Permissions
This endpoint does not require authentication.
Parameters
Returns
200 -- [(:location)]
Update a Location
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/locations/1" \
-d '{
"jsonmodel_type": "location",
"building": "183 W 7th Street",
"floor": "8",
"room": "18",
"area": "Back",
"barcode": "11110001001101111001",
"temporary": "exhibit"
}'
Endpoint
[:POST] /locations/:id
Description
Update a Location.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_location_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/locations/1?resolve%5B%5D=location_profile&resolve%5B%5D=owner_repo&resolve%5B%5D=repository"
Endpoint
[:GET] /locations/:id
Description
Get a Location by ID.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/locations/1"
Endpoint
[:DELETE] /locations/:id
Description
Delete a Location.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_location_record
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
id |
The ID of the record | Integer |
Returns
200 -- deleted
Create a Batch of Locations
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/locations/batch" \
-d '{
"dry_run": "BooleanParam",
"jsonmodel_type": "location_batch",
"locations": [
"/locations/99",
"/locations/99"
],
"building": "330GNLO",
"coordinate_1_range": {
"label": "Range",
"start": "1",
"end": "10"
},
"coordinate_2_range": {
"label": "Section",
"start": "A",
"end": "M"
},
"coordinate_3_range": {
"label": "Shelf",
"start": "1",
"end": "7"
}
}'
Endpoint
[:POST] /locations/batch
Description
Create a Batch of Locations.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_location_record
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/locations/batch_update" \
-d '{
"jsonmodel_type": "location_batch_update",
"record_uris": [
"/locations/99",
"/locations/99"
],
"building": "C624XRD"
}'
Endpoint
[:POST] /locations/batch_update
Description
Update a Location.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_location_record
Accepts Payload of Type
JSONModel(:location_batch_update)
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
Log out the current session
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/logout"
Endpoint
[:POST] /logout
Description
Log out the current session.
Permissions
This endpoint does not require authentication.
Returns
200 -- Session logged out
Carry out a merge request against Agent records
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/merge_requests/agent" \
-d '{
"jsonmodel_type": "merge_request",
"victims": [
{
"ref": "/subjects/99"
},
{
"ref": "/subjects/99"
}
],
"target": {
"ref": "/subjects/99"
}
}'
Endpoint
[:POST] /merge_requests/agent
Description
Carry out a merge request against Agent records.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- merge_agent_record
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- merge_agent_record
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_container_profile_record
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/merge_requests/digital_object" \
-d '{
"repo_id": "1",
"jsonmodel_type": "merge_request",
"victims": [
{
"ref": "/subjects/99"
},
{
"ref": "/subjects/99"
}
],
"target": {
"ref": "/subjects/99"
}
}'
Endpoint
[:POST] /merge_requests/digital_object
Description
Carry out a merge request against Digital_Object records.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- merge_archival_record
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/merge_requests/resource" \
-d '{
"repo_id": "1",
"jsonmodel_type": "merge_request",
"victims": [
{
"ref": "/subjects/99"
},
{
"ref": "/subjects/99"
}
],
"target": {
"ref": "/subjects/99"
}
}'
Endpoint
[:POST] /merge_requests/resource
Description
Carry out a merge request against Resource records.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- merge_archival_record
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 'Content-Type: application/json' \
-H "X-ArchivesSpace-Session: $SESSION" \
-d '{"uri": "merge_requests/subject", "target": {"ref": "/subjects/1"}, "victims": [{"ref": "/subjects/2"}]}' \
"http://localhost:8089/merge_requests/subject"
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
updated_json = {'uri': 'merge_requests/subject',
'target': {'ref': subject_merge_into},
'victims': [{'ref': subject_uri_to_merge}]}
# replace subject_merge_into for the URI of the subject you want to merge into and subject_uri_to_merge with the
# URI of the subject you want merged, i.e. subject_uri_to_merge >> subject_merge_into
merge_response = client.post('merge_requests/subject', json=updated_json)
# capture the response of the merge request
print(merge_response.json()) # For error handling, you can print the response of the merge request
Endpoint
[:POST] /merge_requests/subject
Description
Carry out a merge request against Subject records.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- merge_subject_record
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_container_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/notifications?last_sequence=1"
Endpoint
[:GET] /notifications
Description
Get a stream of notifications.
Permissions
This endpoint does not require authentication.
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
last_sequence |
The last sequence number seen | Integer | true |
Returns
200 -- a list of notifications
Handle an OAI request
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/oai?verb=&metadataPrefix=&from=&until=&resumptionToken=&set=&identifier="
Endpoint
[:GET] /oai
Description
Handle an OAI request.
Permissions
This endpoint does not require authentication.
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
verb |
The OAI verb (Identify, ListRecords, GetRecord, etc.) | String | |
metadataPrefix |
One of the supported metadata types. See verb=ListMetadataFormats for a list. | String | true |
from |
Start date (yyyy-mm-dd, yyyy-mm-ddThh:mm:ssZ) | String | true |
until |
End date (yyyy-mm-dd, yyyy-mm-ddThh:mm:ssZ) | String | true |
resumptionToken |
The OAI resumption token | String | true |
set |
Requested OAI set (see ?verb=Identify for available sets) | String | true |
identifier |
The requested record identifier (for ?verb=GetRecord) | String | true |
Returns
200 -- OAI response
Get the OAI Config record
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/oai_config"
Endpoint
[:GET] /oai_config
Description
Get the OAI Config record.
Permissions
This endpoint does not require authentication.
Returns
200 -- [(:oai_config)]
Update the OAI config record
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/oai_config" \
-d '{
"jsonmodel_type": "oai_config",
"oai_record_prefix": "archivesspace:oai",
"oai_admin_email": "oairecord@example.org",
"oai_repository_name": "ArchivesSpace OAI Repo"
}'
Endpoint
[:POST] /oai_config
Description
Update the OAI config record.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- create_repository
Accepts Payload of Type
JSONModel(:oai_config)
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
Update the OAI config record
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/oai_config/1" \
-d '{
"jsonmodel_type": "oai_config",
"oai_record_prefix": "archivesspace:oai",
"oai_admin_email": "oairecord@example.org",
"oai_repository_name": "ArchivesSpace OAI Repo"
}'
Endpoint
[:POST] /oai_config/:id
Description
Update the OAI config record.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- create_repository
Accepts Payload of Type
JSONModel(:oai_config)
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
A HTML form to generate one sample OAI requests
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/oai_sample"
Endpoint
[:GET] /oai_sample
Description
A HTML form to generate one sample OAI requests.
Permissions
This endpoint does not require authentication.
Returns
200 -- HTML
Get a list of Permissions
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/permissions?level="
Endpoint
[:GET] /permissions
Description
Get a list of Permissions.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/reports"
Endpoint
[:GET] /reports
Description
List all reports.
Permissions
This endpoint does not require authentication.
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.
Permissions
This endpoint does not require authentication.
Returns
200 --
h -- a
Get a static asset for a report
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/reports/static/*?splat="
Endpoint
[:GET] /reports/static/*
Description
Get a static asset for a report.
Permissions
This endpoint does not require authentication.
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
splat |
The requested asset | String |
Returns
200 -- the asset
Create a Repository
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories" \
-d '{
"jsonmodel_type": "repository",
"name": "Description: 1",
"is_slug_auto": true,
"repo_code": "testrepo_1_1733154330",
"org_code": "VH779859I",
"image_url": "http://www.example-1-1733154330.com",
"url": "http://www.example-2-1733154330.com",
"country": "US"
}'
Endpoint
[:POST] /repositories
Description
Create a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- create_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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories?resolve%5B%5D=agent_representation&resolve%5B%5D=repository"
Endpoint
[:GET] /repositories
Description
Get a list of Repositories.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1" \
-d '{
"jsonmodel_type": "repository",
"name": "Description: 1",
"is_slug_auto": true,
"repo_code": "testrepo_1_1733154330",
"org_code": "VH779859I",
"image_url": "http://www.example-1-1733154330.com",
"url": "http://www.example-2-1733154330.com",
"country": "US"
}'
Endpoint
[:POST] /repositories/:id
Description
Update a repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- create_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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1?resolve%5B%5D=agent_representation&resolve%5B%5D=repository"
Endpoint
[:GET] /repositories/:id
Description
Get a Repository by ID.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/repositories/1"
Endpoint
[:DELETE] /repositories/:repo_id
Description
Delete a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_repository
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
repo_id |
The Repository ID
Note: The Repository must exist |
Integer |
Returns
200 -- deleted
Create an Accession
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/accessions" \
-d '{
"jsonmodel_type": "accession",
"is_slug_auto": true,
"accession_date": "1989-08-13",
"extents": [
{
"jsonmodel_type": "extent",
"portion": "part",
"number": "90",
"extent_type": "linear_feet",
"dimensions": "A789XED",
"physical_details": "XDK140146"
}
],
"restrictions_apply": false,
"access_restrictions": false,
"use_restrictions": false,
"id_0": "675VPEJ",
"id_1": "VYL789255",
"id_2": "IDWC178",
"id_3": "RLU715Q",
"title": "Accession Title: 30",
"content_description": "Description: 11",
"condition_description": "Description: 12"
}'
Endpoint
[:POST] /repositories/:repo_id/accessions
Description
Create an Accession.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_accession_record
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/1/accessions?page=1"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/accessions?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/accessions?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /repositories/:repo_id/accessions
Description
Get a list of Accessions for a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
repo_id |
The Repository ID
Note: The Repository must exist |
Integer |
Returns
200 -- [(:accession)]
Update an Accession
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/accessions/1" \
-d '{
"jsonmodel_type": "accession",
"is_slug_auto": true,
"accession_date": "1989-08-13",
"extents": [
{
"jsonmodel_type": "extent",
"portion": "part",
"number": "90",
"extent_type": "linear_feet",
"dimensions": "A789XED",
"physical_details": "XDK140146"
}
],
"restrictions_apply": false,
"access_restrictions": false,
"use_restrictions": false,
"id_0": "675VPEJ",
"id_1": "VYL789255",
"id_2": "IDWC178",
"id_3": "RLU715Q",
"title": "Accession Title: 30",
"content_description": "Description: 11",
"condition_description": "Description: 12"
}'
Endpoint
[:POST] /repositories/:repo_id/accessions/:id
Description
Update an Accession.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_accession_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(:accession)
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
Get an Accession by ID
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/accessions/1?resolve%5B%5D=repository"
Endpoint
[:GET] /repositories/:repo_id/accessions/:id
Description
Get an Accession by ID.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/repositories/1/accessions/1"
Endpoint
[:DELETE] /repositories/:repo_id/accessions/:id
Description
Delete an Accession.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_archival_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
curl -s -F password="password" "http://localhost:8089/users/:your_username:/login"
# Replace "password" with your password, "http://localhost:8089 with your ASpace API URL, and :your_username: with
# your ArchivesSpace username
set SESSION="session_id"
# If using Git Bash, replace set with export
curl -X POST -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/:repo_id:/accessions/:accession_id:/suppressed?suppressed=true"
# Replace http://localhost:8089 with your ArchivesSpace API URL, :repo_id: with the ArchivesSpace repository ID,
# :accession_id: with the ArchivesSpace ID of the accession, and change the "suppressed" value to true to suppress
# the accession or false to unsuppress the accession
# Output: {"status":"Suppressed","id":3828,"suppressed_state":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
suppress_accession = client.post("repositories/:repo_id:/accessions/:accession_id:/suppressed",
params={"suppressed": True})
# Replace :repo_id: with the ArchivesSpace repository ID, :accession_id: with the ArchivesSpace ID of the
# accession, and change the "suppressed" value to True to suppress the accession or False to unsuppress the
# accession
print(suppress_accession.json())
# Output: {'status': 'Suppressed', 'id': 3828, 'suppressed_state': True}
Endpoint
[:POST] /repositories/:repo_id/accessions/:id/suppressed
Description
Suppress this record.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- suppress_archival_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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/accessions/1/top_containers?resolve%5B%5D="
Endpoint
[:GET] /repositories/:repo_id/accessions/:id/top_containers
Description
Get Top Containers linked to an Accession.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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)]
404 -- Not found
Transfer this record to a different repository
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/accessions/1/transfer"
Endpoint
[:POST] /repositories/:repo_id/accessions/:id/transfer
Description
Transfer this record to a different repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_accession_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/agents/corporate_entities/marc21/1.xml/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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/agents/families/marc21/1.xml/metadata"
Endpoint
[:GET] /repositories/:repo_id/agents/families/marc21/:id.:fmt/metadata
Description
Get metadata for an MARC Auth export of a family.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/agents/families/marc21/1.xml"
Endpoint
[:GET] /repositories/:repo_id/agents/families/marc21/:id.xml
Description
Get an MARC Auth representation of a Family.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/agents/people/marc21/1.xml/metadata"
Endpoint
[:GET] /repositories/:repo_id/agents/people/marc21/:id.:fmt/metadata
Description
Get metadata for an MARC Auth export of a person.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/agents/people/marc21/1.xml"
Endpoint
[:GET] /repositories/:repo_id/agents/people/marc21/:id.xml
Description
Get an MARC Auth representation of an Person.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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.xml/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.
Permissions
This endpoint does not require authentication.
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.
Permissions
This endpoint does not require authentication.
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.
Permissions
This endpoint does not require authentication.
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.
Permissions
This endpoint does not require authentication.
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.xml/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.
Permissions
This endpoint does not require authentication.
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.
Permissions
This endpoint does not require authentication.
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 -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" -d '{'jsonmodel_type': 'archival_object',
'publish': True,
'external_ids': [],
'subjects': [],
'linked_events': [],
'extents': [{'number': '2',
'portion': 'whole',
'extent_type': 'folder(s)',
'jsonmodel_type': 'extent'}],
'lang_materials': [],
'dates': [
{'expression': '1927, 1929',
'begin': '1927',
'end': '1929',
'date_type': 'inclusive',
'label': 'creation',
'jsonmodel_type': 'date'}],
'external_documents': [],
'rights_statements': [],
'linked_agents': [],
'is_slug_auto': True,
'restrictions_apply': False,
'ancestors': [],
'instances': [],
'notes': [],
'ref_id': "20029191",
'level': 'file',
'title': 'Archival Object title',
'resource': {'ref': '/repositories/2/resources/5783'}' //
"http://localhost:8089/repositories/2/archival_objects"
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
new_ao = {'jsonmodel_type': 'archival_object',
'publish': True,
'external_ids': [],
'subjects': [],
'linked_events': [],
'extents': [{'number': '2',
'portion': 'whole',
'extent_type': 'folder(s)',
'jsonmodel_type': 'extent'}],
'lang_materials': [],
'dates': [
{'expression': '1927, 1929',
'begin': '1927',
'end': '1929',
'date_type': 'inclusive',
'label': 'creation',
'jsonmodel_type': 'date'}],
'external_documents': [],
'rights_statements': [],
'linked_agents': [],
'is_slug_auto': True,
'restrictions_apply': False,
'ancestors': [],
'instances': [],
'notes': [],
'ref_id': "20029191", # Can leave this out
'level': 'file',
'title': 'Archival Object title',
'resource': {'ref': '/repositories/2/resources/5783'}
}
# This is a sample archival object that meets the minimum requirements. Make sure for the resource['ref'] value
# to replace the 2 with the repository ID and 5783 with the resource ID. Find these in the URI of the resource
# in the staff interface
create_ao = client.post('repositories/2/archival_objects', json=new_ao)
# Replace 2 for your repository ID. Find this in the URI of your resource in the staff interface
print(create_ao.json())
# Output (dictionary): {'status': 'Created', 'id': 707459, 'lock_version': 0, 'stale': True, //
# 'uri': '/repositories/2/archival_objects/707459', 'warnings': []}
Endpoint
[:POST] /repositories/:repo_id/archival_objects
Description
Create an Archival Object.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_resource_record
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
curl -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
# For all archival objects, use all_ids
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/archival_objects?all_ids=true"
# For a set of archival objects, use id_set
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/2/archival_objects?id_set=707458&id_set=707460&id_set=707461"
# For a page of archival objects, use page and page_size
"http://localhost:8089/repositories/2/archival_objects?page=1&page_size=10"
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
# To get all archival objects for a repository, use all_ids parameter
get_repo_aos_allids = client.get("repositories/6/archival_objects", params={"all_ids": True})
# Replace 2 for your repository ID. Find this in the URI of your archival object on the bottom right of the
# Basic Information section in the staff interface
# To get a set of archival objects for a repostiory, use id_set parameter
get_repo_aos_set = client.get("repositories/2/archival_objects", params={"id_set": [707458, 707460, 707461]})
# Replace 2 for your repository ID and the list of numbers for id_set with your archival object IDs.
# Find these in the URI of your archival object on the bottom right of the Basic Information section in the
# staff interface
# To get a page of archival objects with a set page size, use "page" and "page_size" parameters
get_repo_aos_pages = client.get("repositories/2/archival_objects", params={"page": 1, "page_size": 10})
# Replace 2 for your repository ID. Find this in the URI of your archival object on the bottom right of the
# Basic Information section in the staff interface
print(get_repo_aos_allids.json())
# Output (list of IDs as integers): [687852, 687853, 687854, 687855, 687856, 687857, 687858,...]
print(get_repo_aos_set.json())
# Output (list of dictionaries): [{'lock_version': 0, 'position': 0, 'publish': True,...},...]
print(get_repo_aos_pages.json())
# Output (dictionary): {'first_page': 1, 'last_page': 26949, 'this_page': 1, 'total': 269488, //
# 'results': [{'lock_version': 1, 'position': 0,...]...}
Endpoint
[:GET] /repositories/:repo_id/archival_objects
Description
Get a list of Archival Objects for a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_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 -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" -d '{"jsonmodel_type": "archival_object",
"publish": true,
"external_ids": [],
"subjects": [],
"linked_events": [],
"extents": [{"number": "2",
"portion": "whole",
"extent_type": "folder(s)",
"jsonmodel_type": "extent"}],
"lang_materials": [],
"dates": [{"expression": "1927, 1929",
"begin": "1927",
"end": "1929",
"date_type": "inclusive",
"label": "creation",
"jsonmodel_type": "date"}],
"external_documents": [],
"rights_statements": [],
"linked_agents": [],
"is_slug_auto": true,
"restrictions_apply": false,
"ancestors": [],
"instances": [],
"notes": [],
"ref_id": "20029191",
"level": "file",
"title": "New title",
"resource": {"ref": "/repositories/2/resources/5783"}}' //
"http://localhost:8089/repositories/2/archival_objects"
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
original_ao = client.get("/repositories/2/archival_objects/707460").json()
# First, get the json formatted archival object you want to update. Replace 2 with your repository ID and
# 707460 with the archival object ID as part of the URI for the object. You can find the URI when viewing the
# object in the ArchivesSpace staff interface in the Basic Information section.
new_ao = original_ao
new_ao["title"] = "New title"
# Copy the original archival object json value and assign it to a new variable. Then updated whichever field
# you need to. To see what fields you can change, do print(original_ao.json())
update_ao = client.post("/repositories/2/archival_objects/707460", json=new_ao)
# To send the updated archival object json to ArchivesSpace, input the URI of the archival object by replacing
# the 2 with the repository ID and the 707460 with the archival object ID. Then pass new_ao to the json
# parameter
print(update_ao.json())
# Output (dictionary): {'status': 'Updated', 'id': 707460, 'lock_version': 3, 'stale': True, //
# 'uri': '/repositories/2/archival_objects/707460', 'warnings': []}
Endpoint
[:POST] /repositories/:repo_id/archival_objects/:id
Description
Update an Archival Object.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_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 |
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 -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_objects/48"
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
archival_object = client.get("/repositories/2/archival_objects/48")
# Replace 2 for your repository ID and 48 with your archival object ID. Find these in the URI of your archival
# object on the bottom right of the Basic Information section in the staff interface
print(archival_object.json())
# Output (dictionary): {"lock_version": 0, "position": 0, "publish": true, "ref_id": "ref01_uqj", //
# "title": "Archival Object",...}
Endpoint
[:GET] /repositories/:repo_id/archival_objects/:id
Description
Get an Archival Object by ID.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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 -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" -X DELETE //
"http://localhost:8089/repositories/2/archival_objects/707451"
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
delete_ao = client.delete("/repositories/2/archival_objects/707461")
# Replace 2 for your repository ID and 707461 with your archival object ID. Find these in the URI of your
# archival object on the bottom right of the Basic Information section in the staff interface
print(delete_ao.json())
# Output (dictionary): {'status': 'Deleted', 'id': 707461}
Endpoint
[:DELETE] /repositories/:repo_id/archival_objects/:id
Description
Delete an Archival Object.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_archival_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
Move existing Archival Objects to become children of an Archival Object
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/archival_objects/1/accept_children"
Endpoint
[:POST] /repositories/:repo_id/archival_objects/:id/accept_children
Description
Move existing Archival Objects to become children of an Archival Object.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_resource_record
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 ARK name object for an ArchivalObject
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/archival_objects/1/ark_name"
Endpoint
[:GET] /repositories/:repo_id/archival_objects/:id/ark_name
Description
Get the ARK name object for an ArchivalObject.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- administer_system
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 -- (:ark_name)
Update the ARK name for an ArchivalObject
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/archival_objects/1/ark_name" \
-d '{
"jsonmodel_type": "ark_name",
"previous": [
"PRVA577"
]
}'
Endpoint
[:POST] /repositories/:repo_id/archival_objects/:id/ark_name
Description
Update the ARK name for an ArchivalObject.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- administer_system
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(:ark_name)
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
400 -- {:error => (description of error)}
Get the children of an Archival 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/archival_objects/707458/children"
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
get_children = client.get("/repositories/2/archival_objects/707458/children")
# Replace 2 for your repository ID and 707458 with your archival object ID. Find these in the URI of your archival
# object on the bottom right of the Basic Information section in the staff interface
print(get_children.json())
# Output (list of dictionaries): [{'lock_version': 3, 'position': 0, 'publish': True, 'ref_id': '20029191',...}..]
Endpoint
[:GET] /repositories/:repo_id/archival_objects/:id/children
Description
Get the children of an Archival Object.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_resource_record
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 -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_objects/226994/models_in_graph"
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
get_ao_types = client.get("/repositories/2/archival_objects/226994/models_in_graph")
# Replace 2 for your repository ID and 226994 with your archival object ID. Find these in the URI of your
# archival object on the bottom right of the Basic Information section in the staff interface
print(get_ao_types.json())
# Output (list): ['archival_object', 'extent', 'date', 'instance', 'external_id', 'sub_container']
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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 -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" //
-d "parent=707458&position=2" "http://localhost:8089/repositories/2/archival_objects/707460/parent"
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
set_child_position = client.post("/repositories/2/archival_objects/707460/parent", params={"parent": 707458,
"position": 2})
# Set the URI to the object that you want moved as a child. In this case, we are moving object 707460 to be the
# child of object 707458. In the URI string, replace the 2 with your repository ID and 707460 with the archival
# object ID found in the URI. You can find both the repository ID and the archival object ID in the URI on the
# bottom right of the Basic Information section of the archival object page in the staff interface. Don't forget
# to add /parent to the end of the string. Set the "parent" as the archival object ID of the parent you want
# for the child and set the "position" as where in list of children you want that child placed (out of 15
# children, I want it in position 2 of 15)
print(set_child_position.json())
# Output (dictionary): {'status': 'Updated', 'id': 707460, 'lock_version': 3, 'stale': None}
Endpoint
[:POST] /repositories/:repo_id/archival_objects/:id/parent
Description
Set the parent/position of an Archival Object in a tree.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_resource_record
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
id |
The ID of the record | Integer | |
parent |
The parent ID 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 of the same level in the tree for an Archival 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/archival_objects/707461/previous"
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
get_previous_ao = client.get("/repositories/2/archival_objects/707461/previous")
# Replace 2 for your repository ID and 707461 with your archival object ID. Find these in the URI of your
# archival object on the bottom right of the Basic Information section in the staff interface
print(get_children.json())
# Output (dictionary): {'lock_version': 0, 'position': 0, 'publish': True, /
# 'ref_id': '63a8c7d608936d85e85d08b9838d11c2', 'component_id': 'ref78192-11192', /
# 'title': 'test_archival_object-FULL',...}
Endpoint
[:GET] /repositories/:repo_id/archival_objects/:id/previous
Description
Get the previous record of the same level in the tree for an Archival Object.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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 -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" -X POST //
"http://localhost:8089/repositories/2/archival_objects/707458/publish"
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
publish_ao = client.post("/repositories/2/archival_objects/707458/publish")
# Replace 2 for your repository ID and 707458 with your archival object ID. Find these in the URI of your
# archival object on the bottom right of the Basic Information section in the staff interface
print(publish_ao.json())
# Output (dictionary): {'status': 'Updated', 'id': 707458, 'lock_version': 1, 'stale': None}
Endpoint
[:POST] /repositories/:repo_id/archival_objects/:id/publish
Description
Publish an Archival Object and all its sub-records and components.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_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 |
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
400 -- {:error => (description of error)}
Suppress this record
curl -s -F password="password" "http://localhost:8089/users/:your_username:/login"
# Replace "password" with your password, "http://localhost:8089 with your ASpace API URL, and :your_username: with
# your ArchivesSpace username
set SESSION="session_id"
# If using Git Bash, replace set with export
curl -X POST -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/:repo_id:/archival_objects/:archobj_id:/suppressed?suppressed=true"
# Replace http://localhost:8089 with your ArchivesSpace API URL, :repo_id: with the ArchivesSpace repository ID,
# :archobj_id: with the ArchivesSpace ID of the archival object, and change the "suppressed" value to true to
# suppress the archival object or false to unsuppress the archival object
# Output: {"status":"Suppressed","id":717782,"suppressed_state":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
suppress_archobj = client.post("/repositories/:repo_id:/archival_objects/:archobj_id:/suppressed",
params={"suppressed": True})
# Replace :repo_id: with the ArchivesSpace repository ID, :archobj_id: with the ArchivesSpace ID of the archival
# object, and change the "suppressed" value to True to suppress the archival object or False to unsuppress the
# archival object
print(suppress_archobj.json())
# Output: {'status': 'Suppressed', 'id': 717782, 'suppressed_state': True}
Endpoint
[:POST] /repositories/:repo_id/archival_objects/:id/suppressed
Description
Suppress this record.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- suppress_archival_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 -s -F password="admin" "http://localhost:8089/users/admin/login"
set SESSION="session_id"
curl -H "X-ArchivesSpace-Session: $SESSION" -X POST //
"http://localhost:8089/repositories/2/archival_objects/707458/unpublish"
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
unpublish_ao = client.post("/repositories/2/archival_objects/707458/unpublish")
# Replace 2 for your repository ID and 707458 with your archival object ID. Find these in the URI of your
# archival object on the bottom right of the Basic Information section in the staff interface
print(unpublish_ao.json())
# Output (dictionary): {'status': 'Updated', 'id': 707458, 'lock_version': 1, 'stale': None}
Endpoint
[:POST] /repositories/:repo_id/archival_objects/:id/unpublish
Description
Unpublish an Archival Object and all its sub-records and components.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_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 |
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
400 -- {:error => (description of error)}
Update this repository's assessment attribute definitions
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/assessment_attribute_definitions" \
-d '{
"jsonmodel_type": "assessment_attribute_definitions",
"definitions": [
{
"id": 25,
"label": "J873I76P",
"type": "rating",
"global": false,
"readonly": false,
"position": 45
}
]
}'
Endpoint
[:POST] /repositories/:repo_id/assessment_attribute_definitions
Description
Update this repository's assessment attribute definitions.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_assessment_attributes
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/assessment_attribute_definitions"
Endpoint
[:GET] /repositories/:repo_id/assessment_attribute_definitions
Description
Get this repository's assessment attribute definitions.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
repo_id |
The Repository ID
Note: The Repository must exist |
Integer |
Returns
200 -- (:assessment_attribute_definitions)
Create an Assessment
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/assessments" \
-d '{
"jsonmodel_type": "assessment",
"records": [
{
"ref": "/repositories/99/resources/99"
}
],
"surveyed_by": [
{
"ref": "/agents/people/99"
}
],
"reviewer": [
{
"ref": "/agents/people/99"
}
],
"accession_report": false,
"catalog_record": false,
"finding_aid_word": true,
"finding_aid_spreadsheet": false,
"related_eac_records": false,
"survey_begin": "1999-05-23",
"surveyed_duration": "ASNOR",
"review_required": false,
"inactive": true,
"purpose": "CO659BA",
"sensitive_material": true,
"monetary_value": "50"
}'
Endpoint
[:POST] /repositories/:repo_id/assessments
Description
Create an Assessment.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_assessment_record
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/1/assessments?page=1"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/assessments?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/assessments?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /repositories/:repo_id/assessments
Description
Get a list of Assessments for a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
repo_id |
The Repository ID
Note: The Repository must exist |
Integer |
Returns
200 -- [(:assessment)]
Update an Assessment
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/assessments/1" \
-d '{
"jsonmodel_type": "assessment",
"records": [
{
"ref": "/repositories/99/resources/99"
}
],
"surveyed_by": [
{
"ref": "/agents/people/99"
}
],
"reviewer": [
{
"ref": "/agents/people/99"
}
],
"accession_report": false,
"catalog_record": false,
"finding_aid_word": true,
"finding_aid_spreadsheet": false,
"related_eac_records": false,
"survey_begin": "1999-05-23",
"surveyed_duration": "ASNOR",
"review_required": false,
"inactive": true,
"purpose": "CO659BA",
"sensitive_material": true,
"monetary_value": "50"
}'
Endpoint
[:POST] /repositories/:repo_id/assessments/:id
Description
Update an Assessment.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_assessment_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(:assessment)
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
Get an Assessment by ID
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/assessments/1?resolve%5B%5D=repository"
Endpoint
[:GET] /repositories/:repo_id/assessments/:id
Description
Get an Assessment by ID.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/repositories/1/assessments/1"
Endpoint
[:DELETE] /repositories/:repo_id/assessments/:id
Description
Delete an Assessment.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_assessment_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
Import a batch of records
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/batch_imports" \
-d '{
"batch_import": "body_stream",
"skip_results": "BooleanParam"
}'
Endpoint
[:POST] /repositories/:repo_id/batch_imports
Description
Import a batch of records.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- import_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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/classification_terms" \
-d '{
"jsonmodel_type": "classification_term",
"publish": true,
"is_slug_auto": true,
"identifier": "ODNHY",
"title": "Classification Title: 26",
"description": "Description: 9",
"classification": {
"ref": "/repositories/99/classifications/99"
}
}'
Endpoint
[:POST] /repositories/:repo_id/classification_terms
Description
Create a Classification Term.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_classification_record
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/1/classification_terms?page=1"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/classification_terms?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/classification_terms?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /repositories/:repo_id/classification_terms
Description
Get a list of Classification Terms for a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/classification_terms/1" \
-d '{
"jsonmodel_type": "classification_term",
"publish": true,
"is_slug_auto": true,
"identifier": "ODNHY",
"title": "Classification Title: 26",
"description": "Description: 9",
"classification": {
"ref": "/repositories/99/classifications/99"
}
}'
Endpoint
[:POST] /repositories/:repo_id/classification_terms/:id
Description
Update a Classification Term.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_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 |
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/classification_terms/1?resolve%5B%5D="
Endpoint
[:GET] /repositories/:repo_id/classification_terms/:id
Description
Get a Classification Term by ID.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/repositories/1/classification_terms/1"
Endpoint
[:DELETE] /repositories/:repo_id/classification_terms/:id
Description
Delete a Classification Term.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_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 |
Returns
200 -- deleted
Move existing Classification Terms to become children of another Classification Term
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/classification_terms/1/accept_children"
Endpoint
[:POST] /repositories/:repo_id/classification_terms/:id/accept_children
Description
Move existing Classification Terms to become children of another Classification Term.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_classification_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/classification_terms/1/children"
Endpoint
[:GET] /repositories/:repo_id/classification_terms/:id/children
Description
Get the children of a Classification Term.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/classification_terms/1/parent"
Endpoint
[:POST] /repositories/:repo_id/classification_terms/:id/parent
Description
Set the parent/position of a Classification Term in a tree.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_classification_record
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/classifications" \
-d '{
"jsonmodel_type": "classification",
"publish": true,
"is_slug_auto": true,
"identifier": "PIMJR",
"title": "Classification Title: 4",
"description": "Description: 2"
}'
Endpoint
[:POST] /repositories/:repo_id/classifications
Description
Create a Classification.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_classification_record
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/1/classifications?page=1"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/classifications?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/classifications?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /repositories/:repo_id/classifications
Description
Get a list of Classifications for a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
repo_id |
The Repository ID
Note: The Repository must exist |
Integer |
Returns
200 -- [(:classification)]
Get a Classification
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/classifications/1?resolve%5B%5D=creator&resolve%5B%5D=repository"
Endpoint
[:GET] /repositories/:repo_id/classifications/:id
Description
Get a Classification.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/classifications/1" \
-d '{
"jsonmodel_type": "classification",
"publish": true,
"is_slug_auto": true,
"identifier": "PIMJR",
"title": "Classification Title: 4",
"description": "Description: 2"
}'
Endpoint
[:POST] /repositories/:repo_id/classifications/:id
Description
Update a Classification.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_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 |
Accepts Payload of Type
JSONModel(:classification)
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
400 -- {:error => (description of error)}
Delete a Classification
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/repositories/1/classifications/1"
Endpoint
[:DELETE] /repositories/:repo_id/classifications/:id
Description
Delete a Classification.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_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 |
Returns
200 -- deleted
Move existing Classification Terms to become children of a Classification
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/classifications/1/accept_children"
Endpoint
[:POST] /repositories/:repo_id/classifications/:id/accept_children
Description
Move existing Classification Terms to become children of a Classification.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_classification_record
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)}
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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:
title -- the collection title
uri -- the collection URI
child_count -- the number of immediate children
waypoints -- the number of "waypoints" those children are grouped into
waypoint_size -- the number of children in each waypoint
position -- the logical position of this record within its subtree
precomputed_waypoints -- a collection of arrays (keyed on child URI) in the same format as returned by the '/waypoint' endpoint. Since a fetch for a given node is almost always followed by a fetch of the first waypoint, using the information in this structure can save a backend call.
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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:
node -- the URI of the node to next expand
offset -- the waypoint number within
node
that contains the next entry in the path (or the desired record, if we're at the end of the path)
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.
Includes the first set of immediate children, which are grouped into 'waypoints'. Additional API requests may be required to retrieve all children if there are too many to include in the first response. See Returns below for details.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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:
child_count (Integer) -- Number of immediate children of the root record
waypoints (Integer) -- Number of "waypoints" those children are grouped into. The first waypoint is precomputed and included in the response (see precomputed_wayoints below). Additional waypoints can be retireved via
/repositories/:repo_id/:record_type/:id/tree/waypoint
waypoint_size (Integer) -- The limit to the number of children included in each waypoint
title (String) -- Record title
uri (String) -- Record URI
precomputed_waypoints (JSON) -- A nested JSON object containing the first "waypoint" (set of children), limited to
waypoint_size
. The JSON object is structured as follows:{ "": { "0": [<JSON Object>] }
.precomputed_waypoints[''][0]
is an array of JSON objects representing immediate children of the root record. The format of this object is similar to the object returned by:/repositories/:repo_id/:record_type/:id/tree/node
but without its own precomputed_waypoints.
Resource records only:
- level (String) -- Level of arrangement (e.g. collection)
Resource and Classification records only:
- identifier (String) -- The root record identifier
Digital Object records only:
digital_object_type (String) -- Type of the digital object (e.g. still_image)
file_uri_summary (String) -- The file uri of the root digital object
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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:
title -- the record's title
uri -- the record URI
position -- the logical position of this record within its subtree
parent_id -- the internal ID of this document's parent
Get a Collection Management Record by ID
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/collection_management/1?resolve%5B%5D="
Endpoint
[:GET] /repositories/:repo_id/collection_management/:id
Description
Get a Collection Management Record by ID.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/component_transfers"
Endpoint
[:POST] /repositories/:repo_id/component_transfers
Description
Transfer components from one resource to another.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_resource_record
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.
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/current_preferences"
Endpoint
[:GET] /repositories/:repo_id/current_preferences
Description
Get the Preferences records for the current repository and user..
Permissions
This endpoint does not require authentication.
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","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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_custom_report_templates
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- create_job
- manage_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","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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_custom_report_templates
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- create_job
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_custom_report_templates
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/default_values/" \
-d '{
"jsonmodel_type": "default_values"
}'
Endpoint
[:POST] /repositories/:repo_id/default_values/:record_type
Description
Save defaults for a record type.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/default_values/"
Endpoint
[:GET] /repositories/:repo_id/default_values/:record_type
Description
Get default values for a record type.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/digital_object_components" \
-d '{
"jsonmodel_type": "digital_object_component",
"is_slug_auto": true,
"component_id": "component_3",
"title": "Digital Object Component Title: 21",
"digital_object": {
"ref": "/repositories/99/digital_objects/99"
},
"position": 47,
"has_unpublished_ancestor": false
}'
Endpoint
[:POST] /repositories/:repo_id/digital_object_components
Description
Create an Digital Object Component.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_digital_object_record
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/1/digital_object_components?page=1"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/digital_object_components?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/digital_object_components?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /repositories/:repo_id/digital_object_components
Description
Get a list of Digital Object Components for a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/digital_object_components/1" \
-d '{
"jsonmodel_type": "digital_object_component",
"is_slug_auto": true,
"component_id": "component_3",
"title": "Digital Object Component Title: 21",
"digital_object": {
"ref": "/repositories/99/digital_objects/99"
},
"position": 47,
"has_unpublished_ancestor": false
}'
Endpoint
[:POST] /repositories/:repo_id/digital_object_components/:id
Description
Update an Digital Object Component.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_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 |
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/digital_object_components/1?resolve%5B%5D="
Endpoint
[:GET] /repositories/:repo_id/digital_object_components/:id
Description
Get an Digital Object Component by ID.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/repositories/1/digital_object_components/1"
Endpoint
[:DELETE] /repositories/:repo_id/digital_object_components/:id
Description
Delete a Digital Object Component.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_archival_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
Move existing Digital Object Components to become children of a Digital Object Component
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/digital_object_components/1/accept_children"
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_digital_object_record
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/digital_object_components/1/children" \
-d '{
"jsonmodel_type": "digital_record_children",
"children": [
{
"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": [
],
"ancestors": [
],
"component_id": "component_1",
"title": "Digital Object Component Title: 5",
"digital_object": {
"ref": "/repositories/99/digital_objects/99"
},
"position": 25,
"has_unpublished_ancestor": false
},
{
"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": [
],
"ancestors": [
],
"component_id": "component_2",
"title": "Digital Object Component Title: 7",
"digital_object": {
"ref": "/repositories/99/digital_objects/99"
},
"position": 21,
"has_unpublished_ancestor": false
}
]
}'
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_digital_object_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/digital_object_components/1/children"
Endpoint
[:GET] /repositories/:repo_id/digital_object_components/:id/children
Description
Get the children of an Digital Object Component.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/digital_object_components/1/parent"
Endpoint
[:POST] /repositories/:repo_id/digital_object_components/:id/parent
Description
Set the parent/position of an Digital Object Component in a tree.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_digital_object_record
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 -s -F password="password" "http://localhost:8089/users/:your_username:/login"
# Replace "password" with your password, "http://localhost:8089 with your ASpace API URL, and :your_username: with
# your ArchivesSpace username
set SESSION="session_id"
# If using Git Bash, replace set with export
curl -X POST -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/:repo_id:/digital_object_components/:digobjcomp_id:/suppressed?suppressed=true"
# Replace http://localhost:8089 with your ArchivesSpace API URL, :repo_id: with the ArchivesSpace repository ID,
# :digobjcomp_id: with the ArchivesSpace ID of the digital object component, and change the "suppressed" value to
# True to suppress the digital object component or False to unsuppress the digital object component
# Output: {"status":"Suppressed","id":3,"suppressed_state":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
suppress_digobjcomp = client.post("/repositories/:repo_id:/digital_object_components/:digobjcomp_id:/suppressed",
params={"suppressed": True})
# Replace :repo_id: with the ArchivesSpace repository ID, :digobjcomp_id: with the ArchivesSpace ID of the digital
# object component, and change the "suppressed" value to True to suppress the digital object component or False to
# unsuppress the digital object component
print(suppress_digobjcomp.json())
# Output: {'status': 'Suppressed', 'id': 3, 'suppressed_state': True}
Endpoint
[:POST] /repositories/:repo_id/digital_object_components/:id/suppressed
Description
Suppress this record.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- suppress_archival_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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/digital_objects" \
-d '{
"jsonmodel_type": "digital_object",
"extents": [
{
"jsonmodel_type": "extent",
"portion": "part",
"number": "36",
"extent_type": "reels",
"dimensions": "IFGFL",
"physical_details": "81127693479D"
}
],
"lang_materials": [
{
"jsonmodel_type": "lang_material",
"notes": [
],
"language_and_script": {
"jsonmodel_type": "language_and_script",
"language": "kac",
"script": "Bamu"
}
}
],
"dates": [
{
"jsonmodel_type": "date",
"date_type": "single",
"label": "creation",
"begin": "1979-11-15",
"end": "1979-11-15",
"certainty": "inferred",
"era": "ce",
"calendar": "gregorian",
"expression": "359190E201421"
}
],
"is_slug_auto": true,
"restrictions": false,
"title": "Digital Object Title: 1",
"digital_object_id": "DSBU369"
}'
Endpoint
[:POST] /repositories/:repo_id/digital_objects
Description
Create a Digital Object.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_digital_object_record
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/1/digital_objects?page=1"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/digital_objects?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/digital_objects?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /repositories/:repo_id/digital_objects
Description
Get a list of Digital Objects for a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/digital_objects/1?resolve%5B%5D="
Endpoint
[:GET] /repositories/:repo_id/digital_objects/:id
Description
Get a Digital Object.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/digital_objects/1" \
-d '{
"jsonmodel_type": "digital_object",
"extents": [
{
"jsonmodel_type": "extent",
"portion": "part",
"number": "36",
"extent_type": "reels",
"dimensions": "IFGFL",
"physical_details": "81127693479D"
}
],
"lang_materials": [
{
"jsonmodel_type": "lang_material",
"notes": [
],
"language_and_script": {
"jsonmodel_type": "language_and_script",
"language": "kac",
"script": "Bamu"
}
}
],
"dates": [
{
"jsonmodel_type": "date",
"date_type": "single",
"label": "creation",
"begin": "1979-11-15",
"end": "1979-11-15",
"certainty": "inferred",
"era": "ce",
"calendar": "gregorian",
"expression": "359190E201421"
}
],
"is_slug_auto": true,
"restrictions": false,
"title": "Digital Object Title: 1",
"digital_object_id": "DSBU369"
}'
Endpoint
[:POST] /repositories/:repo_id/digital_objects/:id
Description
Update a Digital Object.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_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 |
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/repositories/1/digital_objects/1"
Endpoint
[:DELETE] /repositories/:repo_id/digital_objects/:id
Description
Delete a Digital Object.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_archival_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
Move existing Digital Object components to become children of a Digital Object
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/digital_objects/1/accept_children"
Endpoint
[:POST] /repositories/:repo_id/digital_objects/:id/accept_children
Description
Move existing Digital Object components to become children of a Digital Object.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_digital_object_record
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/digital_objects/1/children" \
-d '{
"jsonmodel_type": "digital_record_children",
"children": [
{
"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": [
],
"ancestors": [
],
"component_id": "component_1",
"title": "Digital Object Component Title: 5",
"digital_object": {
"ref": "/repositories/99/digital_objects/99"
},
"position": 25,
"has_unpublished_ancestor": false
},
{
"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": [
],
"ancestors": [
],
"component_id": "component_2",
"title": "Digital Object Component Title: 7",
"digital_object": {
"ref": "/repositories/99/digital_objects/99"
},
"position": 21,
"has_unpublished_ancestor": false
}
]
}'
Endpoint
[:POST] /repositories/:repo_id/digital_objects/:id/children
Description
Batch create several Digital Object Components as children of an existing Digital Object.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_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 |
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_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 |
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
400 -- {:error => (description of error)}
Suppress this record
curl -s -F password="password" "http://localhost:8089/users/:your_username:/login"
# Replace "password" with your password, "http://localhost:8089 with your ASpace API URL, and :your_username: with
# your ArchivesSpace username
set SESSION="session_id"
# If using Git Bash, replace set with export
curl -X POST -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/:repo_id:/digital_objects/:digobj_id:/suppressed?suppressed=false"
# Replace http://localhost:8089 with your ArchivesSpace API URL, :repo_id: with the ArchivesSpace repository ID,
# :digobj_id: with the ArchivesSpace ID of the digital object, and change the "suppressed" value to true to
# suppress the digital object or false to unsuppress the digital object
# Output: {"status":"Suppressed","id":14098,"suppressed_state":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
suppress_digobj = client.post("/repositories/:repo_id:/digital_objects/:digobj_id:/suppressed",
params={"suppressed": True})
# Replace :repo_id: with the ArchivesSpace repository ID, :digobj_id: with the ArchivesSpace ID of the digital
# object, and change the "suppressed" value to True to suppress the digital object or False to unsuppress the
# digital object
print(suppress_digobj.json())
# Output: {'status': 'Suppressed', 'id': 14098, 'suppressed_state': True}
Endpoint
[:POST] /repositories/:repo_id/digital_objects/:id/suppressed
Description
Suppress this record.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- suppress_archival_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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/digital_objects/1/transfer"
Endpoint
[:POST] /repositories/:repo_id/digital_objects/:id/transfer
Description
Transfer this record to a different repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_digital_object_record
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
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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:
title -- the collection title
uri -- the collection URI
child_count -- the number of immediate children
waypoints -- the number of "waypoints" those children are grouped into
waypoint_size -- the number of children in each waypoint
position -- the logical position of this record within its subtree
precomputed_waypoints -- a collection of arrays (keyed on child URI) in the same format as returned by the '/waypoint' endpoint. Since a fetch for a given node is almost always followed by a fetch of the first waypoint, using the information in this structure can save a backend call.
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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:
node -- the URI of the node to next expand
offset -- the waypoint number within
node
that contains the next entry in the path (or the desired record, if we're at the end of the path)
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.
Includes the first set of immediate children, which are grouped into 'waypoints'. Additional API requests may be required to retrieve all children if there are too many to include in the first response. See Returns below for details.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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:
child_count (Integer) -- Number of immediate children of the root record
waypoints (Integer) -- Number of "waypoints" those children are grouped into. The first waypoint is precomputed and included in the response (see precomputed_wayoints below). Additional waypoints can be retireved via
/repositories/:repo_id/:record_type/:id/tree/waypoint
waypoint_size (Integer) -- The limit to the number of children included in each waypoint
title (String) -- Record title
uri (String) -- Record URI
precomputed_waypoints (JSON) -- A nested JSON object containing the first "waypoint" (set of children), limited to
waypoint_size
. The JSON object is structured as follows:{ "": { "0": [<JSON Object>] }
.precomputed_waypoints[''][0]
is an array of JSON objects representing immediate children of the root record. The format of this object is similar to the object returned by:/repositories/:repo_id/:record_type/:id/tree/node
but without its own precomputed_waypoints.
Resource records only:
- level (String) -- Level of arrangement (e.g. collection)
Resource and Classification records only:
- identifier (String) -- The root record identifier
Digital Object records only:
digital_object_type (String) -- Type of the digital object (e.g. still_image)
file_uri_summary (String) -- The file uri of the root digital object
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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:
title -- the record's title
uri -- the record URI
position -- the logical position of this record within its subtree
parent_id -- the internal ID of this document's parent
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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.xml/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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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 .
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/events" \
-d '{
"jsonmodel_type": "event",
"linked_agents": [
{
"ref": "/agents/people/99",
"role": "executing_program"
}
],
"linked_records": [
{
"ref": "/repositories/99/accessions/99",
"role": "context"
}
],
"date": {
"jsonmodel_type": "date",
"date_type": "range",
"label": "creation",
"begin": "1988-11-08",
"end": "1988-11-08",
"certainty": "inferred",
"era": "ce",
"calendar": "gregorian",
"expression": "376CGDK"
},
"event_type": "migration"
}'
Endpoint
[:POST] /repositories/:repo_id/events
Description
Create an Event.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_event_record
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/1/events?page=1"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/events?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/events?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /repositories/:repo_id/events
Description
Get a list of Events for a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
repo_id |
The Repository ID
Note: The Repository must exist |
Integer |
Returns
200 -- [(:event)]
Update an Event
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/events/1" \
-d '{
"jsonmodel_type": "event",
"linked_agents": [
{
"ref": "/agents/people/99",
"role": "executing_program"
}
],
"linked_records": [
{
"ref": "/repositories/99/accessions/99",
"role": "context"
}
],
"date": {
"jsonmodel_type": "date",
"date_type": "range",
"label": "creation",
"begin": "1988-11-08",
"end": "1988-11-08",
"certainty": "inferred",
"era": "ce",
"calendar": "gregorian",
"expression": "376CGDK"
},
"event_type": "migration"
}'
Endpoint
[:POST] /repositories/:repo_id/events/:id
Description
Update an Event.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_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 |
Accepts Payload of Type
JSONModel(:event)
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
Get an Event by ID
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/events/1?resolve%5B%5D=repository"
Endpoint
[:GET] /repositories/:repo_id/events/:id
Description
Get an Event by ID.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/repositories/1/events/1"
Endpoint
[:DELETE] /repositories/:repo_id/events/:id
Description
Delete an event record.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/events/1/suppressed"
Endpoint
[:POST] /repositories/:repo_id/events/:id/suppressed
Description
Suppress this record from non-managers.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- suppress_archival_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)}
Find Archival Objects by ref_id or component_id
curl -s -F password="admin" "http://localhost:8089/users/admin/login"
# Replace "admin" with your password and "http://localhost:8089/users/admin/login" with your ASpace API URL
# followed by "/users/{your_username}/login"
set SESSION="session_id"
# If using Git Bash, replace set with export
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/:repo_id:/find_by_id/archival_objects?component_id[]=hello_im_a_component_id;resolve[]=archival_objects"
# Replace "http://localhost:8089" with your ASpace API URL, :repo_id: with the repository ID,
# "hello_im_a_component_id" with the component ID you are searching for, and only add
# "resolve[]=archival_objects" if you want the JSON for the returned record - otherwise, it will return the
# record URI only
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/:repo_id:/find_by_id/archival_objects?ref_id[]=hello_im_a_ref_id;resolve[]=archival_objects"
# Replace "http://localhost:8089" with your ASpace API URL, :repo_id: with the repository ID,
# "hello_im_a_ref_id" with the ref ID you are searching for, and only add
# "resolve[]=archival_objects" if you want the JSON for the returned record - otherwise, it will return the
# record URI only
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/:repo_id:/find_by_id/archival_objects?ark[]=ark%3A%2F####%2F######;resolve[]=archival_objects"
# Replace "http://localhost:8089" with your ASpace API URL, :repo_id: with the repository ID,
# "ark%3A%2F####%2F######" with the ark you are searching for - NOTE, make sure to encode any characters like
# : into %3A and / into %2F - and only add "resolve[]=archival_objects" if you want the JSON for the returned
# record - otherwise, it will return the record URI only
# If you are having trouble resolving the URL, try using the --data-urlencode parameter, like so:
# curl -H "X-ArchivesSpace-Session: $SESSION" -G //
# http://localhost:8089/repositories/2/find_by_id/archival_objects --data-urlencode 'ark[]=ark%3A%2F####%2F######'
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
find_ao_compid = client.get("repositories/:repo_id:/find_by_id/archival_objects",
params={"component_id[]": "hello_im_a_component_id",
"resolve[]": "archival_objects"})
# Replace :repo_id: with the repository ID, "hello_im_a_component_id" with the component ID you are searching for, and
# only add "resolve[]": "archival_objects" if you want the JSON for the returned record - otherwise, it will
# return the record URI only
print(find_ao_compid.json())
# Output (dict): {'archival_objects': [{'ref': '/repositories/2/archival_objects/708425', '_resolved':...}]}
find_ao_refid = client.get("repositories/:repo_id:/find_by_id/archival_objects",
params={"ref_id[]": "hello_im_a_ref_id",
"resolve[]": "archival_objects"})
# Replace :repo_id: with the repository ID, "hello_im_a_ref_id" with the ref ID you are searching for, and only add
# "resolve[]": "archival_objects" if you want the JSON for the returned record - otherwise, it will return the
# record URI only
print(find_ao_refid.json())
# Output (dict): {'archival_objects': [{'ref': '/repositories/2/archival_objects/708425', '_resolved':...}]}
find_ao_ark = client.get("repositories/:repo_id:/find_by_id/archival_objects",
params={"ark[]": "ark:/######/##/##",
"resolve[]": "archival_objects"})
# Replace :repo_id: with the repository ID, "ark:/######/##/##" with the ark ID you are searching for, and only
# add "resolve[]": "archival_objects" if you want the JSON for the returned record - otherwise, it will return
# the record URI only
print(find_ao_ark.json())
# Output (dict): {'archival_objects': [{'ref': '/repositories/2/archival_objects/708425', '_resolved':...}]}
Endpoint
[:GET] /repositories/:repo_id/find_by_id/archival_objects
Description
Find Archival Objects by ref_id or component_id.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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 |
ark |
An ARK attached to an archival object record (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 -s -F password="admin" "http://localhost:8089/users/admin/login"
# Replace "admin" with your password and "http://localhost:8089/users/admin/login" with your ASpace API URL
# followed by "/users/{your_username}/login"
set SESSION="session_id"
# If using Git Bash, replace set with export
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/:repo_id:/find_by_id/digital_object_components?component_id[]=im_a_do_component_id;resolve[]=digital_object_components"
# Replace "http://localhost:8089" with your ASpace API URL, :repo_id: with the repository ID,
# "im_a_do_component_id" with the component ID you are searching for, and only add
# "resolve[]=digital_object_components" if you want the JSON for the returned record - otherwise, it will return
# the record URI only
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
find_do_comp = client.get("repositories/:repo_id:/find_by_id/digital_object_components",
params={"component_id[]": "im_a_do_component_id",
"resolve[]": "digital_object_components"})
# Replace :repo_id: with the repository ID, "im_a_do_component_id" with the component ID you are searching for, and
# only add "resolve[]": "digital_object_components" if you want the JSON for the returned record - otherwise, it
# will return the record URI only
print(find_do_comp.json())
# Output (dict): {'digital_object_components': [{'ref': '/repositories/2/digital_object_components/1', '_resolved':...}]}
Endpoint
[:GET] /repositories/:repo_id/find_by_id/digital_object_components
Description
Find Digital Object Components by component_id.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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 -s -F password="admin" "http://localhost:8089/users/admin/login"
# Replace "admin" with your password and "http://localhost:8089/users/admin/login" with your ASpace API URL
# followed by "/users/{your_username}/login"
set SESSION="session_id"
# If using Git Bash, replace set with export
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/:repo_id:/find_by_id/digital_objects?digital_object_id[]=hello_im_a_digobj_id;resolve[]=digital_objects"
# Replace "http://localhost:8089" with your ASpace API URL, :repo_id: with the repository ID,
# "hello_im_a_digobj_id" with the digital object ID you are searching for, and only add
# "resolve[]=digital_objects" if you want the JSON for the returned record - otherwise, it will return the
# record URI only
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
find_do = client.get("repositories/:repo_id:/find_by_id/digital_objects",
params={"digital_object_id[]": "hello_im_a_digobj_id",
"resolve[]": "digital_objects"})
# Replace :repo_id: with the repository ID, "im_a_digobj_id" with the digital object ID you are searching for, and
# only add "resolve[]=digital_objects" if you want the JSON for the returned record - otherwise, it will return
# the record URI only
print(find_do.json())
# Output (dict): {'digital_objects': [{'ref': '/repositories/2/digital_objects/1', '_resolved':...}]}
Endpoint
[:GET] /repositories/:repo_id/find_by_id/digital_objects
Description
Find Digital Objects by digital_object_id.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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 -s -F password="admin" "http://localhost:8089/users/admin/login"
# Replace "admin" with your password and "http://localhost:8089/users/admin/login" with your ASpace API URL
# followed by "/users/{your_username}/login"
set SESSION="session_id"
# If using Git Bash, replace set with export
# Finding resources with one identifier field
curl -H "X-ArchivesSpace-Session: $SESSION" //
-G http://localhost:8089/repositories/:repo_id:/find_by_id/resources //
--data-urlencode 'identifier[]=["your_id_here"]' --data-urlencode 'resolve[]=resources'
# Replace "http://localhost:8089" with your ASpace API URL, :repo_id: with the repository ID,
# "your_id_here" with the ID you are searching for, and only add --data-urlencode 'resolve[]=resources' if you
# want the JSON for the returned record - otherwise, it will return the record URI only
# Output: {"resources":[{"ref":"/repositories/2/resources/476","_resolved":{"lock_version":0,"title":...}
# Finding resources with multiple identifier fields
curl -H "X-ArchivesSpace-Session: $SESSION" //
-G http://localhost:8089/repositories/:repo_id:/find_by_id/resources //
--data-urlencode 'identifier[]=["test","1234","abcd","5678"]' --data-urlencode 'resolve[]=resources'
# Replace "http://localhost:8089" with your ASpace API URL, :repo_id: with the repository ID,
# "test", "1234", "abcd", and "5678" with the ID you are searching for, and only add
# --data-urlencode 'resolve[]=resources' if you want the JSON for the returned record - otherwise, it will return
# the record URI only
# Output: {"resources":[{"ref":"/repositories/2/resources/476","_resolved":{"lock_version":0,"title":...}
# Finding multiple resources using identifier fields
curl -H "X-ArchivesSpace-Session: $SESSION" //
-G http://http://localhost:8089/repositories/:repo_id:/find_by_id/resources //
--data-urlencode 'identifier[]=["test","1234","abcd","5678"]' --data-urlencode 'identifier[]=["your_id_here"]' //
--data-urlencode 'resolve[]=resources'
# Replace "http://localhost:8089" with your ASpace API URL, :repo_id: with the repository ID,
# "test", "1234", "abcd", "5678", and "your_id_here" with the ID you are searching for, and only add
# --data-urlencode 'resolve[]=resources' if you want the JSON for the returned record - otherwise, it will return
# the record URI only
# Output: {"resources":[{"ref":"/repositories/2/resources/455"},{"ref":"/repositories/2/resources/456"}]}
# Finding resources with ARKs
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/:repo_id:/find_by_id/resources?ark[]=ark%3A%2F####%2F######;resolve[]=resources"
# Replace "http://localhost:8089" with your ASpace API URL, :repo_id: with the repository ID,
# ark%3A%2F####%2F###### with the ARK you are searching for - NOTE, make sure to encode any characters like
# : into %3A and / into %2F - and only add resolve[]=resources if you want the JSON for the returned record -
# otherwise, it will return the record URI only
# Output: {"resources":[{"ref":"/repositories/2/resources/455"},{"ref":"/repositories/2/resources/456"}]}
# If you are having trouble resolving the URL, try using the --data-urlencode parameter, like so:
# curl -H "X-ArchivesSpace-Session: $SESSION" -G //
# http://localhost:8089/repositories/2/find_by_id/resources --data-urlencode 'ark[]=ark%3A%2F####%2F######'
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
# Finding resources with one identifier field
find_single_resid = client.get('repositories/:repo_id:/find_by_id/resources', params={'identifier[]':
['["your_id_here"]'],
'resolve[]': 'resources'})
# Replace :repo_id: with the repository ID the resource is in, "your_id_here" with the ID you are searching for,
# and only add 'resolve[]': 'resources' if you want the JSON for the returned record - otherwise, it will return
# the record URI only
print(find_single_resid.json())
# Output (dict): {'resources': [{'ref': '/repositories/2/resources/407', '_resolved': {'lock_version': 0,...}
# Finding resources with multiple identifier fields
find_multi_resid = client.get('repositories/:repo_id:/find_by_id/resources', params={'identifier[]':
['["test", "1234", "abcd", "5678"]'],
'resolve[]': 'resources'})
# Replace :repo_id: with the repository ID the resource is in, "test", "1234", "abcd", and "5678" with the ID
# you are searching for, and only add 'resolve[]': 'resources' if you want the JSON for the returned record -
# otherwise, it will return the record URI only
print(find_multi_resid.json())
# Output (dict): {'resources': [{'ref': '/repositories/2/resources/407', '_resolved': {'lock_version': 0,...}
# Finding resources with ARKs
find_res_ark = client.get("repositories/:repo_id:/find_by_id/resources",
params={"ark[]": "ark:/######/##/##",
"resolve[]": "resources"})
# Replace :repo_id: with the repository ID, "ark:/######/##/##" with the ark ID you are searching for, and only
# add "resolve[]": "resources" if you want the JSON for the returned record - otherwise, it will return
# the record URI only
print(find_res_ark.json())
# Output (dict): {'resources': [{'ref': '/repositories/2/resources/407', '_resolved': {'lock_version': 0,...}
Endpoint
[:GET] /repositories/:repo_id/find_by_id/resources
Description
Find Resources by their identifiers.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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 |
ark |
An ARK attached to a resource record (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 Top Containers by their indicators or barcodes
curl -s -F password="admin" "http://localhost:8089/users/admin/login"
# Replace "admin" with your password and "http://localhost:8089/users/admin/login" with your ASpace API URL
# followed by "/users/{your_username}/login"
set SESSION="session_id"
# If using Git Bash, replace set with export
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/:repo_id:/find_by_id/top_containers?indicator[]=123;resolve[]=top_containers"
# Replace "http://localhost:8089" with your ASpace API URL, :repo_id: with the repository ID,
# "123" with the indicator you are searching for, and only add
# "resolve[]=top_containers" if you want the JSON for the returned record - otherwise, it will return the
# record URI only
curl -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/:repo_id:/find_by_id/top_containers?barcode[]=123456789;resolve[]=top_containers"
# Replace "http://localhost:8089" with your ASpace API URL, :repo_id: with the repository ID,
# "123456789" with the barcode you are searching for, and only add
# "resolve[]=top_containers" if you want the JSON for the returned record - otherwise, it will return the
# record URI only
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
find_tc = client.get("repositories/:repo_id:/find_by_id/top_containers",
params={"indicator[]": "123",
"resolve[]": "top_containers"})
# Replace :repo_id: with the repository ID, "123" with the indicator you are searching for, and
# only add "resolve[]=digital_objects" if you want the JSON for the returned record - otherwise, it will return
# the record URI only
print(find_tc.json())
# Output (dict): {'top_containers': [{'ref': '/repositories/2/top_containers/9876', '_resolved':...}]}
find_tc = client.get("repositories/:repo_id:/find_by_id/top_containers",
params={"barcode[]": "123456789",
"resolve[]": "top_containers"})
# Replace :repo_id: with the repository ID, "123456789" with the barcode you are searching for, and
# only add "resolve[]=digital_objects" if you want the JSON for the returned record - otherwise, it will return
# the record URI only
print(find_tc.json())
# Output (dict): {'top_containers': [{'ref': '/repositories/2/top_containers/9876', '_resolved':...}]}
Endpoint
[:GET] /repositories/:repo_id/find_by_id/top_containers
Description
Find Top Containers by their indicators or barcodes.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
repo_id |
The Repository ID
Note: The Repository must exist |
Integer | |
indicator |
A top container's indicator (param may be repeated) | [String] | true |
barcode |
A top container's barcode (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
Create a group within a repository
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/groups" \
-d '{
"jsonmodel_type": "group",
"description": "Description: 8",
"group_code": "JKE650Y"
}'
Endpoint
[:POST] /repositories/:repo_id/groups
Description
Create a group within a repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/groups?group_code="
Endpoint
[:GET] /repositories/:repo_id/groups
Description
Get a list of groups for a repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/groups/1" \
-d '{
"jsonmodel_type": "group",
"description": "Description: 8",
"group_code": "JKE650Y",
"with_members": "BooleanParam"
}'
Endpoint
[:POST] /repositories/:repo_id/groups/:id
Description
Update a group.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/groups/1?with_members=BooleanParam"
Endpoint
[:GET] /repositories/:repo_id/groups/:id
Description
Get a group by ID.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/repositories/1/groups/1"
Endpoint
[:DELETE] /repositories/:repo_id/groups/:id
Description
Delete a group by ID.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_repository
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/jobs" \
-d '{
"jsonmodel_type": "job",
"status": "queued",
"has_modified_records": false,
"inactive_record": false,
"job": {
"jsonmodel_type": "import_job",
"filenames": [
"JCW437231",
"H928VXV",
"PHSE387",
"JFCL523"
],
"import_type": "ead_xml"
}
}'
Endpoint
[:POST] /repositories/:repo_id/jobs
Description
Create a new job.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- create_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/1/jobs?page=1"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/jobs?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/jobs?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /repositories/:repo_id/jobs
Description
Get a list of Jobs for a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
repo_id |
The Repository ID
Note: The Repository must exist |
Integer |
Returns
200 -- [(:job)]
Delete a Job
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/repositories/1/jobs/1"
Endpoint
[:DELETE] /repositories/:repo_id/jobs/:id
Description
Delete a Job.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- cancel_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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/jobs/1?resolve%5B%5D=repository"
Endpoint
[:GET] /repositories/:repo_id/jobs/:id
Description
Get a Job by ID.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/jobs/1/cancel"
Endpoint
[:POST] /repositories/:repo_id/jobs/:id/cancel
Description
Cancel a Job.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- cancel_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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/jobs/1/log?offset=NonNegativeInteger"
Endpoint
[:GET] /repositories/:repo_id/jobs/:id/log
Description
Get a Job's log by ID.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/jobs/1/output_files"
Endpoint
[:GET] /repositories/:repo_id/jobs/:id/output_files
Description
Get a list of Job's output files by ID.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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/1/jobs/1/records?page=1"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/jobs/1/records?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/jobs/1/records?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /repositories/:repo_id/jobs/:id/records
Description
Get a Job's list of created URIs.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/jobs/active?resolve%5B%5D=repository"
Endpoint
[:GET] /repositories/:repo_id/jobs/active
Description
Get a list of all active Jobs for a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_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/1/jobs/archived?resolve%5B%5D=repository&page=1"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/jobs/archived?resolve%5B%5D=repository&all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/jobs/archived?resolve%5B%5D=repository&id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /repositories/:repo_id/jobs/archived
Description
Get a list of all archived Jobs for a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/jobs/import_types"
Endpoint
[:GET] /repositories/:repo_id/jobs/import_types
Description
List all supported import job types.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/jobs_with_files"
Endpoint
[:POST] /repositories/:repo_id/jobs_with_files
Description
Create a new job and post input files.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- create_job
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)}
Update the position of a Repository
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/position"
Endpoint
[:POST] /repositories/:repo_id/position
Description
Update the position of a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- administer_system
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
repo_id |
The Repository ID
Note: The Repository must exist |
Integer | |
position |
The target position for the repository | Integer |
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
400 -- {:error => (description of error)}
Create a Preferences record
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/preferences" \
-d '{
"jsonmodel_type": "preference",
"defaults": {
"jsonmodel_type": "defaults",
"show_suppressed": false,
"publish": false,
"rde_sort_alpha": true,
"include_unpublished": false,
"default_values": false,
"digital_object_spawn": false
}
}'
Endpoint
[:POST] /repositories/:repo_id/preferences
Description
Create a Preferences record.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/preferences?user_id=1"
Endpoint
[:GET] /repositories/:repo_id/preferences
Description
Get a list of Preferences for a Repository and optionally a user.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/preferences/1"
Endpoint
[:GET] /repositories/:repo_id/preferences/:id
Description
Get a Preferences record.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/preferences/1" \
-d '{
"jsonmodel_type": "preference",
"defaults": {
"jsonmodel_type": "defaults",
"show_suppressed": false,
"publish": false,
"rde_sort_alpha": true,
"include_unpublished": false,
"default_values": false,
"digital_object_spawn": false
}
}'
Endpoint
[:POST] /repositories/:repo_id/preferences/:id
Description
Update a Preferences record.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/repositories/1/preferences/1"
Endpoint
[:DELETE] /repositories/:repo_id/preferences/:id
Description
Delete a Preferences record.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_archival_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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/preferences/defaults?username="
Endpoint
[:GET] /repositories/:repo_id/preferences/defaults
Description
Get the default set of Preferences for a Repository and optionally a user.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/rde_templates" \
-d '{
"jsonmodel_type": "rde_template",
"order": [
"KX111J712"
],
"visible": [
"P323952ST"
],
"name": "V993MV512",
"record_type": "archival_object"
}'
Endpoint
[:POST] /repositories/:repo_id/rde_templates
Description
Create an RDE template.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/rde_templates"
Endpoint
[:GET] /repositories/:repo_id/rde_templates
Description
Get a list of RDE Templates.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/rde_templates/1"
Endpoint
[:GET] /repositories/:repo_id/rde_templates/:id
Description
Get an RDE template record.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/repositories/1/rde_templates/1"
Endpoint
[:DELETE] /repositories/:repo_id/rde_templates/:id
Description
Delete an RDE Template.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_rde_templates
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/required_fields/" \
-d '{
"jsonmodel_type": "required_fields",
"subrecord_requirements": [
{
"jsonmodel_type": "subrecord_requirement",
"required_fields": [
"descriptive_note"
],
"required": true,
"property": "metadata_rights_declarations",
"record_type": "metadata_rights_declaration"
}
]
}'
Endpoint
[:POST] /repositories/:repo_id/required_fields/:record_type
Description
Require fields for a record type.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/required_fields/"
Endpoint
[:GET] /repositories/:repo_id/required_fields/:record_type
Description
Get required fields for a record type.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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.xml/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
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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 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&include_uris=true&numbered_cs=true&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,
"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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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 |
include_uris |
Include unitid tags containing ArchivesSpace URIs | RESTHelpers::BooleanParam | true |
numbered_cs |
Use numbered |
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.xml/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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/resources" \
-d '{
"jsonmodel_type": "resource",
"extents": [
{
"jsonmodel_type": "extent",
"portion": "whole",
"number": "69",
"extent_type": "Image",
"dimensions": "V419890IH",
"physical_details": "54IDKH"
}
],
"lang_materials": [
{
"jsonmodel_type": "lang_material",
"notes": [
],
"language_and_script": {
"jsonmodel_type": "language_and_script",
"language": "hsb",
"script": "Soyo"
}
}
],
"dates": [
{
"jsonmodel_type": "date",
"date_type": "single",
"label": "creation",
"begin": "2005-05-13",
"end": "2005-05-13",
"certainty": "inferred",
"era": "ce",
"calendar": "gregorian",
"expression": "G947QDW"
},
{
"jsonmodel_type": "date",
"date_type": "single",
"label": "creation",
"begin": "1994-09-06",
"certainty": "inferred",
"era": "ce",
"calendar": "gregorian",
"expression": "ARU244N"
}
],
"is_slug_auto": true,
"restrictions": false,
"is_finding_aid_status_published": true,
"revision_statements": [
{
"jsonmodel_type": "revision_statement",
"date": "GQL241526",
"description": "TNR446420"
}
],
"instances": [
{
"jsonmodel_type": "instance",
"is_representative": false,
"instance_type": "audio",
"sub_container": {
"jsonmodel_type": "sub_container",
"top_container": {
"ref": "/repositories/99/top_containers/99"
},
"type_2": "carton",
"indicator_2": "X394SX164",
"barcode_2": "S58373KR",
"type_3": "object",
"indicator_3": "KYWSY"
}
}
],
"title": "Resource Title: <emph render='italic'>5</emph>",
"id_0": "175LW660J",
"level": "subseries",
"finding_aid_description_rules": "dacs",
"ead_id": "T358WEN",
"finding_aid_date": "358294UEC",
"finding_aid_series_statement": "W493AET",
"finding_aid_language": "arw",
"finding_aid_script": "Zzzz",
"finding_aid_language_note": "317530F346J",
"finding_aid_note": "SHJ512V",
"ead_location": "57765NTI"
}'
Endpoint
[:POST] /repositories/:repo_id/resources
Description
Create a Resource.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_resource_record
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/1/resources?page=1"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/resources?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/resources?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /repositories/:repo_id/resources
Description
Get a list of Resources for a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
repo_id |
The Repository ID
Note: The Repository must exist |
Integer |
Returns
200 -- [(:resource)]
Get a Resource
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/resources/1?resolve%5B%5D=repository&resolve%5B%5D=tree"
Endpoint
[:GET] /repositories/:repo_id/resources/:id
Description
Get a Resource.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/resources/1" \
-d '{
"jsonmodel_type": "resource",
"extents": [
{
"jsonmodel_type": "extent",
"portion": "whole",
"number": "69",
"extent_type": "Image",
"dimensions": "V419890IH",
"physical_details": "54IDKH"
}
],
"lang_materials": [
{
"jsonmodel_type": "lang_material",
"notes": [
],
"language_and_script": {
"jsonmodel_type": "language_and_script",
"language": "hsb",
"script": "Soyo"
}
}
],
"dates": [
{
"jsonmodel_type": "date",
"date_type": "single",
"label": "creation",
"begin": "2005-05-13",
"end": "2005-05-13",
"certainty": "inferred",
"era": "ce",
"calendar": "gregorian",
"expression": "G947QDW"
},
{
"jsonmodel_type": "date",
"date_type": "single",
"label": "creation",
"begin": "1994-09-06",
"certainty": "inferred",
"era": "ce",
"calendar": "gregorian",
"expression": "ARU244N"
}
],
"is_slug_auto": true,
"restrictions": false,
"is_finding_aid_status_published": true,
"revision_statements": [
{
"jsonmodel_type": "revision_statement",
"date": "GQL241526",
"description": "TNR446420"
}
],
"instances": [
{
"jsonmodel_type": "instance",
"is_representative": false,
"instance_type": "audio",
"sub_container": {
"jsonmodel_type": "sub_container",
"top_container": {
"ref": "/repositories/99/top_containers/99"
},
"type_2": "carton",
"indicator_2": "X394SX164",
"barcode_2": "S58373KR",
"type_3": "object",
"indicator_3": "KYWSY"
}
}
],
"title": "Resource Title: <emph render='italic'>5</emph>",
"id_0": "175LW660J",
"level": "subseries",
"finding_aid_description_rules": "dacs",
"ead_id": "T358WEN",
"finding_aid_date": "358294UEC",
"finding_aid_series_statement": "W493AET",
"finding_aid_language": "arw",
"finding_aid_script": "Zzzz",
"finding_aid_language_note": "317530F346J",
"finding_aid_note": "SHJ512V",
"ead_location": "57765NTI"
}'
Endpoint
[:POST] /repositories/:repo_id/resources/:id
Description
Update a Resource.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_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 |
Accepts Payload of Type
JSONModel(:resource)
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
400 -- {:error => (description of error)}
Delete a Resource
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/repositories/1/resources/1"
Endpoint
[:DELETE] /repositories/:repo_id/resources/:id
Description
Delete a Resource.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_archival_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
Move existing Archival Objects to become children of a Resource
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/resources/1/accept_children"
Endpoint
[:POST] /repositories/:repo_id/resources/:id/accept_children
Description
Move existing Archival Objects to become children of a Resource.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_resource_record
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)}
Get the ARK name object for a Resource
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/resources/1/ark_name"
Endpoint
[:GET] /repositories/:repo_id/resources/:id/ark_name
Description
Get the ARK name object for a Resource.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- administer_system
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 -- (:ark_name)
Update the ARK name for a Resource
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/resources/1/ark_name" \
-d '{
"jsonmodel_type": "ark_name",
"previous": [
"PRVA577"
]
}'
Endpoint
[:POST] /repositories/:repo_id/resources/:id/ark_name
Description
Update the ARK name for a Resource.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- administer_system
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(:ark_name)
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
400 -- {: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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_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 |
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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)
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/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).
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/resources/1/publish"
Endpoint
[:POST] /repositories/:repo_id/resources/:id/publish
Description
Publish a resource and all its sub-records and components.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_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 |
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
400 -- {:error => (description of error)}
Suppress this record
curl -s -F password="password" "http://localhost:8089/users/:your_username:/login"
# Replace "password" with your password, "http://localhost:8089 with your ASpace API URL, and :your_username: with
# your ArchivesSpace username
set SESSION="session_id"
# If using Git Bash, replace set with export
curl -X POST -H "X-ArchivesSpace-Session: $SESSION" //
"http://localhost:8089/repositories/:repo_id:/resources/:resource_id:/suppressed?suppressed=true"
# Replace http://localhost:8089 with your ArchivesSpace API URL, :repo_id: with the ArchivesSpace repository ID,
# :resource_id: with the ArchivesSpace ID of the resource, and change the "suppressed" value to true to suppress
# the resource or false to unsuppress the resource
# Output: {"status":"Suppressed","id":5812,"suppressed_state":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
suppress_resource = client.post("/repositories/:repo_id:/resources/:resource_id:/suppressed",
params={"suppressed": False})
# Replace :repo_id: with the ArchivesSpace repository ID, :resource_id: with the ArchivesSpace ID of the resource,
# and change the "suppressed" value to True to suppress the resource or False to unsuppress the resource
print(suppress_resource.json())
# Output: {'status': 'Suppressed', 'id': 5812, 'suppressed_state': True}
Endpoint
[:POST] /repositories/:repo_id/resources/:id/suppressed
Description
Suppress this record.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- suppress_archival_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 digitial objects for archival objects of a resource
# Saves the csv to file 'resource_1_digital_object_creation.csv'
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/2/resources/1/templates/digital_object_creation.csv" \
> resource_1_digital_object_creation.csv
from asnake.client import ASnakeClient
client = ASnakeClient()
client.authorize()
with open('resource_1_digital_object_creation.csv', 'wb') as file:
resp = client.get('repositories/2/resources/1/templates/digital_object_creation.csv')
if resp.status_code == 200:
file.write(resp.content)
Endpoint
[:GET] /repositories/:repo_id/resources/:id/templates/digital_object_creation.csv
Description
Get a CSV template useful for bulk-creating digitial objects for archival objects of a resource.
This method returns a spreadsheet representing all the archival objects in a resource, with the following fields:
- Reference Fields (Non-editable):
- Resource URI: Resource URI
- Archival Object URI: Archival Object URI
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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 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:
- Reference Fields (Non-editable):
- Archival Object: ID, Ref ID, and Component ID
- Resource: Title and Identifier
- Editable Fields:
- Top Container: Instance type, Type, Indicator, and Barcode
- Child Container: Type, Indicator, and Barcode
- Location: ID (the location must already exist in the system)
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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.
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/resources/1/top_containers?resolve%5B%5D="
Endpoint
[:GET] /repositories/:repo_id/resources/:id/top_containers
Description
Get Top Containers linked to a published resource and published archival ojbects contained within..
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/resources/1/transfer"
Endpoint
[:POST] /repositories/:repo_id/resources/:id/transfer
Description
Transfer this record to a different repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_resource_record
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
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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:
title -- the collection title
uri -- the collection URI
child_count -- the number of immediate children
waypoints -- the number of "waypoints" those children are grouped into
waypoint_size -- the number of children in each waypoint
position -- the logical position of this record within its subtree
precomputed_waypoints -- a collection of arrays (keyed on child URI) in the same format as returned by the '/waypoint' endpoint. Since a fetch for a given node is almost always followed by a fetch of the first waypoint, using the information in this structure can save a backend call.
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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:
node -- the URI of the node to next expand
offset -- the waypoint number within
node
that contains the next entry in the path (or the desired record, if we're at the end of the path)
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.
Includes the first set of immediate children, which are grouped into 'waypoints'. Additional API requests may be required to retrieve all children if there are too many to include in the first response. See Returns below for details.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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:
child_count (Integer) -- Number of immediate children of the root record
waypoints (Integer) -- Number of "waypoints" those children are grouped into. The first waypoint is precomputed and included in the response (see precomputed_wayoints below). Additional waypoints can be retireved via
/repositories/:repo_id/:record_type/:id/tree/waypoint
waypoint_size (Integer) -- The limit to the number of children included in each waypoint
title (String) -- Record title
uri (String) -- Record URI
precomputed_waypoints (JSON) -- A nested JSON object containing the first "waypoint" (set of children), limited to
waypoint_size
. The JSON object is structured as follows:{ "": { "0": [<JSON Object>] }
.precomputed_waypoints[''][0]
is an array of JSON objects representing immediate children of the root record. The format of this object is similar to the object returned by:/repositories/:repo_id/:record_type/:id/tree/node
but without its own precomputed_waypoints.
Resource records only:
- level (String) -- Level of arrangement (e.g. collection)
Resource and Classification records only:
- identifier (String) -- The root record identifier
Digital Object records only:
digital_object_type (String) -- Type of the digital object (e.g. still_image)
file_uri_summary (String) -- The file uri of the root digital object
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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:
title -- the record's title
uri -- the record URI
position -- the logical position of this record within its subtree
parent_id -- the internal ID of this document's parent
Unpublish a resource and all its sub-records and components
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/resources/1/unpublish"
Endpoint
[:POST] /repositories/:repo_id/resources/:id/unpublish
Description
Unpublish a resource and all its sub-records and components.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_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 |
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.xml/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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/search?q=&aq=%7B%22jsonmodel_type%22%3D%3E%22advanced_query%22%2C+%22query%22%3D%3E%7B%22jsonmodel_type%22%3D%3E%22boolean_query%22%2C+%22op%22%3D%3E%22AND%22%2C+%22subqueries%22%3D%3E%5B%7B%22jsonmodel_type%22%3D%3E%22date_field_query%22%2C+%22negated%22%3D%3Efalse%2C+%22field%22%3D%3E%22974NELC%22%2C+%22value%22%3D%3E%222008-11-21%22%7D%5D%7D%7D&type%5B%5D=&sort=&facet%5B%5D=&facet_mincount=1&filter=%7B%22jsonmodel_type%22%3D%3E%22advanced_query%22%2C+%22query%22%3D%3E%7B%22jsonmodel_type%22%3D%3E%22boolean_query%22%2C+%22op%22%3D%3E%22AND%22%2C+%22subqueries%22%3D%3E%5B%7B%22jsonmodel_type%22%3D%3E%22date_field_query%22%2C+%22negated%22%3D%3Efalse%2C+%22field%22%3D%3E%22974NELC%22%2C+%22value%22%3D%3E%222008-11-21%22%7D%5D%7D%7D&filter_query%5B%5D=&exclude%5B%5D=&hl=BooleanParam&root_record=&dt=&fields%5B%5D="
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/search" \
-d '{
"aq": {
"jsonmodel_type": "advanced_query",
"query": {
"jsonmodel_type": "boolean_query",
"op": "AND",
"subqueries": [
{
"jsonmodel_type": "date_field_query",
"negated": false,
"field": "974NELC",
"value": "2008-11-21"
}
]
}
},
"facet_mincount": "1",
"filter": {
"jsonmodel_type": "advanced_query",
"query": {
"jsonmodel_type": "boolean_query",
"op": "AND",
"subqueries": [
{
"jsonmodel_type": "date_field_query",
"negated": false,
"field": "974NELC",
"value": "2008-11-21"
}
]
}
},
"hl": "BooleanParam"
}'
Endpoint
[:GET, :POST] /repositories/:repo_id/search
Description
Search this repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/top_containers" \
-d '{
"jsonmodel_type": "top_container",
"indicator": "GUWIG",
"type": "box",
"barcode": "c556f20402c6bec28ea28c9fceb17b92",
"ils_holding_id": "CT724555Q",
"ils_item_id": "259500HQG",
"exported_to_ils": "2024-12-02T17:45:31+02:00"
}'
Endpoint
[:POST] /repositories/:repo_id/top_containers
Description
Create a top container.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_container_record
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/1/top_containers?page=1"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/top_containers?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/top_containers?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /repositories/:repo_id/top_containers
Description
Get a list of TopContainers for a Repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/top_containers/1" \
-d '{
"jsonmodel_type": "top_container",
"indicator": "GUWIG",
"type": "box",
"barcode": "c556f20402c6bec28ea28c9fceb17b92",
"ils_holding_id": "CT724555Q",
"ils_item_id": "259500HQG",
"exported_to_ils": "2024-12-02T17:45:31+02:00"
}'
Endpoint
[:POST] /repositories/:repo_id/top_containers/:id
Description
Update a top container.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_container_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(:top_container)
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
Get a top container by ID
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/top_containers/1?resolve%5B%5D="
Endpoint
[:GET] /repositories/:repo_id/top_containers/:id
Description
Get a top container by ID.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/repositories/1/top_containers/1"
Endpoint
[:DELETE] /repositories/:repo_id/top_containers/:id
Description
Delete a top container.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_container_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
Update container profile for a batch of top containers
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/top_containers/batch/container_profile"
Endpoint
[:POST] /repositories/:repo_id/top_containers/batch/container_profile
Description
Update container profile for a batch of top containers.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_container_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/top_containers/batch/ils_holding_id"
Endpoint
[:POST] /repositories/:repo_id/top_containers/batch/ils_holding_id
Description
Update ils_holding_id for a batch of top containers.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_container_record
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
.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_container_record
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
# assign barcodes in bulk by posting a hash
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/top_containers/bulk/barcodes" \
-d '{
"repo_id": 1,
"barcode_data": "{\"/repositories/:repo_id/top_containers/1\":\"8675309\"}"
}'
Endpoint
[:POST] /repositories/:repo_id/top_containers/bulk/barcodes
Description
Bulk update barcodes.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_container_record
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 indicators
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/top_containers/bulk/indicators"
Endpoint
[:POST] /repositories/:repo_id/top_containers/bulk/indicators
Description
Bulk update indicators.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_container_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/top_containers/bulk/locations"
Endpoint
[:POST] /repositories/:repo_id/top_containers/bulk/locations
Description
Bulk update locations.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_container_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/top_containers/search?q=&aq=%7B%22jsonmodel_type%22%3D%3E%22advanced_query%22%2C+%22query%22%3D%3E%7B%22jsonmodel_type%22%3D%3E%22boolean_query%22%2C+%22op%22%3D%3E%22AND%22%2C+%22subqueries%22%3D%3E%5B%7B%22jsonmodel_type%22%3D%3E%22date_field_query%22%2C+%22negated%22%3D%3Efalse%2C+%22field%22%3D%3E%22974NELC%22%2C+%22value%22%3D%3E%222008-11-21%22%7D%5D%7D%7D&type%5B%5D=&sort=&facet%5B%5D=&facet_mincount=1&filter=%7B%22jsonmodel_type%22%3D%3E%22advanced_query%22%2C+%22query%22%3D%3E%7B%22jsonmodel_type%22%3D%3E%22boolean_query%22%2C+%22op%22%3D%3E%22AND%22%2C+%22subqueries%22%3D%3E%5B%7B%22jsonmodel_type%22%3D%3E%22date_field_query%22%2C+%22negated%22%3D%3Efalse%2C+%22field%22%3D%3E%22974NELC%22%2C+%22value%22%3D%3E%222008-11-21%22%7D%5D%7D%7D&filter_query%5B%5D=&exclude%5B%5D=&hl=BooleanParam&root_record=&dt=&fields%5B%5D="
Endpoint
[:GET] /repositories/:repo_id/top_containers/search
Description
Search for top containers.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_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 -- [(:top_container)]
Transfer all records to a different repository
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/repositories/1/transfer"
Endpoint
[:POST] /repositories/:repo_id/transfer
Description
Transfer all records to a different repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- transfer_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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/1/users/1"
Endpoint
[:GET] /repositories/:repo_id/users/:id
Description
Get a user's details including their groups for the current repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/with_agent" \
-d '{
"jsonmodel_type": "repository_with_agent",
"repository": {
"jsonmodel_type": "repository",
"name": "Description: 5",
"is_slug_auto": true,
"repo_code": "testrepo_2_1733154332",
"org_code": "YR732X30",
"image_url": "http://www.example-14-1733154332.com",
"url": "http://www.example-15-1733154332.com",
"country": "US"
},
"agent_representation": {
"jsonmodel_type": "agent_corporate_entity",
"agent_contacts": [
{
"jsonmodel_type": "agent_contact",
"telephones": [
{
"jsonmodel_type": "telephone",
"number": "121 0454 713",
"ext": "192GGJ71"
}
],
"notes": [
{
"jsonmodel_type": "note_contact_note",
"date_of_contact": "424327269O442",
"contact_notes": "QMHDV"
}
],
"is_representative": false,
"name": "Name Number 11",
"address_1": "F147110603924",
"address_2": "757LR90A",
"region": "U700499Y142",
"country": "DEPA235",
"post_code": "121Q302P790"
}
],
"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"
}
],
"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": "none",
"primary_name": "Name Number 10",
"subordinate_name_1": "MN789841X",
"subordinate_name_2": "FU178DS",
"number": "T148XLY",
"sort_name": "SORT r - 7",
"qualifier": "OCLKF",
"dates": "L79784982U",
"authority_id": "http://www.example-16-1733154332.com",
"source": "ingest"
}
],
"agent_type": "agent_corporate_entity"
}
}'
Endpoint
[:POST] /repositories/with_agent
Description
Create a Repository with an agent representation.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- create_repository
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
# auto-generated example
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.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/repositories/with_agent/1" \
-d '{
"jsonmodel_type": "repository_with_agent",
"repository": {
"jsonmodel_type": "repository",
"name": "Description: 5",
"is_slug_auto": true,
"repo_code": "testrepo_2_1733154332",
"org_code": "YR732X30",
"image_url": "http://www.example-14-1733154332.com",
"url": "http://www.example-15-1733154332.com",
"country": "US"
},
"agent_representation": {
"jsonmodel_type": "agent_corporate_entity",
"agent_contacts": [
{
"jsonmodel_type": "agent_contact",
"telephones": [
{
"jsonmodel_type": "telephone",
"number": "121 0454 713",
"ext": "192GGJ71"
}
],
"notes": [
{
"jsonmodel_type": "note_contact_note",
"date_of_contact": "424327269O442",
"contact_notes": "QMHDV"
}
],
"is_representative": false,
"name": "Name Number 11",
"address_1": "F147110603924",
"address_2": "757LR90A",
"region": "U700499Y142",
"country": "DEPA235",
"post_code": "121Q302P790"
}
],
"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"
}
],
"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": "none",
"primary_name": "Name Number 10",
"subordinate_name_1": "MN789841X",
"subordinate_name_2": "FU178DS",
"number": "T148XLY",
"sort_name": "SORT r - 7",
"qualifier": "OCLKF",
"dates": "L79784982U",
"authority_id": "http://www.example-16-1733154332.com",
"source": "ingest"
}
],
"agent_type": "agent_corporate_entity"
}
}'
Endpoint
[:POST] /repositories/with_agent/:id
Description
Update a repository with an agent representation.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- create_repository
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/schemas"
Endpoint
[:GET] /schemas
Description
Get all ArchivesSpace schemas.
Permissions
This endpoint does not require authentication.
Returns
200 -- ArchivesSpace (schemas)
Get an ArchivesSpace schema
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/schemas/"
Endpoint
[:GET] /schemas/:schema
Description
Get an ArchivesSpace schema.
Permissions
This endpoint does not require authentication.
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
schema |
Schema name to retrieve | String |
Returns
200 -- ArchivesSpace (:schema)
404 -- Schema not found
Search this archive
# basic search with 10 results per page
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/search?q=important+papers&aq=%23%3CJSONModel%28%3Aadvanced_query%29+%7B%22jsonmodel_type%22%3D%3E%22advanced_query%22%2C+%22query%22%3D%3E%7B%22jsonmodel_type%22%3D%3E%22boolean_query%22%2C+%22op%22%3D%3E%22AND%22%2C+%22subqueries%22%3D%3E%5B%7B%22jsonmodel_type%22%3D%3E%22date_field_query%22%2C+%22negated%22%3D%3Efalse%2C+%22comparator%22%3D%3E%22lesser_than%22%2C+%22field%22%3D%3E%22101C938YX%22%2C+%22value%22%3D%3E%221997-03-28%22%7D%5D%7D%7D%3E&page=1&page_size=10"
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/search" \
-d '{
"aq": {
"jsonmodel_type": "advanced_query",
"query": {
"jsonmodel_type": "boolean_query",
"op": "AND",
"subqueries": [
{
"jsonmodel_type": "date_field_query",
"negated": false,
"field": "974NELC",
"value": "2008-11-21"
}
]
}
},
"facet_mincount": "1",
"filter": {
"jsonmodel_type": "advanced_query",
"query": {
"jsonmodel_type": "boolean_query",
"op": "AND",
"subqueries": [
{
"jsonmodel_type": "date_field_query",
"negated": false,
"field": "974NELC",
"value": "2008-11-21"
}
]
}
},
"hl": "BooleanParam"
}'
Endpoint
[:GET, :POST] /search
Description
Search this archive.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_all_records
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/search/location_profile?q=&aq=%7B%22jsonmodel_type%22%3D%3E%22advanced_query%22%2C+%22query%22%3D%3E%7B%22jsonmodel_type%22%3D%3E%22boolean_query%22%2C+%22op%22%3D%3E%22AND%22%2C+%22subqueries%22%3D%3E%5B%7B%22jsonmodel_type%22%3D%3E%22date_field_query%22%2C+%22negated%22%3D%3Efalse%2C+%22field%22%3D%3E%22974NELC%22%2C+%22value%22%3D%3E%222008-11-21%22%7D%5D%7D%7D&type%5B%5D=&sort=&facet%5B%5D=&facet_mincount=1&filter=%7B%22jsonmodel_type%22%3D%3E%22advanced_query%22%2C+%22query%22%3D%3E%7B%22jsonmodel_type%22%3D%3E%22boolean_query%22%2C+%22op%22%3D%3E%22AND%22%2C+%22subqueries%22%3D%3E%5B%7B%22jsonmodel_type%22%3D%3E%22date_field_query%22%2C+%22negated%22%3D%3Efalse%2C+%22field%22%3D%3E%22974NELC%22%2C+%22value%22%3D%3E%222008-11-21%22%7D%5D%7D%7D&filter_query%5B%5D=&exclude%5B%5D=&hl=BooleanParam&root_record=&dt=&fields%5B%5D="
Endpoint
[:GET] /search/location_profile
Description
Search across Location Profiles.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/search/published_tree?node_uri="
Endpoint
[:GET] /search/published_tree
Description
Find the tree view for a particular archival record.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_all_records
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/search/record_types_by_repository?record_types%5B%5D=&repo_uri="
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/search/record_types_by_repository" \
-d '{
}'
Endpoint
[:GET, :POST] /search/record_types_by_repository
Description
Return the counts of record types of interest by repository.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_all_records
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' =>
Return a set of records by URI
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/search/records?uri%5B%5D=&resolve%5B%5D="
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/search/records" \
-d '{
}'
Endpoint
[:GET, :POST] /search/records
Description
Return a set of records by URI.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- view_all_records
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/search/repositories?q=&aq=%7B%22jsonmodel_type%22%3D%3E%22advanced_query%22%2C+%22query%22%3D%3E%7B%22jsonmodel_type%22%3D%3E%22boolean_query%22%2C+%22op%22%3D%3E%22AND%22%2C+%22subqueries%22%3D%3E%5B%7B%22jsonmodel_type%22%3D%3E%22date_field_query%22%2C+%22negated%22%3D%3Efalse%2C+%22field%22%3D%3E%22974NELC%22%2C+%22value%22%3D%3E%222008-11-21%22%7D%5D%7D%7D&type%5B%5D=&sort=&facet%5B%5D=&facet_mincount=1&filter=%7B%22jsonmodel_type%22%3D%3E%22advanced_query%22%2C+%22query%22%3D%3E%7B%22jsonmodel_type%22%3D%3E%22boolean_query%22%2C+%22op%22%3D%3E%22AND%22%2C+%22subqueries%22%3D%3E%5B%7B%22jsonmodel_type%22%3D%3E%22date_field_query%22%2C+%22negated%22%3D%3Efalse%2C+%22field%22%3D%3E%22974NELC%22%2C+%22value%22%3D%3E%222008-11-21%22%7D%5D%7D%7D&filter_query%5B%5D=&exclude%5B%5D=&hl=BooleanParam&root_record=&dt=&fields%5B%5D="
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/search/repositories" \
-d '{
"aq": {
"jsonmodel_type": "advanced_query",
"query": {
"jsonmodel_type": "boolean_query",
"op": "AND",
"subqueries": [
{
"jsonmodel_type": "date_field_query",
"negated": false,
"field": "974NELC",
"value": "2008-11-21"
}
]
}
},
"facet_mincount": "1",
"filter": {
"jsonmodel_type": "advanced_query",
"query": {
"jsonmodel_type": "boolean_query",
"op": "AND",
"subqueries": [
{
"jsonmodel_type": "date_field_query",
"negated": false,
"field": "974NELC",
"value": "2008-11-21"
}
]
}
},
"hl": "BooleanParam"
}'
Endpoint
[:GET, :POST] /search/repositories
Description
Search across repositories.
Permissions
This endpoint does not require authentication.
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 --
Get a Location by ID
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/space_calculator/buildings"
Endpoint
[:GET] /space_calculator/buildings
Description
Get a Location by ID.
Permissions
This endpoint does not require authentication.
Returns
200 -- Location building data as JSON
Calculate how many containers will fit in locations for a given building
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/space_calculator/by_building?container_profile_uri=&building=&floor=&room=&area="
Endpoint
[:GET] /space_calculator/by_building
Description
Calculate how many containers will fit in locations for a given building.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/space_calculator/by_location?container_profile_uri=&location_uris%5B%5D="
Endpoint
[:GET] /space_calculator/by_location
Description
Calculate how many containers will fit in a list of locations.
Permissions
This endpoint does not require authentication.
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_subject_record
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"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/subjects?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/subjects?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /subjects
Description
Get a list of Subjects.
Permissions
This endpoint does not require authentication.
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_subject_record
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.
Permissions
This endpoint does not require authentication.
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.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- delete_subject_record
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
id |
The ID of the record | Integer |
Returns
200 -- deleted
Get the systems events that have been logged for this install
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/system/events"
Endpoint
[:GET] /system/events
Description
Get the systems events that have been logged for this install.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- administer_system
Returns
200 -- String
403 -- Access Denied
Get the diagnostic information about the system
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/system/info"
Endpoint
[:GET] /system/info
Description
Get the diagnostic information about the system.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- administer_system
Returns
200 -- (:repository)
403 -- Access Denied
Get the log information and start the 15 second log recorder
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/system/log"
Endpoint
[:GET] /system/log
Description
Get the log information and start the 15 second log recorder.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- administer_system
Returns
200 -- String
403 -- Access Denied
Get a list of Terms matching a prefix
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/terms?q="
Endpoint
[:GET] /terms
Description
Get a list of Terms matching a prefix.
Permissions
This endpoint does not require authentication.
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
q |
The prefix to match | String |
Returns
200 -- [(:term)]
Get a stream of updated records
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/update-feed?last_sequence=1&resolve%5B%5D="
Endpoint
[:GET] /update-feed
Description
Get a stream of updated records.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- index_system
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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/update_monitor" \
-d '{
"jsonmodel_type": "active_edits",
"active_edits": [
{
"user": "username_1-1733154333",
"uri": "GSTKI",
"time": "507V584GY"
}
]
}'
Endpoint
[:POST] /update_monitor
Description
Refresh the list of currently known edits.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- mediate_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
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/users" \
-d '{
"jsonmodel_type": "user",
"is_active_user": true,
"is_admin": false,
"username": "username_2-1733154335",
"name": "Name Number 34"
}'
Endpoint
[:POST] /users
Description
Create a local user.
Permissions
This endpoint does not require authentication.
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"
# return an array of all the ids
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/users?all_ids=true"
# return first 5 records in the Fibonacci sequence
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/users?id_set=1%2C2%2C3%2C5%2C8"
Endpoint
[:GET] /users
Description
Get a list of users.
Permissions
This endpoint does not require authentication.
Parameters
Returns
200 -- [(:resource)]
Get a user's details (including their current permissions)
# auto-generated example
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).
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_users
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
id |
The username id to fetch | Integer |
Returns
200 -- (:user)
Update a user's account
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/users/1" \
-d '{
"jsonmodel_type": "user",
"is_active_user": true,
"is_admin": false,
"username": "username_2-1733154335",
"name": "Name Number 34"
}'
Endpoint
[:POST] /users/:id
Description
Update a user's account.
Permissions
This endpoint does not require authentication.
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X DELETE
"http://localhost:8089/users/1"
Endpoint
[:DELETE] /users/:id
Description
Delete a user.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_users
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
id |
The user to delete | Integer |
Returns
200 -- deleted
Set a user to be activated
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/users/1/activate"
Endpoint
[:GET] /users/:id/activate
Description
Set a user to be activated.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_users
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
id |
The username id to fetch | Integer |
Returns
200 -- (:user)
Set a user to be deactivated
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/users/1/deactivate"
Endpoint
[:GET] /users/:id/deactivate
Description
Set a user to be deactivated.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- manage_users
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
id |
The username id to fetch | Integer |
Returns
200 -- (:user)
Update a user's groups
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/users/1/groups"
Endpoint
[:POST] /users/:id/groups
Description
Update a user's groups.
Permissions
This endpoint does not require authentication.
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)}
Update user's own password
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/users/1/password" \
-d '{
}'
Endpoint
[:POST] /users/:id/password
Description
Update user's own password.
Permissions
This endpoint does not require authentication.
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
id |
The ID of the record | Integer | |
password |
The user's password | String |
Returns
200 -- {:status => "Updated", :id => (id of updated object)}
400 -- {:error => (description of error)}
Log in with token
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/users/example_username/"
Endpoint
[:POST] /users/:username/:token
Description
Log in with token.
Permissions
This endpoint does not require authentication.
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
username |
Your username | Username | |
token |
Your magic token | String |
Returns
200 -- Login accepted
403 -- Login failed
Become a different user
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/users/example_username/become-user"
Endpoint
[:POST] /users/:username/become-user
Description
Become a different user.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- become_user
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
username |
The username to become | Username |
Returns
200 -- Accepted
404 -- User not found
Log in
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
-X POST
"http://localhost:8089/users/example_username/login"
Endpoint
[:POST] /users/:username/login
Description
Log in.
Permissions
This endpoint does not require authentication.
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
username |
Your username | Username | |
password |
Your password | String | |
expiring |
If true, the session will expire after 3600 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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/users/complete?query="
Endpoint
[:GET] /users/complete
Description
Get a list of system users.
Permissions
This endpoint does not require authentication.
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
query |
A prefix to search for | String |
Returns
200 -- A list of usernames
Get the currently logged in user
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/users/current-user"
Endpoint
[:GET] /users/current-user
Description
Get the currently logged in user.
Permissions
This endpoint does not require authentication.
Returns
200 -- (:user)
404 -- Not logged in
Initiate a password reset process by sending a one-time token to the user
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/users/reset-password" \
-d '{
}'
Endpoint
[:POST] /users/reset-password
Description
Initiate a password reset process by sending a one-time token to the user.
Permissions
This endpoint does not require authentication.
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
email |
The requestor's email address | String |
Returns
200 -- password recovery email sent
Get the ArchivesSpace application version
curl -s -F password="admin" "http://localhost:8089/users/admin/login"
# Replace "admin" with your password and "http://localhost:8089/users/admin/login" with your ASpace API URL
# followed by "/users/{your_username}/login"
set SESSION="session_id"
# If using Git Bash, replace set with export
curl -H "X-ArchivesSpace-Session: $SESSION" "http://localhost:8089/version"
# Replace "http://localhost:8089" with your ASpace API URL
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
aspace_version = client.get("/version")
# Retrieves the ArchivesSpace version
print(aspace_version.content.decode())
# Output (str): ArchivesSpace (v3.1.1)
# Use .content.decode() to print the response since .json() returns a JSON decoding error
Endpoint
[:GET] /version
Description
Get the ArchivesSpace application version.
Permissions
This endpoint does not require authentication.
Returns
200 -- ArchivesSpace (version)
Create a Vocabulary
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/vocabularies" \
-d '{
"jsonmodel_type": "vocabulary",
"name": "Vocabulary 5 - 2024-12-02 17:45:32 +0200",
"ref_id": "vocab_ref_5 - 2024-12-02 17:45:32 +0200"
}'
Endpoint
[:POST] /vocabularies
Description
Create a Vocabulary.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_vocabulary_record
Accepts Payload of Type
JSONModel(:vocabulary)
Returns
200 -- {:status => "Created", :id => (id of created object), :warnings => {(warnings)}}
Get a list of Vocabularies
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/vocabularies?ref_id="
Endpoint
[:GET] /vocabularies
Description
Get a list of Vocabularies.
Permissions
This endpoint does not require authentication.
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
ref_id |
An alternate, externally-created ID for the vocabulary | String | true |
Returns
200 -- [(:vocabulary)]
Update a Vocabulary
# auto-generated example
curl -H 'Content-Type: text/json' -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/vocabularies/1" \
-d '{
"jsonmodel_type": "vocabulary",
"name": "Vocabulary 5 - 2024-12-02 17:45:32 +0200",
"ref_id": "vocab_ref_5 - 2024-12-02 17:45:32 +0200"
}'
Endpoint
[:POST] /vocabularies/:id
Description
Update a Vocabulary.
Permissions
This endpoint requires an authenticated user with at least one of the following permissions:
- update_vocabulary_record
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
# auto-generated example
curl -H "X-ArchivesSpace-Session: $SESSION" \
"http://localhost:8089/vocabularies/1"
Endpoint
[:GET] /vocabularies/:id
Description
Get a Vocabulary by ID.
Permissions
This endpoint does not require authentication.
Parameters
Parameter | Description | Type | Optional? |
---|---|---|---|
id |
The ID of the record | Integer |
Returns
200 -- OK
Get a list of Terms for a Vocabulary
# auto-generated example
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.
Permissions
This endpoint does not require authentication.
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 |
/batch_delete | POST | Carry out delete requests against a list of records |
/bulk_archival_object_updater/repositories/:repo_id/generate_spreadsheet | POST | Return XLSX |
/bulk_archival_object_updater/repositories/:repo_id/resources/:id/small_tree | GET | Generate the archival object tree for a resource |
/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. Allowed units include: inches, feet, centimeters, meters. |
/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 |
/oai | GET | Handle an OAI request |
/oai_config | GET | Get the OAI Config record |
/oai_config | POST | Update the OAI config record |
/oai_config/:id | POST | Update the OAI config record |
/oai_sample | GET | A HTML form to generate one sample OAI requests |
/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_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/ark_name | GET | Get the ARK name object for an ArchivalObject |
/repositories/:repo_id/archival_objects/:id/ark_name | POST | Update the ARK name for an ArchivalObject |
/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 of the same level 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/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/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/find_by_id/top_containers | GET | Find Top Containers by their indicators or barcodes |
/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/position | POST | Update the position of a Repository |
/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.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/ark_name | GET | Get the ARK name object for a Resource |
/repositories/:repo_id/resources/:id/ark_name | POST | Update the ARK name for 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/digital_object_creation.csv | GET | Get a CSV template useful for bulk-creating digitial objects for archival objects of a resource |
/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/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/indicators | POST | Bulk update indicators |
/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 all records 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 |
/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 |
/system/events | GET | Get the systems events that have been logged for this install |
/system/info | GET | Get the diagnostic information about the system |
/system/log | GET | Get the log information and start the 15 second log recorder |
/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/:id/password | POST | Update user's own password |
/users/:username/:token | POST | Log in with token |
/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 |
/users/reset-password | POST | Initiate a password reset process by sending a one-time token to the 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 Kittn API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Your request is invalid. |
401 | Unauthorized -- Your API key is wrong. |
403 | Forbidden -- The kitten requested is hidden for administrators only. |
404 | Not Found -- The specified kitten could not be found. |
405 | Method Not Allowed -- You tried to access a kitten with an invalid method. |
406 | Not Acceptable -- You requested a format that isn't json. |
410 | Gone -- The kitten requested has been removed from our servers. |
418 | I'm a teapot. |
429 | Too Many Requests -- You're requesting too many kittens! Slow down! |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |