> ## 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.

# Hit tags

> Used to add a tag or update an attribute when an event occurs or an attribute changes outside your app, for example "balance.updated", "user.balance", etc.

For more information on attributes and tags review our [dedicated guide](https://docs.xtremepush.com/docs/attributes-tags).

## OpenAPI

````json POST /hit/tags
{
  "openapi": "3.1.0",
  "info": {
    "title": "external-api",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.eu.xtremepush.com/api/external"
    }
  ],
  "paths": {
    "/hit/tags": {
      "post": {
        "summary": "Hit tags",
        "description": "Used to add a tag or update an attribute when an event occurs or an attribute changes outside your app, for example \"balance.updated\", \"user.balance\", etc.\n\nFor more information on attributes and tags review our [dedicated guide](https://docs.xtremepush.com/docs/attributes-tags).",
        "operationId": "tag-hit-tags",
        "deprecated": "false",
        "requestBody": {
          "required": "true",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "apptoken",
                  "tags"
                ],
                "properties": {
                  "apptoken": {
                    "type": "string",
                    "description": "Your App token"
                  },
                  "tags": {
                    "type": "array",
                    "description": "An array of objects for tags/attributes to add/update; each object's params as `/hit/tag` above",
                    "items": {
                      "type": "object",
                      "required": [
                        "tag"
                      ],
                      "properties": {
                        "device_id": {
                          "type": "string",
                          "description": "An ID used to identify the user. Use one of *device_id*, *device_external_id*, *device_token*, *device_idfa*, *device_adid*"
                        },
                        "device_external_id": {
                          "type": "string",
                          "description": "An ID used to identify the user. Use one of *device_id*, *device_external_id*, *device_token*, *device_idfa*, *device_adid*"
                        },
                        "device_token": {
                          "type": "string",
                          "description": "An ID used to identify the user. Use one of *device_id*, *device_external_id*, *device_token*, *device_idfa*, *device_adid*"
                        },
                        "device_idfa": {
                          "type": "string",
                          "description": "An ID used to identify the user. Use one of *device_id*, *device_external_id*, *device_token*, *device_idfa*, *device_adid*"
                        },
                        "device_adid": {
                          "type": "string",
                          "description": "An ID used to identify the user. Use one of *device_id*, *device_external_id*, *device_token*, *device_idfa*, *device_adid*"
                        },
                        "tag": {
                          "type": "string",
                          "description": "The tag being hit, eg. `\"user.first_name\"`"
                        },
                        "value": {
                          "type": "string",
                          "description": "The value associated with this tag"
                        },
                        "timestamp": {
                          "type": "string",
                          "format": "date-time",
                          "description": "Timestamp in ms to associate with the occurrence of the event or attribute change"
                        },
                        "metric": {
                          "type": "string",
                          "description": "Used to set any associated metric"
                        }
                      }
                    }
                  }
                }
              },
              "examples": {
                "Update the balance attribute of multiple users": {
                  "value": {
                    "apptoken": "YOUR_APPTOKEN",
                    "tags": [
                      {
                        "device_id": "20",
                        "tag": "user.balance",
                        "value": "500.0"
                      },
                      {
                        "device_id": "21",
                        "tag": "user.balance",
                        "value": "550.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"
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": {
                      "success": "true",
                      "code": "200"
                    }
                  }
                }
              }
            }
          },
          "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": "General error information"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": {
                      "success": "false",
                      "code": "400",
                      "message": "General error information",
                      "errors": [
                        {
                          "text": [
                            "Detailed information about the specific error"
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Tag Methods"
        ]
      }
    }
  }
}
````

