Change file details

/files/{file_id}

This call allows you to change a file's name and metadata.

Files are specified by their IDs, which you can obtain by making the API call to list all files accessible to you.

The call returns a complete CWL representation of the file, including all its metadata, according to the changes you have specified.

https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/files/{file_id}

👍

Metadata

Learn more about metadata fields.

Request

Example request

POST /v2/files/567890abc9b0307bc0414164 HTTP/1.1
Host: api.sb.biodatacatalyst.nhlbi.nih.gov
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f74
curl --data '{"metadata": {"library": "Library1"}}'  -s -H "X-SBG-Auth-Token: 6282d5e2121d43e7900e9d52b15845e7" -H "content-type: application/json" -X POST "https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/files/567890abc9b0307bc0414164"

In this example, the value for the metadata field library has been changed to 'Library1'.

Example request body

{
  "metadata": {
      "library": "Library1"
  }
}

Header Fields

NameDescription
X-SBG-Auth-Token
required
Your authentication token.

Path parameters

NameDescription
file_idThe ID of the file whose details you are editing.

Query parameters

NameData typeDescription
fieldsstringSelector specifying a subset of fields to include in the response.

Response

See a list of response codes that may be contained in the body of the response.

Example response body

{
  "size": "7313069069",
  "metadata": {
    "file_type": "vcf",
    "file_extension": "VCF",
    "library": "Library1"
  },
  "href": "https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/files/567890abc9b0307bc0414164",
  "id": "567890abc9b0307bc0414164",
  "name": "_1_1000G_phase1.snps.high_confidence.b37.vcf"
}