# TAG

#### Get tags:

<p class="callout success">GET</p>

<p class="callout info">https://misp.local/tags</p>

##### Response: 

<span style="text-decoration: underline;">**200:**</span>

```
{
  "Tag": [
    {
      "id": "12345",
      "name": "tlp:white",
      "colour": "#ffffff",
      "exportable": true,
      "org_id": "12345",
      "user_id": "12345",
      "hide_tag": false,
      "numerical_value": "12345",
      "is_galaxy": true,
      "is_custom_galaxy": true,
      "inherited": 1
    }
  ]
}
```

**<span style="text-decoration: underline;">403:</span>**

```
{
  "name": "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.",
  "message": "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.",
  "url": "/attributes"
}
```

<span style="text-decoration: underline;">**404:**</span>

```
{
  "name": "Invalid attribute",
  "message": "Invalid attribute",
  "url": "/attributes/1234"
}
```

**<span style="text-decoration: underline;">Default:</span>**

```
{
  "name": "string",
  "message": "string",
  "url": "/attributes"
}
```

#### Get tag by ID:

<p class="callout success">GET</p>

<p class="callout info">https://misp.local/tags/view/{tagId}</p>

##### Response: 

<span style="text-decoration: underline;">**200:**</span>

```
{
  "id": "12345",
  "name": "tlp:white",
  "colour": "#ffffff",
  "exportable": true,
  "org_id": "12345",
  "user_id": "12345",
  "hide_tag": false,
  "numerical_value": "12345",
  "is_galaxy": true,
  "is_custom_galaxy": true,
  "inherited": 1
}
```

**<span style="text-decoration: underline;">403:</span>**

```
{
  "name": "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.",
  "message": "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.",
  "url": "/attributes"
}
```

<span style="text-decoration: underline;">**404:**</span>

```
{
  "name": "Invalid attribute",
  "message": "Invalid attribute",
  "url": "/attributes/1234"
}
```

**<span style="text-decoration: underline;">Default:</span>**

```
{
  "name": "string",
  "message": "string",
  "url": "/attributes"
}
```

#### Add tag:

<p class="callout info">POST</p>

<p class="callout info">https://misp.local/tags/add</p>

##### Response: 

<span style="text-decoration: underline;">**200:**</span>

```
{
  "id": "12345",
  "name": "tlp:white",
  "colour": "#ffffff",
  "exportable": true,
  "org_id": "12345",
  "user_id": "12345",
  "hide_tag": false,
  "numerical_value": "12345",
  "is_galaxy": true,
  "is_custom_galaxy": true,
  "inherited": 1
}
```

**<span style="text-decoration: underline;">403:</span>**

```
{
  "name": "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.",
  "message": "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.",
  "url": "/attributes"
}
```

<span style="text-decoration: underline;">**404:**</span>

```
{
  "name": "Invalid attribute",
  "message": "Invalid attribute",
  "url": "/attributes/1234"
}
```

**<span style="text-decoration: underline;">Default:</span>**

```
{
  "name": "string",
  "message": "string",
  "url": "/attributes"
}
```

#### Delete tag:

<p class="callout info">POST</p>

<p class="callout info">https://misp.local/tags/delete/{tagId}</p>

##### Response: 

<span style="text-decoration: underline;">**200:**</span>

```
{
  "name": "Tag deleted.",
  "message": "Tag deleted.",
  "url": "https://misppriv.circl.lu/tags/delete/1"
}
```

**<span style="text-decoration: underline;">403:</span>**

```
{
  "name": "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.",
  "message": "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.",
  "url": "/attributes"
}
```

<span style="text-decoration: underline;">**404:**</span>

```
{
  "name": "Invalid attribute",
  "message": "Invalid attribute",
  "url": "/attributes/1234"
}
```

**<span style="text-decoration: underline;">Default:</span>**

```
{
  "name": "string",
  "message": "string",
  "url": "/attributes"
}
```

#### Edit tag:

<p class="callout info">POST</p>

<p class="callout info">https://misp.local/tags/edit/{tagId}</p>

##### Request:

```
{
  "name": "tlp:white",
  "colour": "#ffffff",
  "exportable": true,
  "org_id": "12345",
  "user_id": "12345",
  "hide_tag": false,
  "numerical_value": "12345",
  "is_galaxy": true,
  "is_custom_galaxy": true,
  "inherited": 1
}
```

##### Response: 

<span style="text-decoration: underline;">**200:**</span>

```
{
  "Tag": {
    "id": "12345",
    "name": "tlp:white",
    "colour": "#ffffff",
    "exportable": true,
    "org_id": "12345",
    "user_id": "12345",
    "hide_tag": false,
    "numerical_value": "12345",
    "is_galaxy": true,
    "is_custom_galaxy": true,
    "inherited": 1
  }
}
```

**<span style="text-decoration: underline;">403:</span>**

```
{
  "name": "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.",
  "message": "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.",
  "url": "/attributes"
}
```

<span style="text-decoration: underline;">**404:**</span>

```
{
  "name": "Invalid attribute",
  "message": "Invalid attribute",
  "url": "/attributes/1234"
}
```

**<span style="text-decoration: underline;">Default:</span>**

```
{
  "name": "string",
  "message": "string",
  "url": "/attributes"
}
```

#### Search tag:

<p class="callout success">GET</p>

<p class="callout info">https://misp.local/tags/search/{tagSearchTerm}</p>

##### Response: 

<span style="text-decoration: underline;">**200:**</span>

```
[
  {
    "Tag": {
      "id": "12345",
      "name": "tlp:white",
      "colour": "#ffffff",
      "exportable": true,
      "org_id": "12345",
      "user_id": "12345",
      "hide_tag": false,
      "numerical_value": "12345",
      "is_galaxy": true,
      "is_custom_galaxy": true,
      "inherited": 1
    },
    "Taxonomy": {
      "id": "12345",
      "namespace": "tlp",
      "description": "Disclosure is not limited.  Sources may use TLP:WHITE when information carries minimal or no foreseeable risk of misuse, in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed without restriction.",
      "version": "5",
      "enabled": true,
      "exclusive": true,
      "required": true
    },
    "TaxonomyPredicate": {
      "id": "12345",
      "taxonomy_id": "12345",
      "value": "white",
      "expanded": "(TLP:WHITE) Information can be shared publicly in accordance with the law.",
      "colour": "#ffffff",
      "description": "Disclosure is not limited.  Sources may use TLP:WHITE when information carries minimal or no foreseeable risk of misuse, in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed without restriction.",
      "exclusive": true,
      "numerical_value": 0
    }
  }
]
```

**<span style="text-decoration: underline;">403:</span>**

```
{
  "name": "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.",
  "message": "Authentication failed. Please make sure you pass the API key of an API enabled user along in the Authorization header.",
  "url": "/attributes"
}
```

<span style="text-decoration: underline;">**404:**</span>

```
{
  "name": "Invalid attribute",
  "message": "Invalid attribute",
  "url": "/attributes/1234"
}
```

**<span style="text-decoration: underline;">Default:</span>**

```
{
  "name": "string",
  "message": "string",
  "url": "/attributes"
}
```