Skip to content
Get started

Update Tags

client.assets.updateTags(stringassetID, AssetUpdateTagsParams { add, _delete, strict } body, RequestOptionsoptions?): AssetUpdateTagsResponse { added, deleted }
PUT/assets/{assetId}/tags

Add/delete tags on a specific asset

ParametersExpand Collapse
assetID: string
body: AssetUpdateTagsParams { add, _delete, strict }
add?: Array<string>

The list of tags to add

_delete?: Array<string>

The list of tags to delete

strict?: boolean

If true, the function will throw an error if:

  • one of the tags to add already exists
  • one of the tags to delete is not found If false, the endpoint will behave as if it was idempotent
ReturnsExpand Collapse
AssetUpdateTagsResponse { added, deleted }
added: Array<string>

The list of added tags

deleted: Array<string>

The list of deleted tags

Update Tags

import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const response = await client.assets.updateTags('assetId');

console.log(response.added);
{
  "added": [
    "string"
  ],
  "deleted": [
    "string"
  ]
}
Returns Examples
{
  "added": [
    "string"
  ],
  "deleted": [
    "string"
  ]
}