---
title: Create Tag
description: Reference for the POST /console/v1/tags API endpoint.
product: general
token_estimate: 1076
---
# Create Tag

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## Create Tag

**POST** `/console/v1/tags`

Full URL: `https://statsigapi.net/console/v1/tags`

Create Tag

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| STATSIG-API-KEY | string | Yes | — | apiKey (header) |

## Body (application/json)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| name | string | Yes | — | Constraints: min length: 1, max length: 100 |
| description | string | Yes | — | Constraints: max length: 1000 |
| isCore | boolean | No | false | — |

## Response (application/json)

**200** — Create Tag Response

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object | Yes | — | — |
| data.id | string | Yes | string | id of the tag |
| data.name | string | Yes | a tag | name of the tag |
| data.description | string | Yes | a description | description of the tag |
| data.isCore | boolean | Yes | false | is this a core tag |

```json
{
  "message": "Tag created successfully",
  "data": {
    "id": "string",
    "name": "a tag",
    "description": "a description",
    "isCore": false
  }
}
```

## Code samples

### cURL

```bash
curl -X POST "https://statsigapi.net/console/v1/tags" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY" \
  -d '{
  "name": "my_tag",
  "description": "my tag description",
  "isCore": true
}'
```

### Python

```python
import requests

response = requests.post(
    "https://statsigapi.net/console/v1/tags",
    headers={
        "Content-Type": "application/json",
        "STATSIG-API-KEY": "YOUR_API_KEY"
    },
    json={
  "name": "my_tag",
  "description": "my tag description",
  "isCore": true
}
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://statsigapi.net/console/v1/tags", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "STATSIG-API-KEY": "YOUR_API_KEY"
  },
  body: JSON.stringify({
  "name": "my_tag",
  "description": "my tag description",
  "isCore": true
})
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://statsigapi.net/console/v1/tags");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "STATSIG-API-KEY: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$body = json_encode({
  "name": "my_tag",
  "description": "my tag description",
  "isCore": true
});
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
body := []byte("{\"name\":\"my_tag\",\"description\":\"my tag description\",\"isCore\":true}")
req, _ := http.NewRequest("POST", "https://statsigapi.net/console/v1/tags", bytes.NewReader(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("STATSIG-API-KEY", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://statsigapi.net/console/v1/tags"))
      .method("POST", HttpRequest.BodyPublishers.ofString("{\"name\":\"my_tag\",\"description\":\"my tag description\",\"isCore\":true}"))
.header("Content-Type", "application/json")
      .header("STATSIG-API-KEY", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://statsigapi.net/console/v1/tags")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["STATSIG-API-KEY"] = "YOUR_API_KEY"
request.body = "{\"name\":\"my_tag\",\"description\":\"my tag description\",\"isCore\":true}"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

