Audit Endpoints

Note

The examples below use API endpoints from the live COPO website.

To use the demo website instead, replace https://copo-project.org/api/ with https://demo.copo-project.org/api/ in the URLs.

Tip

  • To view details of the endpoint, click the audit-collapsible-item-arrow

  • Show endpoint details button.

  • Then, inside that section, click the audit-collapsible-item-arrow Show API query parameters button to see input parameter details.

  • By default, the API returns results in JSON format and uses the Tree of Life (ToL) standard. You do not need to specify these unless you want to override them.

    To explicitly include them in the API URL:

    • Use ?return_type=json or ?standard=tol if there are no other query parameters.

    • Use &return_type=json or &standard=tol if the URL already includes other parameters.


Fetch Sample Updates

Show endpoint details
Show API query parameters
  • copo_id (optional): A unique identifier of the sample record. It is known as alias in ENA. Multiple copo_id can be provided as a comma separated list in this endpoint.

  • project (optional): The name of the project [1]

  • updatable_field (optional): Fields that can be updated when a manifest is reuploaded/resubmitted in COPO

  • return_type (optional): Output format for the results. Options include json (default) and csv

    To apply filters, append them to the API URL as follows audit/samples /?copo_id=<copo_id>&project=<project>&updatable_field=<updatable_field> &return_type=<return_type>.

    Replace <copo_id>, <project>, <updatable_field> and <return_type> with the sample ID, project name, updatable field and return type respectively. See the example below.


Usage

This endpoint results in a list of sample updates that occurred in COPO.

https://copo-project.org/api/audit/samples
$ curl -X GET "https://copo-project.org/api/audit/samples" -H "accept: application/json"

Example

To retrieve sample updates for the sample with the COPO ID 67d461e318e6e19d10b37901 in the project DTOL by the updatable field SCIENTIFIC_NAME and return the results in JSON format, use the following:

https://copo-project.org/api/audit/samples?copo_id=67d461e318e6e19
d10b37901&project=DTOL&updatable_field=SCIENTIFIC_NAME&return_type
=json
$ curl -X GET "https://copo-project.org/api/audit/samples?copo_id=
67d461e318e6e19d10b37901&project=DTOL&updatable_field=SCIENTIFIC_N
AME&return_type=json" -H  "accept: application/json"

Fetch Sample Updates Between Dates

Show endpoint details
Show API query parameters
  • from (required): Start date for filtering (format: YYYY-MM- DDTHH:MM:SS+00:00)

  • to (required): End date for filtering (format: YYYY-MM- DDTHH:MM:SS+00:00)

  • return_type (optional): Output format for the results. Options include json (default) and csv

    To apply filters, append them to the API URL as follows audit/sample/{from}/{to}?return_type=<return_type>.

    Replace {from}, {to} and <return_type> with the start date, end date and return type respectively. See the example below.


Usage

Please include at least the from and to parameters in the API URL to retrieve sample updates that occurred between a given date period. Replace {from} and {to} with the start date and end date respectively.

https://copo-project.org/api/audit/sample/{from}/{to}
$ curl -X GET "https://copo-
project.org/api/audit/sample/{from}/{to}" -H  "accept:
application/json"

Example

To retrieve sample updates between 1st January, 2025 and 1st May, 2025 and return the results in CSV format, use the following:

https://copo-project.org/api/audit/sample/2025-01-
01T00:00:00+00:0/2025-05-01T00:00:00+00:0?return_type=csv
$ curl -X GET "https://copo-project.org/api/audit/sample/2025-01-
01T00:00:00+00:0/2025-05-01T00:00:00+00:0?return_type=csv" -H
"accept: application/json"

Fetch Sample Updates by Manifest ID

Show endpoint details
Show API query parameters
  • manifest_id (required): The manifest ID (s) assigned to sample records. Multiple manifest IDs can be provided as a comma (,) separated list in this endpoint. Commas (,) are represented as %2C URL-encoded values in the API URL.

  • standard (optional): The standard to query the endpoint. Options include tol (default), dwc, ena and mixs.

  • return_type (optional): Output format for the results. Options include json (default) and csv

    To apply filters, append them to the API URL as follows

    audit/sample/manifest_id/{manifest_id}?
    standard=<standard>&return_type=<return_type>
    

    Replace {manifest_id}, <standard> and <return_type> with the desired values. See the example below.


Usage

Please include at least the manifest_id value to retrieve a list of sample updates by manifest IDs [2]. Replace {manifest_id} in the URL below with the desired manifest ID(s).

https://copo-
project.org/api/audit/sample/manifest_id/{manifest_id}
$ curl -X GET "https://copo-
project.org/api/audit/sample/manifest_id/{manifest_id}" -H
"accept: application/json"

Example

To retrieve sample records with the manifest IDs - f8e5c23d-f735-439f-bfaf-a6886e31741e and 046632f0-0869-4a3b-b3c3-cd22158b4b12 in the ena standard and return the results in csv format, use the following.

The browser method will prompt a download of the CSV while the curl method is helpful if you are scripting or working in a terminal environment.

https://copo-project.org/api/sample/manifest_id/f8e5c23d-f735-
439f-bfaf-a6886e31741e%2C046632f0-0869-4a3b-b3c3-
cd22158b4b12?standard=ena&return_type=csv
$ curl -X GET "https://copo-project.org/api/sample/manifest_id/f8e
5c23d-f735-439f-bfaf-a6886e31741e%2C046632f0-0869-4a3b-b3c3-
cd22158b4b12?standard=ena&return_type=csv" -H  "accept:
application/json"

Fetch Sample Updates by Update Type

Show endpoint details
Show API query parameters
  • project (optional): The name of the project [1]

  • update_type (required): The type of update to filter by. Options include:

    • system: Updates performed by COPO

    • user: Updates performed by a user reuploading a manifest with amended sample metadata

  • return_type (optional): Output format for the results. Options include json (default) and csv

    To apply filters, append them to the API URL as follows

    /audit/sample/update_type/{update_type}?
    project=<project>&return_type=<return_type>
    

    Replace {update_type}, <project> and <return_type> with the desired values. See the example below.


Usage

Please include at least the update_type value to retrieve a list of sample updates by update type. Replace {update_type} in the URL below with the desired value.

https://copo-
project.org/api/audit/sample/update_type/{update_type}
$ curl -X GET "https://copo-
project.org/api/audit/sample/update_type/{update_type}" -H
"accept: application/json"

Example

To retrieve sample updates performed by the user for the ASG, DTOL and ERGA projects and return the results in JSON format, use the following:

https://copo-project.org/api/audit/sample/update_type/user?proje
ct=ASG&project=DTOL&project=ERGA
$ curl -X GET "https://copo-project.org/api/audit/sample/update_
type/user?project=ASG&project=DTOL&project=ERGA" -H  "accept:
application/json"

Fetch Sample Updates by Field and Field Value

Show endpoint details
Show API query parameters
  • field (required): The sample field to filter updates by. Options include:

    • RACK_OR_PLATE_ID

    • SPECIMEN_ID

    • TUBE_OR_WELL_ID

    • biosampleAccession

    • public_name

    • sraAccession

  • field_value (required): The value of the sample field to filter updates by.

  • return_type (optional): Output format for the results. Options include json (default) and csv

    To apply filters, append them to the API URL as follows /audit/sample/{field}/{field_value}?return_type=<return_type>.

    Replace {field}, {field_value} and <return_type> with the desired values. See the example below.


Usage

Please include at least the field and field_value values to retrieve a list of sample updates by field and field value. Replace {field} and {field_value} in the URL below with the desired field and field value.

https://copo-project.org/api/audit/sample/{field}/{field_value}
$ curl -X GET "https://copo-
project.org/api/audit/sample/{field}/{field_value}" -H  "accept:
application/json"

Example

To retrieve sample updates for the sample with the field, SPECIMEN_ID, value ERGA_JB_4431_00001 and return the results in JSON format, use the following:

https://copo-
project.org/api/audit/sample/SPECIMEN_ID/ERGA_JB_4431_00001
$ curl -X GET "https://copo-
project.org/api/audit/sample/SPECIMEN_ID/ERGA_JB_4431_00001" -H
"accept: application/json"

Footnotes