Add tags to a file

This call allows you to tag files on the Platform. You can tag your files on the Platform with keywords to make it easier to identify and organize files you’ve imported from public datasets or copied between projects. Learn more about tagging your files.

In addition to tagging your files, you can do the following via the API:

Request

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

Example request

PUT v2/files/568e69ade4b0307bc0464164/tags HTTP/1.1
Host: api.sbgenomics.com
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f74
Content-Type: application/json
curl --data '{"tags": ["test 1b", "my first project", "CCLE"}'  -s -H "X-SBG-Auth-Token: 7942f56901534434a054dafc3813bc96" -H "content-type: application/json" -X POST "https://api.sbgenomics.com/v2/files/568e69ade4b0307bc0464164/tag"
from sevenbridges import Api

api = Api(url='https://api.sbgenomics.com/v2',
          token='3259c50e1ac5426ea8f1273259740f74')

file = api.files.get(id='568e69ade4b0307bc0464164')

# set tags
file.tags = ['test 1b', 'my first project', 'CCLE']

# send PUT request to SB API
file.save()

print(file.tags)

Header Fields

Name

Description

X-SBG-Auth-Token
required

Your Seven Bridges Platform authentication token authentication token

Content-Type
required

application/json

Request body

In the body, you should enter a list of key-value pairs. The keys and the values they take are described in the following table.

Key

Datatype of value

Description of value

tags
required

String

Keywords which help you identify your files at a glance.

Example request body

["test 1b","my first project","CCLE"]

Response

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

Example response body

[
    "test 1b",
    "my first project",
    "CCLE"
]