# Update Asset Tag PUT https://api.trebellar.app/api/v2/assets/tags/update Content-Type: application/json Update an existing asset tag. Reference: https://docs.trebellar.app/api-reference/api-resources/assets/update-asset-tag ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Update Asset Tag version: endpoint_assets.updateAssetTag paths: /api/v2/assets/tags/update: put: operationId: update-asset-tag summary: Update Asset Tag description: Update an existing asset tag. tags: - - subpackage_assets parameters: - name: X-Trebellar-Api-Key in: header required: true schema: type: string responses: '200': description: Asset tag updated successfully content: application/json: schema: $ref: '#/components/schemas/UpdateAssetTagResponse' '500': description: Unable to update asset tag content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateAssetTagRequest' components: schemas: UpdateAssetTagRequestAssetTagAssetTypesItems: type: string enum: - value: STRUCTURE - value: FLOOR - value: SPACE - value: DESK - value: SENSOR - value: UNKNOWN - value: SENSOR_GROUP UpdateAssetTagRequestAssetTag: type: object properties: id: type: string assetTypes: type: array items: $ref: '#/components/schemas/UpdateAssetTagRequestAssetTagAssetTypesItems' description: type: string name: type: string color: type: string icon: type: string category: type: string metadata: type: string required: - id UpdateAssetTagRequest: type: object properties: assetTag: $ref: '#/components/schemas/UpdateAssetTagRequestAssetTag' required: - assetTag UpdateAssetTagResponseDataAssetTypesItems: type: string enum: - value: STRUCTURE - value: FLOOR - value: SPACE - value: DESK - value: SENSOR - value: UNKNOWN - value: SENSOR_GROUP UpdateAssetTagResponseData: type: object properties: id: type: string assetTypes: type: array items: $ref: '#/components/schemas/UpdateAssetTagResponseDataAssetTypesItems' description: type: string color: type: string icon: type: string name: type: string category: type: string metadata: type: string required: - id - assetTypes - description - color - icon - name - category UpdateAssetTagResponse: type: object properties: data: $ref: '#/components/schemas/UpdateAssetTagResponseData' required: - data ``` ## SDK Code Examples ```typescript import { TrebellarApiClient } from "@trebellar/api-sdk"; async function main() { const client = new TrebellarApiClient({ environment: "https://api.trebellar.app", }); await client.assets.updateAssetTag({ assetTag: { id: "string", }, }); } main(); ``` ```python from trebellar import TrebellarApi client = TrebellarApi( base_url="https://api.trebellar.app", api_key= ) client.assets.update_asset_tag( asset_tag={ "id": "string" } ) ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.trebellar.app/api/v2/assets/tags/update" payload := strings.NewReader("{\n \"assetTag\": {\n \"id\": \"string\"\n }\n}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("X-Trebellar-Api-Key", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.trebellar.app/api/v2/assets/tags/update") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["X-Trebellar-Api-Key"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"assetTag\": {\n \"id\": \"string\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.put("https://api.trebellar.app/api/v2/assets/tags/update") .header("X-Trebellar-Api-Key", "") .header("Content-Type", "application/json") .body("{\n \"assetTag\": {\n \"id\": \"string\"\n }\n}") .asString(); ``` ```php request('PUT', 'https://api.trebellar.app/api/v2/assets/tags/update', [ 'body' => '{ "assetTag": { "id": "string" } }', 'headers' => [ 'Content-Type' => 'application/json', 'X-Trebellar-Api-Key' => '', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.trebellar.app/api/v2/assets/tags/update"); var request = new RestRequest(Method.PUT); request.AddHeader("X-Trebellar-Api-Key", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"assetTag\": {\n \"id\": \"string\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "X-Trebellar-Api-Key": "", "Content-Type": "application/json" ] let parameters = ["assetTag": ["id": "string"]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.trebellar.app/api/v2/assets/tags/update")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```