Create a tag for a resource.
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://example.com/api/workspace/tags"), Content = new StringContent("{ \"Owner\": { \"ModuleKey\": \"example\", \"ResourceKind\": \"example\", \"ContextResourceId\": \"example\", \"ResourceObjectId\": \"example\" }, \"TagName\": \"example\", \"Color\": \"example\", \"Category\": \"example\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}const url = 'https://example.com/api/workspace/tags';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"Owner":{"ModuleKey":"example","ResourceKind":"example","ContextResourceId":"example","ResourceObjectId":"example"},"TagName":"example","Color":"example","Category":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/workspace/tags \ --header 'Content-Type: application/json' \ --data '{ "Owner": { "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example" }, "TagName": "example", "Color": "example", "Category": "example" }'Authorizations
Section titled “Authorizations”- None
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Optional access token for clients that cannot set Authorization headers. Prefer Authorization: Bearer <token> when possible.
Request Body
Section titled “Request Body”Request payload to create a tag.
object
object
Tag name.
Optional color value.
Optional category.
Examplegenerated
{ "Owner": { "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example" }, "TagName": "example", "Color": "example", "Category": "example"}Request payload to create a tag.
object
object
Tag name.
Optional color value.
Optional category.
Examplegenerated
{ "Owner": { "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example" }, "TagName": "example", "Color": "example", "Category": "example"}Request payload to create a tag.
object
object
Tag name.
Optional color value.
Optional category.
Examplegenerated
{ "Owner": { "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example" }, "TagName": "example", "Color": "example", "Category": "example"}Responses
Section titled “Responses”OK
object
Tag details.
object
Tag identifier.
object
Tag name.
Optional color value.
Optional category.
Creation timestamp.
Creator user identifier.
Creator display name.
object
object
object
object
Example
{ "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Bad Request
object
Tag details.
object
Tag identifier.
object
Tag name.
Optional color value.
Optional category.
Creation timestamp.
Creator user identifier.
Creator display name.
object
object
object
object
Example
{ "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Forbidden
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Not Found
object
Tag details.
object
Tag identifier.
object
Tag name.
Optional color value.
Optional category.
Creation timestamp.
Creator user identifier.
Creator display name.
object
object
object
object
Example
{ "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}