Using the BioSamples API you can submit new samples to our resource, as well as update or curate samples.

This website requires the limited processing of your personal data in order to function. By using the site you are agreeing to this as outlined in our Submission Privacy Notice

Submission minimal fields

Sample

Sample content reference:

Field Description Type Cardinality =======

name

The short name of the sample.

String

Required

release

The date at which the sample was first made public.

Date ISO 8601

Required

update

The date at which the sample was last updated.

Date ISO 8601

System Generated

domain

The AAP domain the sample belongs to.

String

Required (only while using AAP authentication)

accession

The sample unique identifier in the BioSamples database. If not provided, one will be automatically assigned.

String

Required for PUT requests

characteristics

The key-value pairs representing the attributes of the sample.

Object

Optional

externalReferences

A list of links towards external references, such as datasets in other archives.

Array

Optional

relationships

A list of relationships this sample has to other, existing, samples.

Array

Optional

data

A more structured data format to allow submission of tables (eg. antibiogram) in addition to key-value pairs.

Array

Optional, required only for structured data submission using our POST, PUT or PATCH endpoints.

Note - You must provide an AAP domain for your data. It can be same as the sample domain if you are the submitter of both the sample metadata and structured data.

The structure of elements in Field characteristics :

Field Type Cardinality

text

String

Recommended

ontologyTerms

Array

Optional

unit

String

Optional

Field Type Cardinality

sample

String

Required

domain

String

Required (only while using AAP authentication)

curation

Object

Required

curation.attributesPre

Array

Required, could be empty

curation.attributesPost

Array

Required, could be empty

curation.externalReferencesPre

Array

Required, could be empty

curation.externalReferencesPost

Array

Required, could be empty

domain

String

Required

Submit a sample

POST sample to BioSamples You can either use AAP or ENA WEBIN AUTHENTICATION to generate the auth token.

  • Submission using a AAP token (default)

Request

POST /biosamples/samples HTTP/1.1
Content-Type: application/json
Authorization: Bearer $TOKEN
Host: www.ebi.ac.uk
Content-Length: 105

{
  "name" : "FakeSample",
  "release" : "2021-11-22T10:57:29.0156Z",
  "domain" : "self.ExampleDomain"
}

Response

HTTP/1.1 201 Created
Location: https://www.ebi.ac.uk/biosamples/samples
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1039

{
  "name" : "FakeSample",
  "accession" : "SAMFAKE123456",
  "domain" : "self.ExampleDomain",
  "release" : "2021-11-22T10:57:29.015620Z",
  "update" : "2021-11-22T10:57:29.015621Z",
  "submitted" : "2021-11-22T10:57:29.015622Z",
  "characteristics" : { },
  "releaseDate" : "2021-11-22",
  "updateDate" : "2021-11-22",
  "submittedDate" : "2021-11-22",
  "submittedVia" : "JSON_API",
  "create" : "2021-11-22T10:57:29.015621Z",
  "_links" : {
    "self" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples"
    },
    "curationDomain" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples{?curationdomain}",
      "templated" : true
    },
    "curationLinks" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks"
    },
    "curationLink" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks/{hash}",
      "templated" : true
    },
    "structuredData" : {
      "href" : "https://www.ebi.ac.uk/biosamples/structureddata/SAMFAKE123456"
    }
  }
}
  • Submission using a ENA WEBIN AUTHENTICATION token

Request

POST /biosamples/samples?authProvider=WEBIN HTTP/1.1
Content-Type: application/json
Authorization: Bearer $TOKEN
Host: www.ebi.ac.uk
Content-Length: 72

{
  "name" : "FakeSample",
  "release" : "2021-11-22T10:57:28.993329Z"
}

Response

HTTP/1.1 201 Created
Location: https://www.ebi.ac.uk/biosamples/samples
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1050

{
  "name" : "FakeSample",
  "accession" : "SAMFAKE123456",
  "webinSubmissionAccountId" : "WEBIN-12345",
  "release" : "2021-11-22T10:57:28.993352Z",
  "update" : "2021-11-22T10:57:28.993354Z",
  "submitted" : "2021-11-22T10:57:28.993355Z",
  "characteristics" : { },
  "releaseDate" : "2021-11-22",
  "updateDate" : "2021-11-22",
  "submittedDate" : "2021-11-22",
  "submittedVia" : "JSON_API",
  "create" : "2021-11-22T10:57:28.993354Z",
  "_links" : {
    "self" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples"
    },
    "curationDomain" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples{?curationdomain}",
      "templated" : true
    },
    "curationLinks" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks"
    },
    "curationLink" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks/{hash}",
      "templated" : true
    },
    "structuredData" : {
      "href" : "https://www.ebi.ac.uk/biosamples/structureddata/SAMFAKE123456"
    }
  }
}

For all the links available in BioSamples check the Links Reference

Update sample

PUT a sample to BioSamples You can either use AAP or ENA WEBIN AUTHENTICATION to generate the auth token.

The submitted sample is required to have an accession and the accession should match the one in the url. Updating a sample overwrites its existing content with the new one. If you want to preserve existing attributes, you should first download the sample, build a new version including existing and new attributes, and resubmit the new content.

  • Submission using a AAP token (default)

Request

PUT /biosamples/samples/SAMFAKE123456 HTTP/1.1
Content-Type: application/json
Authorization: Bearer $TOKEN
Host: www.ebi.ac.uk
Content-Length: 430

{
  "name" : "FakeSample",
  "accession" : "SAMFAKE123456",
  "domain" : "self.ExampleDomain",
  "release" : "2021-11-22T10:57:28.586254Z",
  "update" : "2021-11-22T10:57:28.586262Z",
  "submitted" : "2021-11-22T10:57:28.586264Z",
  "characteristics" : { },
  "releaseDate" : "2021-11-22",
  "updateDate" : "2021-11-22",
  "submittedDate" : "2021-11-22",
  "submittedVia" : "JSON_API",
  "create" : "2021-11-22T10:57:28.586263Z"
}

Response

HTTP/1.1 200 OK
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1067

{
  "name" : "FakeSample",
  "accession" : "SAMFAKE123456",
  "domain" : "self.ExampleDomain",
  "release" : "2021-11-22T10:57:28.586254Z",
  "update" : "2021-11-22T10:57:28.586262Z",
  "submitted" : "2021-11-22T10:57:28.586264Z",
  "characteristics" : { },
  "releaseDate" : "2021-11-22",
  "updateDate" : "2021-11-22",
  "submittedDate" : "2021-11-22",
  "submittedVia" : "JSON_API",
  "create" : "2021-11-22T10:57:28.586263Z",
  "_links" : {
    "self" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456"
    },
    "curationDomain" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456{?curationdomain}",
      "templated" : true
    },
    "curationLinks" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks"
    },
    "curationLink" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks/{hash}",
      "templated" : true
    },
    "structuredData" : {
      "href" : "https://www.ebi.ac.uk/biosamples/structureddata/SAMFAKE123456"
    }
  }
}
  • Submission using a ENA WEBIN AUTHENTICATION token

Request

PUT /biosamples/samples/SAMFAKE123456?authProvider=WEBIN HTTP/1.1
Content-Type: application/json
Authorization: Bearer $TOKEN
Host: www.ebi.ac.uk
Content-Length: 441

{
  "name" : "FakeSample",
  "accession" : "SAMFAKE123456",
  "webinSubmissionAccountId" : "WEBIN-12345",
  "release" : "2021-11-22T10:57:28.679734Z",
  "update" : "2021-11-22T10:57:28.679738Z",
  "submitted" : "2021-11-22T10:57:28.679740Z",
  "characteristics" : { },
  "releaseDate" : "2021-11-22",
  "updateDate" : "2021-11-22",
  "submittedDate" : "2021-11-22",
  "submittedVia" : "JSON_API",
  "create" : "2021-11-22T10:57:28.679739Z"
}

Response

HTTP/1.1 200 OK
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1078

{
  "name" : "FakeSample",
  "accession" : "SAMFAKE123456",
  "webinSubmissionAccountId" : "WEBIN-12345",
  "release" : "2021-11-22T10:57:28.679734Z",
  "update" : "2021-11-22T10:57:28.679738Z",
  "submitted" : "2021-11-22T10:57:28.679740Z",
  "characteristics" : { },
  "releaseDate" : "2021-11-22",
  "updateDate" : "2021-11-22",
  "submittedDate" : "2021-11-22",
  "submittedVia" : "JSON_API",
  "create" : "2021-11-22T10:57:28.679739Z",
  "_links" : {
    "self" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456"
    },
    "curationDomain" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456{?curationdomain}",
      "templated" : true
    },
    "curationLinks" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks"
    },
    "curationLink" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks/{hash}",
      "templated" : true
    },
    "structuredData" : {
      "href" : "https://www.ebi.ac.uk/biosamples/structureddata/SAMFAKE123456"
    }
  }
}

For all the links available in BioSamples check the Links Reference

Submit structured data

PUT structured data associated with a sample

This endpoint is useful if an user wants to add structured data to an existing sample (example: Antibiogram data of sample)

Sample structured data should be submitted after submission of the original sample (need sample accession). The ownership of the Sample and the Structured data are decoupled, hence they can be edited without affecting the other. BioSamples currently contains structured data for AMR, CHICKEN_DATA, HISTOLOGY_MARKERS, MOLECULAR_MARKERS, FATTY_ACIDS. This is defined in the "type" field of the data and we recommend to use one of the exisitng types if possible.

Example 1

Request

PUT /biosamples/structureddata/SAMFAKE123456 HTTP/1.1
Content-Type: application/json
Authorization: Bearer $TOKEN
Host: www.ebi.ac.uk
Content-Length: 741

{
  "accession" : "SAMFAKE123456",
  "create" : "2021-11-22T10:57:28.930456Z",
  "update" : "2021-11-22T10:57:28.930567Z",
  "data" : [ {
    "domain" : "self.ExampleDomain",
    "webinSubmissionAccountId" : null,
    "type" : "CHICKEN_DATA",
    "schema" : null,
    "content" : [ {
      "Measurement" : {
        "value" : "value_1",
        "iri" : null
      },
      "Marker" : {
        "value" : "value_1",
        "iri" : "http://purl.obolibrary.org/obo/value_1"
      },
      "Method" : {
        "value" : "value_1",
        "iri" : null
      },
      "Measurement Units" : {
        "value" : "value_1",
        "iri" : null
      },
      "Partner" : {
        "value" : "value_1",
        "iri" : null
      }
    } ]
  } ]
}

Response

HTTP/1.1 200 OK
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 741

{
  "accession" : "SAMFAKE123456",
  "create" : "2021-11-22T10:57:28.930456Z",
  "update" : "2021-11-22T10:57:28.930567Z",
  "data" : [ {
    "domain" : "self.ExampleDomain",
    "webinSubmissionAccountId" : null,
    "type" : "CHICKEN_DATA",
    "schema" : null,
    "content" : [ {
      "Measurement" : {
        "value" : "value_1",
        "iri" : null
      },
      "Marker" : {
        "value" : "value_1",
        "iri" : "http://purl.obolibrary.org/obo/value_1"
      },
      "Method" : {
        "value" : "value_1",
        "iri" : null
      },
      "Measurement Units" : {
        "value" : "value_1",
        "iri" : null
      },
      "Partner" : {
        "value" : "value_1",
        "iri" : null
      }
    } ]
  } ]
}

For all the links available in BioSamples check the Links Reference

Submit curation object

POST a curation to BioSamples

  • Submission using a AAP token (default)

Request

POST /biosamples/samples/SAMFAKE123456/curationlinks HTTP/1.1
Content-Type: application/json
Authorization: Bearer $TOKEN
Host: www.ebi.ac.uk
Content-Length: 971

{
  "sample" : "SAMFAKE123456",
  "curation" : {
    "attributesPre" : [ {
      "type" : "Organism",
      "value" : "Human",
      "iri" : [ "9606" ]
    } ],
    "attributesPost" : [ {
      "type" : "Organism",
      "value" : "Homo sapiens",
      "iri" : [ "http://purl.obolibrary.org/obo/NCBITaxon_9606" ]
    } ],
    "externalReferencesPre" : [ {
      "url" : "www.google.com",
      "duo" : [ ]
    } ],
    "externalReferencesPost" : [ {
      "url" : "www.ebi.ac.uk/ena/ERA123456",
      "duo" : [ ]
    } ],
    "relationshipsPre" : [ ],
    "relationshipsPost" : [ {
      "source" : "SAMFAKE123456",
      "type" : "DERIVED_FROM",
      "target" : "SAMFAKE7654321"
    } ],
    "hash" : "09a5a9cddbea9f5bb6302b86b922c408abc92b8b10c78f0662ac7e41fd44e91f"
  },
  "domain" : "self.ExampleDomain",
  "webinSubmissionAccountId" : null,
  "created" : "2021-11-22T10:57:28.502917Z",
  "hash" : "6d15d13a1dd3e55e11abba2ea0e7fc650c1ea3b79fe0b55069ab33be21f0f1e5"
}

Response

HTTP/1.1 201 Created
Location: https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks/6d15d13a1dd3e55e11abba2ea0e7fc650c1ea3b79fe0b55069ab33be21f0f1e5
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1410

{
  "sample" : "SAMFAKE123456",
  "curation" : {
    "attributesPre" : [ {
      "type" : "Organism",
      "value" : "Human",
      "iri" : [ "9606" ]
    } ],
    "attributesPost" : [ {
      "type" : "Organism",
      "value" : "Homo sapiens",
      "iri" : [ "http://purl.obolibrary.org/obo/NCBITaxon_9606" ]
    } ],
    "externalReferencesPre" : [ {
      "url" : "www.google.com",
      "duo" : [ ]
    } ],
    "externalReferencesPost" : [ {
      "url" : "www.ebi.ac.uk/ena/ERA123456",
      "duo" : [ ]
    } ],
    "relationshipsPre" : [ ],
    "relationshipsPost" : [ {
      "source" : "SAMFAKE123456",
      "type" : "DERIVED_FROM",
      "target" : "SAMFAKE7654321"
    } ],
    "hash" : "09a5a9cddbea9f5bb6302b86b922c408abc92b8b10c78f0662ac7e41fd44e91f"
  },
  "domain" : "self.ExampleDomain",
  "webinSubmissionAccountId" : null,
  "created" : "2021-11-22T10:57:28.502917Z",
  "hash" : "6d15d13a1dd3e55e11abba2ea0e7fc650c1ea3b79fe0b55069ab33be21f0f1e5",
  "_links" : {
    "self" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks/6d15d13a1dd3e55e11abba2ea0e7fc650c1ea3b79fe0b55069ab33be21f0f1e5"
    },
    "sample" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456"
    },
    "curation" : {
      "href" : "https://www.ebi.ac.uk/biosamples/curations/09a5a9cddbea9f5bb6302b86b922c408abc92b8b10c78f0662ac7e41fd44e91f"
    }
  }
}
  • Submission using a ENA WEBIN AUTHENTICATION token

Request

POST /biosamples/samples/SAMFAKE123456/curationlinks?authProvider=WEBIN HTTP/1.1
Content-Type: application/json
Authorization: Bearer $TOKEN
Host: www.ebi.ac.uk
Content-Length: 964

{
  "sample" : "SAMFAKE123456",
  "curation" : {
    "attributesPre" : [ {
      "type" : "Organism",
      "value" : "Human",
      "iri" : [ "9606" ]
    } ],
    "attributesPost" : [ {
      "type" : "Organism",
      "value" : "Homo sapiens",
      "iri" : [ "http://purl.obolibrary.org/obo/NCBITaxon_9606" ]
    } ],
    "externalReferencesPre" : [ {
      "url" : "www.google.com",
      "duo" : [ ]
    } ],
    "externalReferencesPost" : [ {
      "url" : "www.ebi.ac.uk/ena/ERA123456",
      "duo" : [ ]
    } ],
    "relationshipsPre" : [ ],
    "relationshipsPost" : [ {
      "source" : "SAMFAKE123456",
      "type" : "DERIVED_FROM",
      "target" : "SAMFAKE7654321"
    } ],
    "hash" : "09a5a9cddbea9f5bb6302b86b922c408abc92b8b10c78f0662ac7e41fd44e91f"
  },
  "domain" : null,
  "webinSubmissionAccountId" : "WEBIN-12345",
  "created" : "2021-11-22T10:57:28.442750Z",
  "hash" : "6d15d13a1dd3e55e11abba2ea0e7fc650c1ea3b79fe0b55069ab33be21f0f1e5"
}

Response

HTTP/1.1 201 Created
Location: https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks/6d15d13a1dd3e55e11abba2ea0e7fc650c1ea3b79fe0b55069ab33be21f0f1e5
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1403

{
  "sample" : "SAMFAKE123456",
  "curation" : {
    "attributesPre" : [ {
      "type" : "Organism",
      "value" : "Human",
      "iri" : [ "9606" ]
    } ],
    "attributesPost" : [ {
      "type" : "Organism",
      "value" : "Homo sapiens",
      "iri" : [ "http://purl.obolibrary.org/obo/NCBITaxon_9606" ]
    } ],
    "externalReferencesPre" : [ {
      "url" : "www.google.com",
      "duo" : [ ]
    } ],
    "externalReferencesPost" : [ {
      "url" : "www.ebi.ac.uk/ena/ERA123456",
      "duo" : [ ]
    } ],
    "relationshipsPre" : [ ],
    "relationshipsPost" : [ {
      "source" : "SAMFAKE123456",
      "type" : "DERIVED_FROM",
      "target" : "SAMFAKE7654321"
    } ],
    "hash" : "09a5a9cddbea9f5bb6302b86b922c408abc92b8b10c78f0662ac7e41fd44e91f"
  },
  "domain" : null,
  "webinSubmissionAccountId" : "WEBIN-12345",
  "created" : "2021-11-22T10:57:28.442750Z",
  "hash" : "6d15d13a1dd3e55e11abba2ea0e7fc650c1ea3b79fe0b55069ab33be21f0f1e5",
  "_links" : {
    "self" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks/6d15d13a1dd3e55e11abba2ea0e7fc650c1ea3b79fe0b55069ab33be21f0f1e5"
    },
    "sample" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456"
    },
    "curation" : {
      "href" : "https://www.ebi.ac.uk/biosamples/curations/09a5a9cddbea9f5bb6302b86b922c408abc92b8b10c78f0662ac7e41fd44e91f"
    }
  }
}

For all the links available in BioSamples check the Links Reference

Accession a sample

POST a sample for accessioning. Accessioned sample is saved as a private sample.

  • Submission using a AAP token (default)

Request

POST /biosamples/samples/accession HTTP/1.1
Content-Type: application/json
Authorization: Bearer $TOKEN
Host: www.ebi.ac.uk
Content-Length: 106

{
  "name" : "FakeSample",
  "update" : "2021-11-22T10:57:28.846711Z",
  "domain" : "self.ExampleDomain"
}

Response

HTTP/1.1 201 Created
Location: https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1060

{
  "name" : "FakeSample",
  "accession" : "SAMFAKE123456",
  "domain" : "self.ExampleDomain",
  "release" : "2121-11-22T10:57:28Z",
  "update" : "2021-11-22T10:57:28.846732Z",
  "submitted" : "2021-11-22T10:57:28.846734Z",
  "characteristics" : { },
  "releaseDate" : "2121-11-22",
  "updateDate" : "2021-11-22",
  "submittedDate" : "2021-11-22",
  "submittedVia" : "JSON_API",
  "create" : "2021-11-22T10:57:28.846733Z",
  "_links" : {
    "self" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456"
    },
    "curationDomain" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456{?curationdomain}",
      "templated" : true
    },
    "curationLinks" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks"
    },
    "curationLink" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks/{hash}",
      "templated" : true
    },
    "structuredData" : {
      "href" : "https://www.ebi.ac.uk/biosamples/structureddata/SAMFAKE123456"
    }
  }
}
  • Submission using a ENA WEBIN AUTHENTICATION token

Request

POST /biosamples/samples/accession?authProvider=WEBIN HTTP/1.1
Content-Type: application/json
Authorization: Bearer $TOKEN
Host: www.ebi.ac.uk
Content-Length: 71

{
  "name" : "FakeSample",
  "update" : "2021-11-22T10:57:28.890153Z"
}

Response

HTTP/1.1 201 Created
Location: https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1071

{
  "name" : "FakeSample",
  "accession" : "SAMFAKE123456",
  "webinSubmissionAccountId" : "WEBIN-12345",
  "release" : "2121-11-22T10:57:28Z",
  "update" : "2021-11-22T10:57:28.890182Z",
  "submitted" : "2021-11-22T10:57:28.890183Z",
  "characteristics" : { },
  "releaseDate" : "2121-11-22",
  "updateDate" : "2021-11-22",
  "submittedDate" : "2021-11-22",
  "submittedVia" : "JSON_API",
  "create" : "2021-11-22T10:57:28.890182Z",
  "_links" : {
    "self" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456"
    },
    "curationDomain" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456{?curationdomain}",
      "templated" : true
    },
    "curationLinks" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks"
    },
    "curationLink" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks/{hash}",
      "templated" : true
    },
    "structuredData" : {
      "href" : "https://www.ebi.ac.uk/biosamples/structureddata/SAMFAKE123456"
    }
  }
}

For all the links available in BioSamples check the Links Reference ls

Validate sample fields

POST a sample to validate its basic fields before submission.

Request

POST /biosamples/validate HTTP/1.1
Content-Type: application/json
Authorization: Bearer $TOKEN
Host: www.ebi.ac.uk
Content-Length: 434

{
  "name" : "fake_sample",
  "update" : "2021-11-22T10:57:28.732378Z",
  "release" : "2021-11-22T10:57:28.732373Z",
  "domain" : "self.ExampleDomain",
  "characteristics" : {
    "material" : [ {
      "text" : "cell line",
      "ontologyTerms" : [ "EFO_0000322" ]
    } ],
    "Organism" : [ {
      "text" : "Homo sapiens",
      "ontologyTerms" : [ "9606" ]
    } ],
    "checklist" : [ {
      "text" : "BSDC00001"
    } ]
  }
}

Response

HTTP/1.1 200 OK
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 590

{
  "name" : "fake_sample",
  "domain" : "self.ExampleDomain",
  "release" : "2021-11-22T10:57:28.732373Z",
  "update" : "2021-11-22T10:57:28.732378Z",
  "taxId" : 9606,
  "characteristics" : {
    "Organism" : [ {
      "text" : "Homo sapiens",
      "ontologyTerms" : [ "9606" ]
    } ],
    "checklist" : [ {
      "text" : "BSDC00001"
    } ],
    "material" : [ {
      "text" : "cell line",
      "ontologyTerms" : [ "EFO_0000322" ]
    } ]
  },
  "releaseDate" : "2021-11-22",
  "updateDate" : "2021-11-22",
  "submittedVia" : "JSON_API",
  "create" : "2021-11-22T10:57:28.732378Z"
}

Post sample with external references

POST sample with external reference attached to it

Request

POST /biosamples/samples HTTP/1.1
Content-Type: application/json
Authorization: Bearer $TOKEN
Host: www.ebi.ac.uk
Content-Length: 204

{
  "name" : "FakeSample",
  "release" : "2021-11-22T10:57:28.750366Z",
  "domain" : "self.ExampleDomain",
  "externalReferences" : [ {
    "url" : "https://www.ebi.ac.uk/ena/data/view/SAMEA00001"
  } ]
}

Response

HTTP/1.1 201 Created
Location: https://www.ebi.ac.uk/biosamples/samples
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1153

{
  "name" : "FakeSample",
  "accession" : "SAMFAKE123456",
  "domain" : "self.ExampleDomain",
  "release" : "2021-11-22T10:57:28.750410Z",
  "update" : "2021-11-22T10:57:28.750412Z",
  "submitted" : "2021-11-22T10:57:28.750414Z",
  "characteristics" : { },
  "externalReferences" : [ {
    "url" : "https://www.ebi.ac.uk/ena/data/view/SAMEA00001",
    "duo" : [ ]
  } ],
  "releaseDate" : "2021-11-22",
  "updateDate" : "2021-11-22",
  "submittedDate" : "2021-11-22",
  "submittedVia" : "JSON_API",
  "create" : "2021-11-22T10:57:28.750413Z",
  "_links" : {
    "self" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples"
    },
    "curationDomain" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples{?curationdomain}",
      "templated" : true
    },
    "curationLinks" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks"
    },
    "curationLink" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks/{hash}",
      "templated" : true
    },
    "structuredData" : {
      "href" : "https://www.ebi.ac.uk/biosamples/structureddata/SAMFAKE123456"
    }
  }
}

Put sample with relationships

PUT sample with relationships

Request

PUT /biosamples/samples/SAMFAKE123456 HTTP/1.1
Content-Type: application/json
Authorization: Bearer $TOKEN
Host: www.ebi.ac.uk
Content-Length: 553

{
  "name" : "FakeSample",
  "accession" : "SAMFAKE123456",
  "domain" : "self.ExampleDomain",
  "release" : "2021-11-22T10:57:28.866948Z",
  "update" : "2021-11-22T10:57:28.866953Z",
  "submitted" : "2021-11-22T10:57:28.866955Z",
  "characteristics" : { },
  "relationships" : [ {
    "source" : "SAMFAKE123456",
    "type" : "derived from",
    "target" : "SAMFAKE654321"
  } ],
  "releaseDate" : "2021-11-22",
  "updateDate" : "2021-11-22",
  "submittedDate" : "2021-11-22",
  "submittedVia" : "JSON_API",
  "create" : "2021-11-22T10:57:28.866954Z"
}

Response

HTTP/1.1 200 OK
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1190

{
  "name" : "FakeSample",
  "accession" : "SAMFAKE123456",
  "domain" : "self.ExampleDomain",
  "release" : "2021-11-22T10:57:28.866948Z",
  "update" : "2021-11-22T10:57:28.866953Z",
  "submitted" : "2021-11-22T10:57:28.866955Z",
  "characteristics" : { },
  "relationships" : [ {
    "source" : "SAMFAKE123456",
    "type" : "derived from",
    "target" : "SAMFAKE654321"
  } ],
  "releaseDate" : "2021-11-22",
  "updateDate" : "2021-11-22",
  "submittedDate" : "2021-11-22",
  "submittedVia" : "JSON_API",
  "create" : "2021-11-22T10:57:28.866954Z",
  "_links" : {
    "self" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456"
    },
    "curationDomain" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456{?curationdomain}",
      "templated" : true
    },
    "curationLinks" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks"
    },
    "curationLink" : {
      "href" : "https://www.ebi.ac.uk/biosamples/samples/SAMFAKE123456/curationlinks/{hash}",
      "templated" : true
    },
    "structuredData" : {
      "href" : "https://www.ebi.ac.uk/biosamples/structureddata/SAMFAKE123456"
    }
  }
}

For all the links available in BioSamples check the Links Reference