---
updatedAt: 2026-09-01T20:42:06.000Z
---

# Retrieve segment tag

Returns a tracking tag for a specific segment by ID. Tag format determined by the tag_type query parameter (default: 'js').

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Reference Resources",
    "version": "2.0.0",
    "description": "Buzz API v2"
  },
  "paths": {
    "/segment-tags/{id}": {
      "get": {
        "operationId": "segment_tags_retrieve",
        "description": "Returns a tracking tag for a specific segment by ID. Tag format determined by the tag_type query parameter (default: 'js').",
        "summary": "Retrieve segment tag",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "integer",
              "description": "The unique ID of the segment"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "tag_type",
            "schema": {
              "type": "string",
              "enum": [
                "iframe",
                "image_ip",
                "in_app",
                "js",
                "js_alt"
              ],
              "default": "js"
            },
            "description": "Format of the tag to render. Each value names a template in the segment tag directory. Defaults to 'js'."
          }
        ],
        "tags": [
          "Segments"
        ],
        "security": [
          {
            "nestSessionAuth": []
          },
          {
            "nestBasicAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SegmentTag"
                }
              }
            },
            "description": "Segment tag retrieved successfully."
          },
          "400": {
            "description": "Invalid data provided."
          },
          "401": {
            "description": "Authentication credentials were not provided."
          },
          "403": {
            "description": "Permission denied."
          },
          "404": {
            "description": "Segment not found."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SegmentTag": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The segment ID."
          },
          "tag": {
            "type": "string",
            "readOnly": true,
            "description": "The rendered tag snippet for collecting segment data (JavaScript, image pixel, etc.)."
          }
        },
        "required": [
          "id",
          "tag"
        ]
      }
    },
    "securitySchemes": {
      "nestBasicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Form-based Basic Authentication"
      },
      "nestSessionAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Form-based Basic Authentication"
      }
    }
  },
  "x-explorer-enabled": false,
  "x-samples-languages": [
    "curl",
    "node",
    "ruby",
    "javascript",
    "python",
    "php",
    "java"
  ],
  "servers": [
    {
      "url": "https://{buzz_key}.api.beeswax.com/rest/v2",
      "variables": {
        "buzz_key": {
          "default": "stingersbx",
          "description": "Unique customer ID assigned by the Beeswax"
        }
      }
    }
  ],
  "x-readme": {
    "apply-endpoint-order": true,
    "apply-tag-changes": true
  }
}
```