Edit details of multiple files

This call edits the details for multiple specified files. Use this call to modify the existing information for the files or add new information while preserving omitted parameters. For each of the specified files, the call edits its name, tags, and metadata.

For each of the specified files, the call sets a new name, new tags, and metadata. The maximum number of files you can edit the details for per call is 100.

Request

https://cavatica-api.sbgenomics.com/v2/bulk/files/edit

Example request

POST v2/bulk/files/edit
Host: cavatica-api.sbgenomics.com
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f75
curl -X POST \
  https://cavatica-api.sbgenomics.com/v2/bulk/files/update \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 313ceab4-4165-4cff-b9db-146d912f4aaf' \
  -H 'X-SBG-Auth-Token: af055f57c30a4e2d99c1fd42101f13da' \
  -d '{
    "items": [
        {
            "file_id": "5a97d4741c94edbe8590492a",
                "name": "api_test2",
                "tags": ["test9"],
                "metadata": {
                    "sample_id": "sample1"
                }
        },
        {
            "file_id": "5a97d4741c94edbe85904949",
                "metadata": {
                    "sample_id": "sample1"
                }
        },
        {
            "file_id": "5a97d4701c94edbe8590471e",
                "tags": ["test3"]
        },
        {
            "file_id": "5a97d4741c94edbe8590494c"
        }
    ]
}'

Header Fields

NameDescription
X-SBG-Auth-Token
required
Your CAVATICA authentication token.
Content-Type
required
application/json

Request body

KeyData typeDescription
file_idstringThe IDs of the file you are editing. The maximum number of files you can edit the details for per call is 100.
namestringThe new name of the file.
tagsarrayThe tags you want to edit.
metadatadictionary of key-value pairsThe metadata fields and their values that you want to edit.

Response

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

Response body

The response contains information the updated information for all of the edited files.

Example response body

{
    "items": [
        {
            "resource": {
                "href": "https://cavatica-api.sbgenomics.com/v2/files/5a97d4741c94edbe85904936",
                "id": "5a97d4741c94edbe85904936",
                "name": "1000G_phase1.snps.high_confidence.b37.vcf",
                "size": 7313069069,
                "project": "rfranklin/my-project",
                "created_on": "2018-03-01T10:22:44Z",
                "modified_on": "2018-03-01T10:22:44Z",
                "storage": {
                    "type": "PLATFORM"
                },
                "origin": {},
                "tags": [],
                "metadata": {}
            }
        },
        {
            "resource": {
                "href": "https://cavatica-api.sbgenomics.com/v2/files/5a97d4741c94edbe85904936",
                "id": "2b86s8451c94edbe34904936",
                "name": "C835.HCC1143_BL.4.contig_1_mpileup_SNPs.filtered.Somatic.hc.and_more.concat.sorted.reordered.vcf",
                "size": 5313069069,
                "project": "rfranklin/my-project",
                "created_on": "2018-03-01T10:22:44Z",
                "modified_on": "2018-03-01T10:22:44Z",
                "storage": {
                    "type": "PLATFORM"
                },
                "origin": {},
                "tags": [],
                "metadata": {}
            }
        }
        }
    ]
}
Language