Update file details

This call updates the name, the full set metadata, and tags 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.

If you want to update metadata for multiple files, the recommended way is to do it in bulk considering the API rate limit (learn more).

πŸ“˜

If you are using Seven Bridges Platform EU, please use the following endpoint: https://eu-api.sbgenomics.com/v2/files/{file_id}

🚧

Metadata

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

🚧

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 about identifying objects in the API, see the section on identifying objects.

Custom metadata fields

As well as the standard set of metadata fields that can be seen through the visual interface, you are also able to add custom metadata for your files. Custom metadata fields are user-defined key-value pairs that allow you to provide additional metadata associated to files on the Platform. Custom metadata can be added via the command line uploader or via the API, but not through the visual interface.

The following rules apply to custom metadata fields:

  • Keys and values are case sensitive unless explicitly treated differently by a tool or a part of the Platform.
  • Maximum number of key-value pairs per file is 1000, including null-value keys.
  • Keys and values are UTF-8 encoded strings.
  • Maximum length of a key is 100 bytes (UTF-8 encoding).
  • Maximum length of a value is 300 bytes (UTF-8 encoding).

Tags

You can use this API request to add a set of tags for your file. Any list of tags specified in this request will overwrite the previously set tags on the file. Learn more about tagging your files on the Platform.

In addition to editing tags on your files, you can do the following via the API:

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". This request also adds the tags test 1b and sample.

{
  "name": "1_1000Genomes_phase1.snps.high_confidence.b37.vcf",
  "metadata": {
    "disease_type": "Acute Myeloid Leukemia"
    },
  "tags": ["test 1b", "sample"]
}

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.
  • The object tags lists the tags for the file. Learn more about tagging your files on the Platform.
Language