# 태그 API

<Aside type="note">
HWID 와 UserID 에 대한 태그 값을 설정하려면 Device API 의 [/setTags](/ko/developer/api-reference/device-api#settags) 메서드를 사용하세요.
</Aside>

## addTag

`POST` `https://api.pushwoosh.com/json/1.3/addTag`

계정에 태그를 생성합니다.

#### 요청 본문

| 이름                                       | 타입    | 설명                                                                                              |
| ------------------------------------------ | ------- | -------------------------------------------------------------------------------------------------------- |
| auth\*     | string  | [Pushwoosh Control Panel](/ko/developer/api-reference/api-identifiers/#api-access-token)의 API 액세스 토큰입니다.                                                           |
| tag\*      | object  | 태그 매개변수입니다.                                                                                          |
| tag.name\* | string  | 태그 이름입니다.                                                                                                |
| tag.type\* | integer | 태그 타입입니다. 아래에서 가능한 값을 확인하세요.                                                                     |
| tag.user\_specific | boolean | `true`인 경우, 태그 값은 사용자 수준에 저장되며 UserID 로 설정 시 사용자의 모든 기기에서 공유됩니다. `false`(기본값)인 경우, 태그는 기기 수준이며 HWID 별로 설정됩니다. |

<Tabs>
<TabItem label="200">
```json
{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "result": true
  }
}
```
</TabItem>
</Tabs>



```json title="예시"
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H", // 필수. Pushwoosh Control Panel의 API 액세스 토큰
    "tag": {
      "name": "TAG_NAME",           // 필수.
      "type": 1,                    // 필수. 아래에서 가능한 값을 확인하세요
      "user_specific": false        // 선택. true = 사용자 수준 태그 (모든 기기에서 공유); false = 기기 수준 태그 (기본값)
    }
  }
}
```

**가능한 태그 값 타입:**

* 1 - 정수 (Integer)
* 2 - 문자열 (String)
* 3 - 리스트 (List)
* 4 - 날짜 (Date)
* 5 - 불리언 (Boolean)
* 6 - 십진수 (Decimal). 예: 19.95
* 7 - 버전 (Version). 예: "1.0.0.0"



## deleteTag

`POST` `https://api.pushwoosh.com/json/1.3/deleteTag`

데이터베이스에서 태그와 관련된 모든 정보를 완전히 제거합니다.

#### 요청 본문

| 이름                                       | 타입   | 설명                                    |
| ------------------------------------------ | ------ | ---------------------------------------------- |
| auth\*     | string | [Pushwoosh Control Panel](/ko/developer/api-reference/api-identifiers/#api-access-token)의 API 액세스 토큰입니다. |
| tag\*      | object | 태그 매개변수입니다.                                |
| tag.name\* | string | 삭제할 [태그](/ko/developer/api-reference/api-identifiers/#tag)의 이름입니다.                       |

<Tabs>
<TabItem label="200">
```json
{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "result": true
  }
}
```
</TabItem>
</Tabs>



```json title="예시"
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H", // 필수. Pushwoosh Control Panel의 API 액세스 토큰
    "tag": {
      "name": "TAG_NAME"            // 필수. 삭제할 태그의 이름
    }
  }
}


```

## listTags

`POST` `https://api.pushwoosh.com/json/1.3/listTags`

계정의 태그 목록을 검색합니다.

#### 요청 본문

| 이름                                   | 타입   | 설명                                    |
| -------------------------------------- | ------ | ---------------------------------------------- |
| auth\* | string | [Pushwoosh Control Panel](/ko/developer/api-reference/api-identifiers/#api-access-token)의 API 액세스 토큰입니다. |

<Tabs>
<TabItem label="200">
```json
{
  "status_code": 200,
  "status_message": "OK", 
  "response": {
    "tags": [{
      "name":"Language",
      "type":2
    }, {
      "name":"List tag",
      "type":3
    }]
  }
}
```
</TabItem>
</Tabs>



```json title="예시"
{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H" // Pushwoosh Control Panel의 API 액세스 토큰
  }
} 
```

**태그 타입**:

* 1 - 정수 (Integer)
* 2 - 문자열 (String)
* 3 - 리스트 (List)
* 4 - 날짜 (Date)
* 5 - 불리언 (Boolean)
* 6 - 십진수 (Decimal). 예: 19.95
* 7 - 버전 (Version). 예: "1.0.0.0"