> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create

> Used to create a new tag or an attribute. Once created this can be updated using tag/tags methods or the profile import method.

<br>

<p>For more information on attributes and tags review our <a href="https://docs.xtremepush.com/docs/attributes-tags">dedicated guide</a>.</p>

<br>

## Type identifiers

<p>Attribute value types are created and displayed by their identifier:</p>

<table>
<thead><tr><th>Type ID</th><th>Type name</th></tr></thead>
<tbody>
<tr><td>0</td><td>String</td></tr>
<tr><td>1</td><td>Number (legacy)</td></tr>
<tr><td>2</td><td>Date (legacy)</td></tr>
<tr><td>3</td><td>JSON (legacy)</td></tr>
<tr><td>4</td><td>Boolean</td></tr>
<tr><td>5</td><td>Number</td></tr>
<tr><td>6</td><td>Integer</td></tr>
<tr><td>7</td><td>Date</td></tr>
<tr><td>8</td><td>DateTime</td></tr>
<tr><td>9</td><td>Array</td></tr>
<tr><td>10</td><td>Object</td></tr>
</tbody>
</table>

## OpenAPI

````json POST /create/tag
{
  "openapi": "3.1.0",
  "info": {
    "title": "external-api",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.eu.xtremepush.com/api/external"
    }
  ],
  "paths": {
    "/create/tag": {
      "post": {
        "summary": "Create",
        "description": "Used to create a new tag or an attribute. Once created this can be updated using tag/tags methods or the profile import method.\n\n<br>\n\n<p>For more information on attributes and tags review our <a href=\"https://docs.xtremepush.com/docs/attributes-tags\">dedicated guide</a>.</p>\n\n<br>\n\n## Type identifiers\n\n<p>Attribute value types are created and displayed by their identifier:</p>\n\n<table>\n<thead><tr><th>Type ID</th><th>Type name</th></tr></thead>\n<tbody>\n<tr><td>0</td><td>String</td></tr>\n<tr><td>1</td><td>Number (legacy)</td></tr>\n<tr><td>2</td><td>Date (legacy)</td></tr>\n<tr><td>3</td><td>JSON (legacy)</td></tr>\n<tr><td>4</td><td>Boolean</td></tr>\n<tr><td>5</td><td>Number</td></tr>\n<tr><td>6</td><td>Integer</td></tr>\n<tr><td>7</td><td>Date</td></tr>\n<tr><td>8</td><td>DateTime</td></tr>\n<tr><td>9</td><td>Array</td></tr>\n<tr><td>10</td><td>Object</td></tr>\n</tbody>\n</table>",
        "operationId": "tag-create",
        "deprecated": "false",
        "requestBody": {
          "required": "true",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "apptoken",
                  "title"
                ],
                "properties": {
                  "apptoken": {
                    "type": "string",
                    "description": "Your App token"
                  },
                  "title": {
                    "type": "string",
                    "description": "Name of the attribute or tag used when setting it programmatically via an SDK/API call"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name displayed in the UI, used for a more human-friendly explainer"
                  },
                  "type": {
                    "type": "integer",
                    "format": "int32",
                    "description": "Required for an attribute. See Type identifiers."
                  },
                  "alias_id": {
                    "type": "string",
                    "description": "Name of the tag for which this is an alias"
                  },
                  "attribute_profile": {
                    "type": "integer",
                    "format": "int32",
                    "description": "Link attribute to User Profiles. Default `0`."
                  },
                  "attribute_client": {
                    "type": "integer",
                    "format": "int32",
                    "description": "Link attribute to Device Profiles. Default `0`."
                  }
                }
              },
              "examples": {
                "Create a string User Profile attribute": {
                  "value": {
                    "apptoken": "YOUR_APPTOKEN",
                    "title": "first_purchase",
                    "name": "first purchase",
                    "type": "0",
                    "attribute_profile": "1",
                    "attribute_client": "0"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": "true",
                      "default": "true"
                    },
                    "code": {
                      "type": "integer",
                      "example": "200",
                      "default": "0"
                    },
                    "message": {
                      "type": "string",
                      "example": "Tag is successfully created"
                    },
                    "model": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "example": "60011986",
                          "default": "0"
                        },
                        "project_id": {
                          "type": "string",
                          "example": "PROJECT_ID"
                        },
                        "title": {
                          "type": "string",
                          "example": "first_purchase"
                        },
                        "name": {
                          "type": "string",
                          "example": "first purchase"
                        },
                        "alias_id": {},
                        "attribute_client": {
                          "type": "integer",
                          "example": "0",
                          "default": "0"
                        },
                        "attribute_profile": {
                          "type": "integer",
                          "example": "1",
                          "default": "0"
                        },
                        "attribute_external": {},
                        "index_value": {},
                        "type": {
                          "type": "integer",
                          "example": "0",
                          "default": "0"
                        },
                        "is_deleted": {}
                      }
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": {
                      "success": "true",
                      "code": "200",
                      "message": "Tag is successfully created",
                      "model": {
                        "id": "60011986",
                        "project_id": "PROJECT_ID",
                        "title": "first_purchase",
                        "name": "first purchase",
                        "attribute_client": "0",
                        "attribute_profile": "1",
                        "type": "0"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": "false",
                      "default": "true"
                    },
                    "code": {
                      "type": "integer",
                      "example": "400",
                      "default": "0"
                    },
                    "message": {
                      "type": "string",
                      "example": "Tag is not created"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Tag already exists in this project": {
                    "value": {
                      "success": "false",
                      "code": "400",
                      "message": "Tag is not created",
                      "errors": {
                        "title": [
                          "The combination \"2780\"-\"Test Attribute 1\" of Project and Tag has already been taken."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Tag Methods"
        ]
      }
    }
  }
}
````

