Skip to content

Records

B2SHARE Record API:s#

Record creation workflow#

The B2SHARE record creation workflow is as follows:

  1. Create a draft record instructions
  2. Upload files to the draft
  3. Start file upload instructions
  4. Upload a file instructions
  5. Commit a file instructions
  6. Add the draft to a community instructions
  7. Publish the record instructions

Instructions for record versioning can be found here.

Instructions for record access can be found here.

B2SHARE record object#

{
    "access": {
        "record": "public",
        "files": "public",
        "embargo": {
            "active": false,
            "until": null,
            "reason": null
        }
    },
    "files": {
        "enabled": true,
        "default_preview": "file1.txt",
        "order": [
            "file1.txt",
            "file3.txt",
            "file2.txt"
        ]
    },
    "metadata": {
        "resource_types": [
            {
                "id": "resource_type-id"
            }
        ],
        "title": "title",
        "publication_date": "EDTF level 0 date or date interval",
        "creators": [
            {
                "person_or_org": {
                    "type": "personal/organizational",
                    "given_name": "",
                    "family_name": "",
                    "name": "",
                    "identifiers": [
                        {
                            "scheme": "scheme, e.g. orcid",
                            "identifier": ""
                        }
                    ]
                },
                "role": {"id": "role-id"},
                "affiliations": [
                    {
                        "id": "affiliation-id (ror)",
                        "name": ""
                    }
                ]
            }
        ],
        "additional_titles": [{
            "title": "",
            "type": {
                "id": "title-type-id",
                "title": {
                    "en": "Title type"
                }
            },
            "lang": {"id": "language-id"}
        }],
        "description": "supports html",
        "additional_descriptions": [{
            "description": "",
            "type": {
                "id": "description-type-id",
                "title": {
                    "en": "Description type"
                }
            },
            "lang": {"id": "language-id"}
        }],
        "rights": [{
            "id": "license-id",
            "title": {"en": ""},
            "description": {"en": ""},
            "link": ""
        }],
        "copyright": "",
        "contributors": [
            {
                "person_or_org": {
                    "type": "personal/organizational",
                    "given_name": "",
                    "family_name": "",
                    "name": "",
                    "identifiers": [
                        {
                            "scheme": "scheme, e.g. orcid",
                            "identifier": ""
                        }
                    ]
                },
                "role": {"id": "role-id"},
                "affiliations": [
                    {
                        "id": "affiliation-id (ror)",
                        "name": ""
                    }
                ]
            }
        ],
        "subjects": [{
            "id": "subject-id"
        }, {
            "subject": "a custom subject"
        }],
        "languages": [{
            "id": "language-id"
        }],
        "dates": [{
            "date": "EDTF level 0 date or date interval",
            "type": {
                "id": "date-type-id",
                "title": {
                    "en": ""
                }
            },
            "description": ""
        }],
        "version": "",
        "publisher": "Default B2SHARE",
        "alternate_identifiers": [{
            "identifier": "",
            "scheme": ""
        }],
        "related_identifiers": [{
            "identifier": "",
            "scheme": "",
            "relation_type": {
                "id": "relation-type-id",
                "title": {
                    "en": ""
                }
            },
            "resource_type": {
                "id": "resource-type-id",
                "title": {
                    "en": ""
                }
            }
        }],
        "locations": {
            "features": [{
                "geometry": {
                    "type": "",
                    "coordinates": []
                },
                "place": "",
                "description": ""
            }]
        },
        "funding": [{
            "funder": {
                "id": "funder-id (ror)"
            },
            "award": {
                "id": "award-id"
            }
        }, {
            "funder": {
                "name": ""
            },
            "award": {
                "title": {
                    "en": ""
                },
                "number": "",
                "identifiers": [{
                    "scheme": "",
                    "identifier": ""
                }]
            }
        }],
        "references": [{
            "reference": "",
            "identifier": "",
            "scheme": ""
        }],
        "instruments": [{
            "identifier": "",
            "scheme": "",
            "instrument_name": ""
        }],
        "community_extension_schema": "",
        "community_extension": {
            "slug:field": ""
        },
        "contact_emails": [{
            "contact_email": ""
        }],
        "temporal_coverage": [{
            "ranges": {
                "start_date": "ISO8601 date",
                "end_date": "ISO8601 date"
            },
            "span": ""
        }]
    },
    "pids": {}
}

List all records#

List all the records, without any filtering.

  HTTP method: GET

  URL path: /api/records

  Required parameters: None

  Optional parameters: page, size, mostrecent

  Status code on success: 200

  Returns: the list of records (in JSON format) or an error message.

Command:

curl "https://$B2SHARE_HOST/api/records"

Returns:

{
  "hits": {
    "hits": [
      {
        "id": "id",
        "created": "1900-01-01T12:00:00.000000+00:00",
        "updated": "1900-01-01T12:00:00.000000+00:00",
        "links": {
          "self": "https://b2share.eudat.eu/api/records/id",
          "self_html": "https://b2share.eudat.eu/records/id",
          "preview_html": "https://b2share.eudat.eu/records/id?preview=1",
          "doi": "https://doi.org/10.23728/b2share.id",
          "self_doi": "https://doi.org/10.23728/b2share.id",
          "self_doi_html": "https://b2share.eudat.eu/doi/10.23728/b2share.id",
          "reserve_doi": "https://b2share.eudat.eu/api/records/id/draft/pids/doi",
          "parent": "https://b2share.eudat.eu/api/records/id",
          "parent_html": "https://b2share.eudat.eu/records/id",
          "parent_doi": "https://doi.org/10.23728/b2share.id",
          "parent_doi_html": "https://b2share.eudat.eu/doi/10.23728/b2share.id",
          "self_iiif_manifest": "https://b2share.eudat.eu/api/iiif/record:id/manifest",
          "self_iiif_sequence": "https://b2share.eudat.eu/api/iiif/record:id/sequence/default",
          "files": "https://b2share.eudat.eu/api/records/id/files",
          "media_files": "https://b2share.eudat.eu/api/records/id/media-files",
          "thumbnails": {},
          "archive": "https://b2share.eudat.eu/api/records/id/files-archive",
          "archive_media": "https://b2share.eudat.eu/api/records/id/media-files-archive",
          "latest": "https://b2share.eudat.eu/api/records/id/versions/latest",
          "latest_html": "https://b2share.eudat.eu/records/id/latest",
          "versions": "https://b2share.eudat.eu/api/records/id/versions",
          "draft": "https://b2share.eudat.eu/api/records/id/draft",
          "access_links": "https://b2share.eudat.eu/api/records/id/access/links",
          "access_grants": "https://b2share.eudat.eu/api/records/id/access/grants",
          "access_users": "https://b2share.eudat.eu/api/records/id/access/users",
          "access_request": "https://b2share.eudat.eu/api/records/id/access/request",
          "access": "https://b2share.eudat.eu/api/records/id/access",
          "communities": "https://b2share.eudat.eu/api/records/id/communities",
          "communities-suggestions": "https://b2share.eudat.eu/api/records/id/communities-suggestions",
          "requests": "https://b2share.eudat.eu/api/records/id/requests"
        },
        "revision_id": 4,
        "parent": {
          "id": "parentid",
          "access": {
            "owned_by": {
              "user": "user_id"
            },
            "settings": {
              "allow_user_requests": false,
              "allow_guest_requests": false,
              "accept_conditions_text": null,
              "secret_link_expiration": 0
            }
          },
          "communities": {
            "ids": [
              "e9b9792e-79fb-4b07-b6b4-b9c2bd06d095"
            ],
            "default": "e9b9792e-79fb-4b07-b6b4-b9c2bd06d095",
            "entries": [
              {
                "id": "e9b9792e-79fb-4b07-b6b4-b9c2bd06d095",
                "created": "2025-10-27T11:13:15.629504+00:00",
                "updated": "2025-10-29T12:11:55.734130+00:00",
                "links": {},
                "revision_id": 6,
                "slug": "eudat",
                "metadata": {
                  "title": "EUDAT"
                },
                "access": {
                  "visibility": "public",
                  "members_visibility": "public",
                  "member_policy": "open",
                  "record_submission_policy": "open",
                  "review_policy": "closed",
                  "record_restricted_policy": "restricted"
                },
                "deletion_status": {
                  "is_deleted": false,
                  "status": "P"
                },
                "children": {
                  "allow": false
                }
              }
            ]
          },
          "pids": {
            "doi": {
              "identifier": "10.23728/b2share.parentid",
              "provider": "datacite",
              "client": "datacite"
            }
          }
        },
        "versions": {
          "is_latest": true,
          "index": 1
        },
        "is_published": true,
        "is_draft": false,
        "pids": {
          "doi": {
            "identifier": "10.23728/b2share.id",
            "provider": "datacite",
            "client": "datacite"
          },
          "oai": {
            "identifier": "oai:b2share-:id",
            "provider": "oai"
          },
          "epic": {
            "identifier": "http://hdl.handle.net/11304/id",
            "provider": "epic",
            "client": "epic"
          }
        },
        "metadata": {
          "...": "..."
        },
        "custom_fields": {},
        "access": {
          "record": "public",
          "files": "public",
          "embargo": {
            "active": false,
            "reason": null
          },
          "status": "open"
        },
        "files": {
          "enabled": true,
          "order": [],
          "count": 1,
          "total_bytes": 100,
          "entries": {
            "filename": {
              "id": "fileid",
              "checksum": "md5:checksum",
              "ext": "pdf",
              "size": 100,
              "mimetype": "application/pdf",
              "key": "filename",
              "metadata": {
              },
              "access": {
                "hidden": false
              }
            }
          }
        },
        "media_files": {
          "enabled": false,
          "order": [],
          "count": 0,
          "total_bytes": 0,
          "entries": {}
        },
        "status": "published",
        "deletion_status": {
          "is_deleted": false,
          "status": "P"
        },
        "stats": {
          "this_version": {
            "views": 2,
            "unique_views": 2,
            "downloads": 0,
            "unique_downloads": 0,
            "data_volume": 0
          },
          "all_versions": {
            "views": 2,
            "unique_views": 2,
            "downloads": 0,
            "unique_downloads": 0,
            "data_volume": 0
          }
        }
      },
      ...
    ],
    "total": 11561
  },
  "aggregations": {
    "access_status": {
      "buckets": [
        {
          "key": "open",
          "doc_count": 11319,
          "label": "Open",
          "is_selected": false
        },
        ...
      ],
      "label": "Access status"
    },
    "file_type": {
      "buckets": [
        {
          "key": "tiff",
          "doc_count": 3406,
          "label": "TIFF",
          "is_selected": false
        },
        ...
      ],
      "label": "File type"
    },
    "resource_types": {
      "buckets": [
        {
          "key": "dataset",
          "doc_count": 11095,
          "label": "Dataset",
          "is_selected": false,
          "inner": {
            "buckets": []
          }
        },
        ...,
        {
          "key": "publication",
          "doc_count": 144,
          "label": "Publication",
          "is_selected": false,
          "inner": {
            "buckets": [
              {
                "key": "publication-preprint",
                "doc_count": 7,
                "label": "Preprint",
                "is_selected": false
              },
              ...
            ]
          }
        },
        {
          "key": "image",
          "doc_count": 12,
          "label": "Image",
          "is_selected": false,
          "inner": {
            "buckets": [
              {
                "key": "image-other",
                "doc_count": 12,
                "label": "Other",
                "is_selected": false
              }
            ]
          }
        },
        ...
      ],
      "label": "Resource types"
    },
    "publication_date": {
      "buckets": [
        {
          "key": "1916",
          "doc_count": 1,
          "label": "1916",
          "is_selected": false
        },
        ...,
        {
          "key": "2030",
          "doc_count": 1,
          "label": "2030",
          "is_selected": false
        }
      ],
      "label": "Publication year"
    }
  },
  "sortBy": "newest",
  "links": {
    "self": "https://b2share.eudat.eu/api/records?page=1&size=25&sort=newest",
    "next": "https://b2share.eudat.eu/api/records?page=2&size=25&sort=newest"
  }
}

List records per community#

List all records of a specific community.

  HTTP method: GET

  URL path: /api/communities/$COMMUNITY_ID/records

  Required parameters: COMMUNITY_ID (can be the community slug)

  Status code on success: 200

  Returns: the list of records (in JSON format) or an error message

Notes: - you can use search parameters to further narrow your search as described in the ‘Search records’ section.

Command:

curl "https://$B2SHARE_HOST/api/communities/$COMMUNITY_ID/records"

Returns:

{
  "hits": {
    "hits": [
      {
        "id": "id",
        "created": "1900-01-01T12:00:00.000000+00:00",
        "updated": "1900-01-01T12:00:00.000000+00:00",
        "links": {
          "self": "https://b2share.eudat.eu/api/records/id",
          "self_html": "https://b2share.eudat.eu/records/id",
          "preview_html": "https://b2share.eudat.eu/records/id?preview=1",
          "doi": "https://doi.org/10.23728/b2share.id",
          "self_doi": "https://doi.org/10.23728/b2share.id",
          "self_doi_html": "https://b2share.eudat.eu/doi/10.23728/b2share.id",
          "reserve_doi": "https://b2share.eudat.eu/api/records/id/draft/pids/doi",
          "parent": "https://b2share.eudat.eu/api/records/id",
          "parent_html": "https://b2share.eudat.eu/records/id",
          "parent_doi": "https://doi.org/10.23728/b2share.id",
          "parent_doi_html": "https://b2share.eudat.eu/doi/10.23728/b2share.id",
          "self_iiif_manifest": "https://b2share.eudat.eu/api/iiif/record:id/manifest",
          "self_iiif_sequence": "https://b2share.eudat.eu/api/iiif/record:id/sequence/default",
          "files": "https://b2share.eudat.eu/api/records/id/files",
          "media_files": "https://b2share.eudat.eu/api/records/id/media-files",
          "thumbnails": {},
          "archive": "https://b2share.eudat.eu/api/records/id/files-archive",
          "archive_media": "https://b2share.eudat.eu/api/records/id/media-files-archive",
          "latest": "https://b2share.eudat.eu/api/records/id/versions/latest",
          "latest_html": "https://b2share.eudat.eu/records/id/latest",
          "versions": "https://b2share.eudat.eu/api/records/id/versions",
          "draft": "https://b2share.eudat.eu/api/records/id/draft",
          "access_links": "https://b2share.eudat.eu/api/records/id/access/links",
          "access_grants": "https://b2share.eudat.eu/api/records/id/access/grants",
          "access_users": "https://b2share.eudat.eu/api/records/id/access/users",
          "access_request": "https://b2share.eudat.eu/api/records/id/access/request",
          "access": "https://b2share.eudat.eu/api/records/id/access",
          "communities": "https://b2share.eudat.eu/api/records/id/communities",
          "communities-suggestions": "https://b2share.eudat.eu/api/records/id/communities-suggestions",
          "requests": "https://b2share.eudat.eu/api/records/id/requests"
        },
        "revision_id": 4,
        "parent": {
          "id": "parentid",
          "access": {
            "owned_by": {
              "user": "user_id"
            },
            "settings": {
              "allow_user_requests": false,
              "allow_guest_requests": false,
              "accept_conditions_text": null,
              "secret_link_expiration": 0
            }
          },
          "communities": {
            "ids": [
              "e9b9792e-79fb-4b07-b6b4-b9c2bd06d095"
            ],
            "default": "e9b9792e-79fb-4b07-b6b4-b9c2bd06d095",
            "entries": [
              {
                "id": "e9b9792e-79fb-4b07-b6b4-b9c2bd06d095",
                "created": "2025-10-27T11:13:15.629504+00:00",
                "updated": "2025-10-29T12:11:55.734130+00:00",
                "links": {},
                "revision_id": 6,
                "slug": "eudat",
                "metadata": {
                  "title": "EUDAT"
                },
                "access": {
                  "visibility": "public",
                  "members_visibility": "public",
                  "member_policy": "open",
                  "record_submission_policy": "open",
                  "review_policy": "closed",
                  "record_restricted_policy": "restricted"
                },
                "deletion_status": {
                  "is_deleted": false,
                  "status": "P"
                },
                "children": {
                  "allow": false
                }
              }
            ]
          },
          "pids": {
            "doi": {
              "identifier": "10.23728/b2share.parentid",
              "provider": "datacite",
              "client": "datacite"
            }
          }
        },
        "versions": {
          "is_latest": true,
          "index": 1
        },
        "is_published": true,
        "is_draft": false,
        "pids": {
          "doi": {
            "identifier": "10.23728/b2share.id",
            "provider": "datacite",
            "client": "datacite"
          },
          "oai": {
            "identifier": "oai:b2share-:id",
            "provider": "oai"
          },
          "epic": {
            "identifier": "http://hdl.handle.net/11304/id",
            "provider": "epic",
            "client": "epic"
          }
        },
        "metadata": {
          "...": "..."
        },
        "custom_fields": {},
        "access": {
          "record": "public",
          "files": "public",
          "embargo": {
            "active": false,
            "reason": null
          },
          "status": "open"
        },
        "files": {
          "enabled": true,
          "order": [],
          "count": 1,
          "total_bytes": 100,
          "entries": {
            "filename": {
              "id": "fileid",
              "checksum": "md5:checksum",
              "ext": "pdf",
              "size": 100,
              "mimetype": "application/pdf",
              "key": "filename",
              "metadata": {
              },
              "access": {
                "hidden": false
              }
            }
          }
        },
        "media_files": {
          "enabled": false,
          "order": [],
          "count": 0,
          "total_bytes": 0,
          "entries": {}
        },
        "status": "published",
        "deletion_status": {
          "is_deleted": false,
          "status": "P"
        },
        "stats": {
          "this_version": {
            "views": 2,
            "unique_views": 2,
            "downloads": 0,
            "unique_downloads": 0,
            "data_volume": 0
          },
          "all_versions": {
            "views": 2,
            "unique_views": 2,
            "downloads": 0,
            "unique_downloads": 0,
            "data_volume": 0
          }
        }
      },
      ...
    ],
    "total": 1009
  },
  "aggregations": {
    "access_status": {
      "buckets": [
        {
          "key": "open",
          "doc_count": 11319,
          "label": "Open",
          "is_selected": false
        },
        ...
      ],
      "label": "Access status"
    },
    "file_type": {
      "buckets": [
        {
          "key": "tiff",
          "doc_count": 3406,
          "label": "TIFF",
          "is_selected": false
        },
        ...
      ],
      "label": "File type"
    },
    "resource_types": {
      "buckets": [
        {
          "key": "dataset",
          "doc_count": 11095,
          "label": "Dataset",
          "is_selected": false,
          "inner": {
            "buckets": []
          }
        },
        ...,
        {
          "key": "publication",
          "doc_count": 144,
          "label": "Publication",
          "is_selected": false,
          "inner": {
            "buckets": [
              {
                "key": "publication-preprint",
                "doc_count": 7,
                "label": "Preprint",
                "is_selected": false
              },
              ...
            ]
          }
        },
        {
          "key": "image",
          "doc_count": 12,
          "label": "Image",
          "is_selected": false,
          "inner": {
            "buckets": [
              {
                "key": "image-other",
                "doc_count": 12,
                "label": "Other",
                "is_selected": false
              }
            ]
          }
        },
        ...
      ],
      "label": "Resource types"
    },
    "publication_date": {
      "buckets": [
        {
          "key": "1916",
          "doc_count": 1,
          "label": "1916",
          "is_selected": false
        },
        ...,
        {
          "key": "2030",
          "doc_count": 1,
          "label": "2030",
          "is_selected": false
        }
      ],
      "label": "Publication year"
    }
  },
  "sortBy": "newest",
  "links": {
    "self": "https://b2share.eudat.eu/api/communities/e9b9792e-79fb-4b07-b6b4-b9c2bd06d095/records?page=1&size=25&sort=newest",
    "next": "https://b2share.eudat.eu/api/communities/e9b9792e-79fb-4b07-b6b4-b9c2bd06d095/records?page=2&size=25&sort=newest"
  }
}

Search records#

Search all the published records for a query string.

  HTTP method: GET

  URL path: /api/records

  Required parameters: none

  Optional parameters: q, page, size, sort, file_type, access_status, resource_types, publication_date

  Status code on success: 200

  Returns: the list of matching records (in JSON format) or an error message

Notes: - The parameter q determines the keywords to search for, separated by a space. - If a field name is prepended followed by a colon and the search value, the search is limited to that field, e.g. 'creators.creator:user' searches for records with a ‘user’ in the creator metadata field. - If the parameter q is omitted, all records are returned (in paginated form). See also ‘List all records’. - For a better understanding of search queries, a listing of available search fields and advanced options like operators, please refer to the B2SHARE Advanced Search documentation on how to create them. - Using the page and size parameter, pagination can be established by providing integer values for these parameters. The page parameter is 1-based. - For example: using a value of 2 for page and 50 for size will return the records from number 51 to 100 (if there are at least 100 records available on the instance) - The sort parameter can be either 'mostrecent', 'bestmatch', 'oldest', 'version', 'mostviewed' or 'mostdownloaded'.

Command:

curl "https://$B2SHARE_HOST/api/records/?q=$QUERY_STRING&page=1&size=100&sort=mostrecent"

Command: (with facet filtering):

curl "https://$B2SHARE_HOST/api/records/?q=$QUERY_STRING&page=1&size=10&file_type=tiff&access_status=open&resource_types=other&publication_date=1987--2030"

Search drafts#

List all your draft records

  HTTP method: GET

  URL path: /api/user/records?q=&page=1&size=10&shared_with_me=false/true&is_published=false

  Required parameters: is_published

  Optional parameters: shared_with_me (true/false)

  Status code on success: 200

  Returns: the list of matching drafts (in JSON format) or an error message.

Notes: - You can only list your own draft records. - You can add search parameters to narrow down your search, see ‘Search records’ - REQUIRES AUTHENTICATION

Command:

curl "https://$B2SHARE_HOST/api/user/records?q=&page=1&size=10&shared_with_me=false&is_published=false"

Get specific record#

List the metadata of the record specified by RECORD_ID.

  HTTP method: GET

  URL path: /api/records/RECORD_ID

  Optionl parameters: access_token

  Status code on success: 200

Notes: - the access token is only required when a record is not publicly available.

Command:

curl "https://$B2SHARE_HOST/api/records/xxxxx-yyyyy"

Record review process#

The record review process is used to submit a record to a community. In some cases, the record goes to a review process, in others the record is published immediately. This is dependent of the community submission policies.

Get record review request#

Get record review request.

  HTTP method: GET

  URL path: /api/records/<record-id>/draft/review

  Required parameters: record-id

  Status code on success: 200

  Returns: The review request in JSON format.

Command:

curl "https://$B2SHARE_HOST/api/records/record-id/draft/review"
Returns:
{
  "created": "2025-01-01T09:00:00.000000+00:00",
  "created_by": {
    "user": "1"
  },
  "expires_at": null,
  "id": "request-id",
  "is_closed": false,
  "is_expired": false,
  "is_open": false,
  "links": {
    "actions": {
      "submit": "https://b2share.eudat.eu/api/requests/request-id/actions/submit"
    },
    "comments": "https://b2share.eudat.eu/api/requests/request-id/comments",
    "self": "https://b2share.eudat.eu/api/requests/request-id",
    "timeline": "https://b2share.eudat.eu/api/requests/request-id/timeline"
  },
  "number": "2",
  "receiver": {
    "community": "community-id"
  },
  "revision_id": 1,
  "status": "created",
  "title": "",
  "topic": {
    "record": "record-id"
  },
  "type": "community-submission",
  "updated": "2025-01-01T09:00:00.000000+00:00"
}

Create and update a record review request#

Update record review request.

  HTTP method: PUT

  URL path: /api/records/<record-id>/draft/review

  Required parameters: record-id

  Status code on success: 200

  Returns: The review request in JSON format.

Request body

{
    "receiver": {
        "community": "community-id"
    },
    "type": "community-submission"
}

Command:

curl -XPUT -H 'Content-Type: application/json' -d 'review-json' "https://$B2SHARE_HOST/api/records/record-id/draft/review"
Returns:
{
  "created": "2025-01-01T09:00:00.000000+00:00",
  "created_by": {
    "user": "1"
  },
  "expires_at": null,
  "id": "request-id",
  "is_closed": false,
  "is_expired": false,
  "is_open": false,
  "links": {
    "actions": {
      "submit": "https://b2share.eudat.eu/api/requests/request-id/actions/submit"
    },
    "comments": "https://b2share.eudat.eu/api/requests/request-id/comments",
    "self": "https://b2share.eudat.eu/api/requests/request-id",
    "timeline": "https://b2share.eudat.eu/api/requests/request-id/timeline"
  },
  "number": "2",
  "receiver": {
    "community": "community-id"
  },
  "revision_id": 1,
  "status": "created",
  "title": "",
  "topic": {
    "record": "record-id"
  },
  "type": "community-submission",
  "updated": "2025-01-01T09:00:00.000000+00:00"
}

Delete a record review request#

Delete record review request.

  HTTP method: DELETE

  URL path: /api/records/<record-id>/draft/review

  Required parameters: record-id

  Status code on success: 204

  Returns: No content

Command:

curl -XDELETE "https://$B2SHARE_HOST/api/records/record-id/draft/review"

Submit a record to review#

Submit a record to review.

  HTTP method: POST

  URL path: /api/records/<record-id>/draft/actions/submit-review

  Required parameters: record-id

  Status code on success: 202

  Returns: Accepted

Request body

{
    "payload": {
        "content": "Request comment content",
        "format": "html"
    }
}

Command:

curl -XPOST -H 'Content-Type: application/json' -d '{"payload":{"content":"Request comment content", "format":"html"}}' "https://$B2SHARE_HOST/api/records/record-id/draft/actions/submit-review"

Record administration#

The following requests concern the creation, update and management of records.

Create draft record#

Create a new record, in the draft state.

  HTTP method: POST

  URL path: /api/records

  Payload data: JSON object with basic metadata of the object

  Status code on success: 201

  Returns: the new draft record metadata including new URL location. Please note that the returned JSON object contains also the URL of the file bucket used for the record. Also note that the URL of the draft record, needed for setting record metadata, will end in '/draft/'

Common errors#

On metadata validation error:

{
  "message": "Validation error.",
  "status": 400
}
The supplied metadata is invalid or incorrectly structured. This means that either a specified field does not exist in the metadata schema, or that one of the values for a given field is invalid.

Update draft record metadata#

This action updates the draft record with new information.

  HTTP method: PUT

  URL path: /api/records/<record-id>/draft

  Required parameters: record-id

  Payload data: the metadata for the draft record

  Status code on success: 200

  Returns: the updated metadata of the draft record.

Reserve a DOI for a draft#

Reserve a DOI for a draft record.

  HTTP method: POST

  URL path: /api/records/<record-id>/draft/pids/doi

  Required parameters: record-id

  Status code on success: 201

  Returns: The draft record

Delete a DOI from a draft#

Remove a DOI from a draft record.

  HTTP method: DELETE

  URL path: /api/records/<record-id>/draft/pids/doi

  Required parameters: record-id

  Status code on success: 204

  Returns: No content

Submit draft record for publication#

  HTTP method: POST

  URL path: /api/records/<record-id>/draft/actions/publish

  Required parameters: record-id

  Status code on success: 202

  Returns: The published record

Update published record metadata#

Create a draft from the record for metadata modifications.

  HTTP method: POST

  URL path: /api/records/<record-id>/draft

  Required parameters: record-id

  Status code on success: 201

  Returns: The draft record.

After draft is created from the record, modifications can be done by following these instructions. After modifications are done, you can save the record by publishing it by following instructions on submit draft record for publication and submit a record to review.

Report a record as an abuse record#

If there is anything wrong with the record users can report it as an abuse record. An email will be send to the related admin and it will be followed up. There are 4 different reasons listed on the report abuse form and the reporter should choose one of:

  • Abuse or Inappropriate content

  • Copyrighted material

  • Not research data

  • Illegal content

The reporter can also send a message to explain more about the problem. It is possible for an anonymous user to send the report and authentication is not required.

Report an abuse record.

  HTTP method: POST

  URL path: /api/records/<record-id>/report-abuse

  Required parameters: record-id

  Payload data: JSON object with information about reporter, the reason indicated by booleans and a message.

  Status code on success: 201

  Returns: a message that an email was sent and the record is reported

Payload:

{
  "abuseType": "",
  "name": "",
  "email": "",
  "affiliation": "",
  "phone": "",
  "address": "",
  "city": "",
  "zip": "",
  "country": "",
  "message": ""
}
Returns:
{
  "status": "report submitted"
}

Delete draft record#

Delete a draft record.

  HTTP method: DELETE

  URL path: /api/records/<record-id>/draft

  Required parameters: record-id

  Status code on success: 204

  Returns: no contents.

Record files#

Start file upload to a draft#

Initialise file upload to a draft reford.

  HTTP method: POST

  URL path: /api/records/<record-id>/draft/files

  Required parameters: record-id

  Status code on success: 201

  Returns: The list of created file entries

Request body

[
    {"key": "filename"},
    {"key": "filename"},
    ...
]

Response

{
    "enabled": true,
    "default_preview": null,
    "order": [],
    "entries": [
        {
            "key": "filename",
            "updated": "2025-01-01 09:00:00.000000",
            "created": "2020-01-01 09:00:00.000000",
            "metadata": null,
            "status": "pending",
            "links": {
                "content": "/api/records/record-id/draft/files/filename/content",
                "self": "/api/records/record-id/draft/files/filename",
                "commit": "/api/records/record-id/draft/files/filename/commit"
            },
        },
        ...
    ],
    "links": {
        "self": "/api/records/record-id/draft/files"
    },
}

Upload file into draft record#

To upload a new file into a draft record object, first you need to identify the file bucket URL. This URL can be found in the information returned when querying a draft record, in the ‘links/files’ section of the returned data.

  HTTP method: PUT

  URL path: /api/records/<record-id>/draft/files/<filename>/content

  Required parameters: record-id, filename

  Payload: The file

  Status code on success: 200

  Returns: Information about the newly uploaded file

Command:

curl -X PUT -H 'Accept:application/json' -H 'Content-Type:application/octet-stream' --data-binary @$FILE_NAME "https://$B2SHARE_HOST/api/reords/$RECORD_ID/draft/files/$FILE_NAME/content?access_token=$ACCESS_TOKEN"

Command:

curl -X PUT -H 'Accept:application/json' -H 'Content-Type:application/octet-stream' -H 'Transfer-Encoding:chunked' -T $FILE_NAME "https://$B2SHARE_HOST/api/reords/$RECORD_ID/draft/files$FILE_NAME/content?access_token=$ACCESS_TOKEN"

Commit a file to a draft#

  HTTP method: POST

  URL path: /api/records/<record-id>/draft/files/<filename>/commit

  Required parameters: record-id, filename

  Status code on success: 200

  Returns: Information about the newly uploaded file

List draft’s files#

  HTTP method: GET

  URL path: /api/records/<record-id>/draft/files

  Required parameters: record-id

  Status code on success: 200

  Returns: Files in the draft record

Response

{
  "enabled": true,
  "links": {
    "self": "https://b2share.eudat.eu/api/records/5by5b-76n25/draft/files",
    "archive": "https://b2share.eudat.eu/api/records/5by5b-76n25/draft/files-archive"
  },
  "entries": [
    {
      "created": "2025-10-30T09:41:16.276953+00:00",
      "updated": "2025-10-30T09:41:16.840658+00:00",
      "mimetype": "image/vnd.microsoft.icon",
      "version_id": "85262be3-62eb-416e-88a0-a24bec1ef566",
      "file_id": "bb522f5e-f492-42d5-968f-2e5c77980b27",
      "bucket_id": "5360c807-4a1f-416b-882f-bfd88516f667",
      "metadata": {},
      "access": {
        "hidden": false
      },
      "links": {
        "self": "https://b2share.eudat.eu/api/records/5by5b-76n25/draft/files/favicon.ico",
        "content": "https://b2share.eudat.eu/api/records/5by5b-76n25/draft/files/favicon.ico/content",
        "commit": "https://b2share.eudat.eu/api/records/5by5b-76n25/draft/files/favicon.ico/commit"
      },
      "key": "favicon.ico",
      "size": 4286,
      "transfer": {
        "type": "L"
      },
      "status": "completed",
      "checksum": "md5:923eb4478084cdbf07be2c090de2bd17",
      "storage_class": "L"
    }
  ],
  "default_preview": "favicon.ico",
  "order": []
}

Get draft’s file metadata#

  HTTP method: GET

  URL path: /api/records/<record-id>/draft/files/<filename>

  Required parameters: record-id, filename

  Status code on success: 200

  Returns: Metadata of the specified file

Response

{
  "created": "2025-10-30T09:41:16.276953+00:00",
  "updated": "2025-10-30T09:41:16.840658+00:00",
  "mimetype": "image/vnd.microsoft.icon",
  "version_id": "85262be3-62eb-416e-88a0-a24bec1ef566",
  "file_id": "bb522f5e-f492-42d5-968f-2e5c77980b27",
  "bucket_id": "5360c807-4a1f-416b-882f-bfd88516f667",
  "metadata": {},
  "access": {
    "hidden": false
  },
  "links": {
    "self": "https://b2share.eudat.eu/api/records/5by5b-76n25/draft/files/favicon.ico",
    "content": "https://b2share.eudat.eu/api/records/5by5b-76n25/draft/files/favicon.ico/content",
    "commit": "https://b2share.eudat.eu/api/records/5by5b-76n25/draft/files/favicon.ico/commit"
  },
  "key": "favicon.ico",
  "size": 4286,
  "transfer": {
    "type": "L"
  },
  "status": "completed",
  "checksum": "md5:923eb4478084cdbf07be2c090de2bd17",
  "storage_class": "L"
}

Delete file from draft record#

  HTTP method: DELETE

  URL path: /api/records/<record-id>/draft/files/<filename>

  Status code on success: 204

  Returns: No content

List files of record#

List the files uploaded into a record object.

  HTTP method: GET

  URL path: /api/records/<record-id>/files

  Status code on success: 200

  Returns: Information about all the files in the record object

Response

{
  "enabled": true,
  "links": {
    "self": "https://b2share.eudat.eu/api/records/kd9bz-31s20/files",
    "archive": "https://b2share.eudat.eu/api/records/kd9bz-31s20/files-archive"
  },
  "entries": [
    {
      "created": "2025-10-29T11:08:56.662751+00:00",
      "updated": "2025-10-29T11:08:56.717482+00:00",
      "mimetype": "application/zip",
      "version_id": "ad217b72-bacb-4280-92c6-73e023616bdc",
      "file_id": "442b6c89-99b6-48a8-887c-2fe0e0d53a64",
      "bucket_id": "a9550cbe-61d4-45c9-94cb-7e283af9efda",
      "metadata": null,
      "access": {
        "hidden": false
      },
      "links": {
        "self": "https://b2share.eudat.eu/api/records/kd9bz-31s20/files/compose.zip",
        "content": "https://b2share.eudat.eu/api/records/kd9bz-31s20/files/compose.zip/content"
      },
      "key": "compose.zip",
      "size": 471776,
      "transfer": {
        "type": "L"
      },
      "status": "completed",
      "pids": {
        "epic": {
          "client": "epic",
          "provider": "epic",
          "identifier": "http://hdl.handle.net/11304/8a761156-ef75-4f0d-8b99-5dd3ebf81c37"
        }
      },
      "checksum": "md5:263d590a64eedf037d157ffdb1775ab4",
      "storage_class": "L"
    },
    ...
  ],
  "default_preview": null,
  "order": []
}

Add externally referenced files to draft record#

Record versioning#

The following requests concern the versioning of published records. Click on a title to show details. Create new version of published record

Create a new version of an existing published record into a new draft.#

  HTTP method: POST

  URL path: /api/records/<record-id>/versions

  Required parameters: record-id

  Status code on success: 201

  Returns: the new draft record metadata including new URL location. The metadata will be exactly the same as the original record with the exception of the links and persistent identifiers. Since the new record is in draft state, you can freely alter it, including the files.

Notes: - the output of the request is the same as the output of the Create new record request. You cannot create a new version of a draft record itself.

  HTTP method: POST

  URL path: /api/records/<record-id>/draft/actions/files-import

  Required parameters: record-id

  Status code on success: 201

  Returns: the new draft record metadata including new URL location. The metadata will be exactly the same as the original record with the exception of the links and persistent identifiers. Since the new record is in draft state, you can freely alter it, including the files.

Get all record versions#

Get all versions of a specific record by using the record head identifier.

  HTTP method: GET

  URL path: /api/records/<record-id>/versions

  Required parameters: record-id

  Status code on success: 200

  Returns: a JSON structure containing a list of all record versions with identifier, version number and URL.

Notes: - the record head identifier is not the same as the record identifier. Use the metadata of the record to find the record head identifier, located in the JSONPath /links/versions. - If a record is not versioned, the result will be empty.

Command:

curl -H "Content-Type:application/json" "https://$B2SHARE_HOST/api/records/$RECORD_ID/versions"
Returns:
{
  "hits": {
    "hits": [
        {...},
        ...
    ],
    "total": 1
  },
  "sortBy": "version",
  "links": {
    "self": "https://b2share.eudat.eu/api/records/record-id/versions?page=1&size=25&sort=version"
  }
}
On not found error:
{
  "status": 404,
  "message": "The persistent identifier does not exist."
}

Get latest version of a record#

  HTTP method: GET

  URL path: /api/records/<record-id>/versions/latest

  Required parameters: record-id

  Status code on success: 200

  Returns: The latest recorf version of the specified record.

Access#

  HTTP method: POST

  URL path: /api/records/<record-id>/access/links

  Required parameters: record-id

  Status code on success: 201

  Returns: The access link in JSON format

Request body

{
  "permission": "view/preview/edit",
  "expires_at": "2025-12-31"
}

Response

{
    "id": "id",
    "created_at": "2025-01-01T09:00:00.000000+00:00",
    "expires_at": "2025-12-31",
    "permission": "view",
    "description": "",
    "token": "token"
}

  HTTP method: GET

  URL path: /api/records/<record-id>/access/links/<link-id>

  Required parameters: record-id, link-id

  Status code on success: 200

  Returns: The link in JSON format.

Response

{
    "id": "id",
    "created_at": "2025-01-01T09:00:00.000000+00:00",
    "expires_at": "2025-12-31",
    "permission": "view",
    "description": "",
    "token": "token"
}

  HTTP method: PATCH

  URL path: /api/records/<record-id>/access/links/<link-id>

  Required parameters: record-id, link-id

  Status code on success: 200

  Returns: The updated link in JSON format

Request body

{
  "permission": "view/preview/edit",
  "expires_at": "2026-12-31"
}

Response

{
    "id": "id",
    "created_at": "2025-01-01T09:00:00.000000+00:00",
    "expires_at": "2026-12-31",
    "permission": "view",
    "description": "",
    "token": "token"
}

  HTTP method: DELETE

  URL path: /api/records/<record-id>/access/links/<link-id>

  Required parameters: record-id, link-id

  Status code on success: 204

  Returns: No content
  HTTP method: GET

  URL path: /api/records/<record-id>/access/links

  Required parameters: record-id

  Status code on success: 200

  Returns: No content

Response

{
  "hits": {
      "hits": [
        {
            "id": "id",
            "created_at": "2025-01-01T09:00:00.000000+00:00",
            "expires_at": "2026-12-31",
            "permission": "view",
            "description": "",
            "token": "token"
        },
        ...
      ],
      "total": 1
  }
}

Send record access request#

  HTTP method: GET

  URL path: /api/records/<record-id>/draft/pids/doi

  Required parameters: record-id

  Status code on success: 204

  Returns: No content

Last update : 18.11.2025

Last review : 18.11.2025