# Tags

## GET /v1/crm/tags

>

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"ListTagsApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/ListTags_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"ListTags_Data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TagM"}},"next":{"type":"string"}},"required":["items"]},"TagM":{"type":"object","properties":{"type":{"type":"string","enum":["auto","campaign-status","manual"]},"locales":{"type":"object"},"sortBy":{"type":"string"},"uid":{"type":"string"},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"}},"required":["type","locales","uid"]}}},"paths":{"/v1/crm/tags":{"get":{"operationId":"Tags_list","parameters":[{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTagsApiResponse"}}}}},"tags":["Tags"]}}}}
```

## GET /v1/crm/tags/{uid}

>

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"GetTagApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/GetTag_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"GetTag_Data":{"type":"object","properties":{"item":{"$ref":"#/components/schemas/GetTag_Data_Item"},"dataModels":{"type":"array","items":{"$ref":"#/components/schemas/GetTag_Data_DataModelsItem"}}},"required":["item"]},"GetTag_Data_Item":{"type":"object","properties":{"type":{"type":"string","enum":["auto","campaign-status","manual"]},"locales":{"type":"object"},"sortBy":{"type":"string"},"uid":{"type":"string"},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"}},"required":["type","locales","uid"]},"GetTag_Data_DataModelsItem":{"type":"object","properties":{"uid":{"type":"string"},"columns":{"type":"array","items":{"$ref":"#/components/schemas/GetTag_Data_DataModelsItem_ColumnsItem"}}},"required":["uid","columns"]},"GetTag_Data_DataModelsItem_ColumnsItem":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["date","jsonb","numeric","text","timestamptz"]},"attribute":{"type":"string"},"cid":{"type":"string"},"lov":{"type":"array","items":{"type":"object"}},"locales":{"type":"object"}},"required":["name","type"]},"GetTagApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/GetTag_Error"}},"required":["error"]},"GetTag_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/GetTag_ErrorCodes_enum"}]}},"required":["code"]},"GetTag_ErrorCodes_enum":{"type":"string","enum":["NotFound"]}}},"paths":{"/v1/crm/tags/{uid}":{"get":{"operationId":"Tags_get","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTagApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTagApiError"}}}}},"tags":["Tags"]}}}}
```

## GET /v1/crm/tags/{uid}/customers

>

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"FetchTagCustomersApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/FetchTagCustomers_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"FetchTagCustomers_Data":{"type":"object","properties":{"customers":{"type":"array","items":{"$ref":"#/components/schemas/FetchTagCustomers_Data_CustomersItem"}},"count":{"type":"number"},"next":{"type":"string"}},"required":["customers"]},"FetchTagCustomers_Data_CustomersItem":{"type":"object","properties":{"customerUid":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"gender":{"type":"string"},"tagEligible":{"type":"string"},"tagAssigned":{"type":"string"},"tagEffectiveStartTime":{"type":"string"},"tagEffectiveEndTime":{"type":"string","nullable":true},"tagAssignmentUid":{"type":"string","nullable":true}},"required":["customerUid","firstName","lastName","gender","tagEligible","tagAssigned","tagEffectiveStartTime","tagEffectiveEndTime","tagAssignmentUid"]},"FetchTagCustomersApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/FetchTagCustomers_Error"}},"required":["error"]},"FetchTagCustomers_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/FetchTagCustomers_ErrorCodes_enum"}]}},"required":["code"]},"FetchTagCustomers_ErrorCodes_enum":{"type":"string","enum":["UNSUPPORTED_DATA_MODEL_PARAM"]}}},"paths":{"/v1/crm/tags/{uid}/customers":{"get":{"operationId":"Tags_listCustomers","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FetchTagCustomersApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FetchTagCustomersApiError"}}}}},"tags":["Tags"]}}}}
```

## GET /v1/crm/tag-assignments/{customerUid}

>

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"ListTagAssignemntsApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/ListTagAssignemnts_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"ListTagAssignemnts_Data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/TagAssignmentM"}},"next":{"type":"string"}},"required":["items"]},"TagAssignmentM":{"type":"object","properties":{"eligible":{"type":"boolean"},"effectiveStartTime":{"type":"string"},"effectiveEndTime":{"type":"string","nullable":true},"attrs":{"$ref":"#/components/schemas/Record_5494b96e"},"uid":{"type":"string"},"tagUid":{"type":"string"},"customerUid":{"type":"string"},"effective":{"type":"boolean"},"tag":{"$ref":"#/components/schemas/TagAssignmentM_Tag"},"benefits":{"type":"array","items":{"$ref":"#/components/schemas/TagAssignmentBenefitM"}},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"}},"required":["eligible","effectiveStartTime","uid","tagUid","customerUid","effective","tag","benefits"]},"Record_5494b96e":{"type":"object","properties":{}},"TagAssignmentM_Tag":{"type":"object","properties":{"type":{"type":"string","enum":["auto","campaign-status","manual"]},"locales":{"type":"object"},"sortBy":{"type":"string"},"uid":{"type":"string"},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"}},"required":["type","locales","uid"]},"TagAssignmentBenefitM":{"type":"object","properties":{"locales":{"type":"object"},"type":{"type":"string","enum":["dicount-flat","discount-absolute","discount-percent","free-dessert","free-drink","priority"]},"amount":{"type":"number"},"discountRef":{"type":"string","nullable":true},"sortNumber":{"type":"number","nullable":true},"id":{"type":"string"},"uid":{"type":"string"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/BenefitRuleM"}},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"},"applicable":{"type":"boolean"},"overwritten":{"type":"boolean"}},"required":["locales","type","amount","id","uid","rules","applicable","overwritten"]},"BenefitRuleM":{"type":"object","properties":{"conditions":{"type":"array","items":{"$ref":"#/components/schemas/BenefitRuleM_ConditionsItem"}},"action":{"type":"string","enum":["apply","exclude"]},"sortNumber":{"type":"number"},"id":{"type":"string"},"uid":{"type":"string"},"createdAt":{"type":"string"},"createdVia":{"type":"string"},"createdBy":{"type":"string"},"updatedAt":{"type":"string"},"updatedVia":{"type":"string"},"updatedBy":{"type":"string"}},"required":["conditions","action","sortNumber","id","uid"]},"BenefitRuleM_ConditionsItem":{"type":"object","properties":{"key":{"type":"string","enum":["basic.date","basic.day","basic.time"]},"operator":{"type":"string","enum":["contains","endsWith","equals","greater","greaterOrEquals","in","less","lessOrEquals","notEquals","startsWith"]},"value":{"type":"string"}},"required":["key","operator","value"]}}},"paths":{"/v1/crm/tag-assignments/{customerUid}":{"get":{"operationId":"TagAssignments_get","parameters":[{"name":"customerUid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTagAssignemntsApiResponse"}}}}},"tags":["Tags"]}}}}
```

## POST /v1/crm/tag-assignments

>

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"CreateTagAssignmentApiRequest":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/CreateTagAssignment_Params"}},"required":["params"]},"CreateTagAssignment_Params":{"type":"object","properties":{"tagUid":{"type":"string"},"customerUid":{"type":"string"},"eligible":{"type":"boolean"},"effectiveStartTime":{"type":"string"},"effectiveEndTime":{"type":"string","nullable":true},"attrs":{"$ref":"#/components/schemas/__type_174bf132"}},"required":["tagUid","customerUid","effectiveStartTime"]},"__type_174bf132":{"type":"object","properties":{}},"CreateTagAssignmentApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/CreateTagAssignment_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"CreateTagAssignment_Data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}},"paths":{"/v1/crm/tag-assignments":{"post":{"operationId":"TagAssignments_create","parameters":[{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTagAssignmentApiRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTagAssignmentApiResponse"}}}}},"tags":["Tags"]}}}}
```

## DELETE /v1/crm/tag-assignments/{uid}

>

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"DeleteTagAssignmentApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/DeleteTagAssignment_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"DeleteTagAssignment_Data":{"type":"object","properties":{"succeed":{"type":"boolean"}},"required":["succeed"]}}},"paths":{"/v1/crm/tag-assignments/{uid}":{"delete":{"operationId":"TagAssignments_delete","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteTagAssignmentApiResponse"}}}}},"tags":["Tags"]}}}}
```

## PATCH /v1/crm/tag-assignments/{uid}

>

```json
{"openapi":"3.0.0","info":{"title":"Gormic CRM API","version":"1.0"},"security":[{"api-key":[]}],"components":{"securitySchemes":{"api-key":{"type":"apiKey","in":"header","name":"api-key","description":"API Key"}},"schemas":{"UpdateTagAssignmentApiRequest":{"type":"object","properties":{"params":{"$ref":"#/components/schemas/UpdateTagAssignment_Params"}},"required":["params"]},"UpdateTagAssignment_Params":{"type":"object","properties":{"uid":{"type":"string"},"eligible":{"type":"boolean"},"effectiveStartTime":{"type":"string"},"effectiveEndTime":{"type":"string","nullable":true},"attrs":{"$ref":"#/components/schemas/__type_174bf132"}},"required":["uid"]},"__type_174bf132":{"type":"object","properties":{}},"UpdateTagAssignmentApiResponse":{"type":"object","properties":{"app":{"type":"string"},"service":{"type":"string"},"warnings":{"type":"array","items":{"type":"object"}},"instanceId":{"type":"string"},"requestId":{"type":"string"},"data":{"$ref":"#/components/schemas/UpdateTagAssignment_Data"}},"required":["app","service","warnings","instanceId","requestId","data"]},"UpdateTagAssignment_Data":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"UpdateTagAssignmentApiError":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/UpdateTagAssignment_Error"}},"required":["error"]},"UpdateTagAssignment_Error":{"type":"object","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/UpdateTagAssignment_ErrorCodes_enum"}]}},"required":["code"]},"UpdateTagAssignment_ErrorCodes_enum":{"type":"string","enum":["NoChanges"]}}},"paths":{"/v1/crm/tag-assignments/{uid}":{"patch":{"operationId":"TagAssignments_update","parameters":[{"name":"uid","required":true,"in":"path","schema":{"type":"string"}},{"name":"organization-id","in":"header","required":true,"schema":{"type":"string"},"description":"Organization ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTagAssignmentApiRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTagAssignmentApiResponse"}}}},"400":{"description":"Functional Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTagAssignmentApiError"}}}}},"tags":["Tags"]}}}}
```
