Update file details

files/{file_id}

For general information on the API, including formatting, parameters, and pagination, please see the API Overview.

This call updates the name and the full set metadata for a specified file.

Files are specified by their IDs, which you can obtain by making the API call to list files in a project .

🚧

Metadata

Learn more about metadata fields and their permissible values on the Seven Bridges Platform.

https://api.sbgenomics.com/v2/files/{file_id}
https://gcp-api.sbgenomics.com/v2/files/{file_id}

🚧

File names and IDs

Note that the file name is not the same as its ID. The ID is a hexadecimal string, automatically assigned to a file in a project. The file's name is a human-readable string. For information, please see the API overview.

Request

Example request

PATCH /v2/files/567890abc4f3066bc3750174 HTTP/1.1
Host: api.sbgenomics.com
X-SBG-Auth-Token: 6282d5e2121d43e7900e9d52b15845e7
curl --data '{"metadata": {disease_type: "Acute Myeloid Leukemia"}} -s -H "X-SBG-Auth-Token: 6282d5e2121d43e7900e9d52b15845e7" -H "content-type: application/json" -X PATCH "https://api.sbgenomics.com/v2/files/567890abc4f3066bc3750174"

Header Fields

NameDescription
X-SBG-Auth-Token
required
Your Seven Bridges Platform authentication token.

Path parameters

NameDescription
file_idThe ID of the file whose details you want to update.

Query parameters

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

Request body

You should enter the body as key-value pairs, with the following format:

KeyDatatype of valueDescription of value
namestringThe new name of the file.
metadatadictionary of key-value pairs. The keys and values are strings.The metadata fields and their values that you want to update.

Example request body

In the example below, I have submitted a request to change the file name to "1_1000Genomes_phase1.snps.high_confidence.b37.vcf" and to have the metadata contain only the field disease_type with value "Acute Myeloid Leukemia".

{
	"name": "1_1000Genomes_phase1.snps.high_confidence.b37.vcf"
  "metadata": {
  	disease_type: "Acute Myeloid Leukemia"
    }
}

Response

See a list of Seven Bridges Platform-specific response codes that may be contained in the body of the response.

Example response body

Notice that the metadata contains only the fields specified in the request body.

{
  "href": "https://api.sbgenomics.com/v2/files/567890abc4f3066bc3750174",
  "id": "567890abc4f3066bc3750174",
  "name": "1_1000Genomes_phase1.snps.high_confidence.b37.vcf",
  "size": 363,
  "project": "RFranklin/my-project",
  "created_on": "2015-12-11T11:01:49Z",
  "modified_on": "2016-01-07T12:22:12Z",
  "origin": {},
  "metadata": {
    "disease_type": "Acute Myeloid Leukemia",
  }
}

👍

Interpreting the response body

The object origin denotes the task that produced the file, if it was created by a task on the Seven Bridges Platform.

The dictionary object metadata lists the metadata fields and values for the file.

Language