Skip to main content
POST
/
api
/
v1
/
samples
/
preupload
POST samples preupload
curl --request POST \
  --url https://app.onecodex.com/api/v1/samples/preupload \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "metadata": {
    "custom": {},
    "date_collected": "2023-11-07T05:31:56Z",
    "date_sequenced": "2023-11-07T05:31:56Z",
    "description": "<string>",
    "external_sample_id": "<string>",
    "library_type": "WGS",
    "location_lat": 0,
    "location_lon": 0,
    "location_string": "<string>",
    "name": "<string>",
    "platform": "454 sequencing",
    "sample_type": "Isolate",
    "starred": false
  },
  "project": {
    "type": "<unknown>",
    "pattern": "<unknown>"
  },
  "tags": []
}
'
{
  "sample_id": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://developer.onecodex.com/llms.txt

Use this file to discover all available pages before exploring further.

For situations where you’d like to create Samples on the One Codex Platform, but your NGS data is not yet available, we support a “pre-upload” workflow. Simply POST to the /preupload route to receive a unique sample ID. That sample ID may be then passed when uploading your data (see Starting an Upload) to upload data for the pre-uploaded sample instead of creating a new sample. Samples created via the /preupload route will have a visibility property with a value awaiting data. These samples and their metadata will be private, though they may be shared with other accounts if associated with a project at creation time (see Sharing & Projects for more details on sharing data via projects).

Authorizations

X-API-Key
string
header
required

Body

application/json
metadata
object

A metadata object.

project
object

An optional project.

tags
object[]

Response

200 - application/json

Successful operation

sample_id
string