> For the complete documentation index, see [llms.txt](https://developers.incidents.cloud.solarwinds.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.incidents.cloud.solarwinds.com/api-reference/services-tagging-rules.md).

# Services/Tagging Rules

## GET /v3/services/{serviceID}/tagging-rules

> Get Tagging Rules

```json
{"openapi":"3.1.0","info":{"title":"Squadcast","version":"1.0.0"},"tags":[{"name":"Services/Tagging Rules"}],"servers":[{"url":"https://api.squadcast.com","description":"production US env","variables":{}},{"url":"https://api.eu.squadcast.com","description":"production EU env","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"V3.Services.TaggingRules.TaggingRuleResponse":{"type":"object","allOf":[{"$ref":"#/components/schemas/V3.Services.TaggingRules.TagRule"}]},"V3.Services.TaggingRules.TagRule":{"type":"object","properties":{"expression":{"type":"string"},"tags":{"allOf":[{"$ref":"#/components/schemas/V3.Services.TaggingRules.TagsObject"}],"description":"The 'tags' field cannot be empty unless the 'expression' or 'basic_expression' explicitly uses 'addTag' or 'addTags' functions."},"is_basic":{"type":"boolean"},"basic_expression":{"$ref":"#/components/schemas/V3.Services.TaggingRules.SubExpressions"}}},"V3.Services.TaggingRules.TagsObject":{"type":"object","properties":{"severity":{"$ref":"#/components/schemas/V3.Services.TaggingRules.TagConfigObject"}},"unevaluatedProperties":{"$ref":"#/components/schemas/V3.Services.TaggingRules.TagConfigObject"}},"V3.Services.TaggingRules.TagConfigObject":{"type":"object","required":["value","color"],"properties":{"value":{"type":"string"},"color":{"type":"string"}}},"V3.Services.TaggingRules.SubExpressions":{"type":"array","items":{"$ref":"#/components/schemas/V3.Services.TaggingRules.ExpressionBranch"}},"V3.Services.TaggingRules.ExpressionBranch":{"type":"object","required":["lhs","rhs"],"properties":{"lhs":{"type":"string"},"op":{"type":"string","enum":["is","is_not","matches","not_contains","gt","lt","gt_eq","lt_eq","call","field_is","field_is_not","field_gt","field_lt","field_gt_eq","field_lt_eq"]},"rhs":{"anyOf":[{"type":"string"},{"type":"boolean"},{"type":"integer","format":"int32"},{"type":"number","format":"float"}]}}},"Common.V3.ErrorMeta":{"type":"object","required":["status","error_message"],"properties":{"status":{"anyOf":[{"type":"string"},{"type":"integer"}]},"error_message":{"type":"string"}},"description":"Represents a single response containing data of type T."}}},"paths":{"/v3/services/{serviceID}/tagging-rules":{"get":{"operationId":"TaggingRules_getTaggingRules","summary":"Get Tagging Rules","parameters":[{"name":"serviceID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The request has succeeded.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/V3.Services.TaggingRules.TaggingRuleResponse"}}},"required":["rules"]}},"required":["data"]}}}},"400":{"description":"The server could not understand the request due to invalid syntax.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"401":{"description":"Access is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"402":{"description":"Client error","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"403":{"description":"Access is forbidden.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"404":{"description":"The server cannot find the requested resource.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"409":{"description":"The request conflicts with the current state of the server.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"422":{"description":"Client error","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"502":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"504":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}}},"tags":["Services/Tagging Rules"]}}}}
```

## POST /v3/services/{serviceID}/tagging-rules

> Create or Update Tagging Rules

```json
{"openapi":"3.1.0","info":{"title":"Squadcast","version":"1.0.0"},"tags":[{"name":"Services/Tagging Rules"}],"servers":[{"url":"https://api.squadcast.com","description":"production US env","variables":{}},{"url":"https://api.eu.squadcast.com","description":"production EU env","variables":{}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"V3.Services.TaggingRules.TaggingRuleResponse":{"type":"object","allOf":[{"$ref":"#/components/schemas/V3.Services.TaggingRules.TagRule"}]},"V3.Services.TaggingRules.TagRule":{"type":"object","properties":{"expression":{"type":"string"},"tags":{"allOf":[{"$ref":"#/components/schemas/V3.Services.TaggingRules.TagsObject"}],"description":"The 'tags' field cannot be empty unless the 'expression' or 'basic_expression' explicitly uses 'addTag' or 'addTags' functions."},"is_basic":{"type":"boolean"},"basic_expression":{"$ref":"#/components/schemas/V3.Services.TaggingRules.SubExpressions"}}},"V3.Services.TaggingRules.TagsObject":{"type":"object","properties":{"severity":{"$ref":"#/components/schemas/V3.Services.TaggingRules.TagConfigObject"}},"unevaluatedProperties":{"$ref":"#/components/schemas/V3.Services.TaggingRules.TagConfigObject"}},"V3.Services.TaggingRules.TagConfigObject":{"type":"object","required":["value","color"],"properties":{"value":{"type":"string"},"color":{"type":"string"}}},"V3.Services.TaggingRules.SubExpressions":{"type":"array","items":{"$ref":"#/components/schemas/V3.Services.TaggingRules.ExpressionBranch"}},"V3.Services.TaggingRules.ExpressionBranch":{"type":"object","required":["lhs","rhs"],"properties":{"lhs":{"type":"string"},"op":{"type":"string","enum":["is","is_not","matches","not_contains","gt","lt","gt_eq","lt_eq","call","field_is","field_is_not","field_gt","field_lt","field_gt_eq","field_lt_eq"]},"rhs":{"anyOf":[{"type":"string"},{"type":"boolean"},{"type":"integer","format":"int32"},{"type":"number","format":"float"}]}}},"Common.V3.ErrorMeta":{"type":"object","required":["status","error_message"],"properties":{"status":{"anyOf":[{"type":"string"},{"type":"integer"}]},"error_message":{"type":"string"}},"description":"Represents a single response containing data of type T."},"V3.Services.TaggingRules.CreateOrUpdateTaggingRulesRequest":{"type":"object","required":["rules"],"properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/V3.Services.TaggingRules.TagRule"}}}}}},"paths":{"/v3/services/{serviceID}/tagging-rules":{"post":{"operationId":"TaggingRules_createOrUpdateTaggingRules","summary":"Create or Update Tagging Rules","parameters":[{"name":"serviceID","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"The request has succeeded and a new resource has been created as a result.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/V3.Services.TaggingRules.TaggingRuleResponse"}}},"required":["rules"]}},"required":["data"]}}}},"400":{"description":"The server could not understand the request due to invalid syntax.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"401":{"description":"Access is unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"402":{"description":"Client error","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"403":{"description":"Access is forbidden.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"404":{"description":"The server cannot find the requested resource.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"409":{"description":"The request conflicts with the current state of the server.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"422":{"description":"Client error","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"502":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"503":{"description":"Service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}},"504":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/Common.V3.ErrorMeta"}},"required":["meta"]}}}}},"tags":["Services/Tagging Rules"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/V3.Services.TaggingRules.CreateOrUpdateTaggingRulesRequest"}}}}}}}}
```
