---
updatedAt: 2025-09-18T22:03:03.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# Get Segments for a User

This endpoint returns all segments for a specific user record in UserDB.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "userdb",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://e-{networkId}.adzerk.net/udb/{networkId}",
      "variables": {
        "networkId": {
          "default": "networkId"
        }
      }
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/segments": {
      "get": {
        "summary": "Get Segments for a User",
        "description": "This endpoint returns all segments for a specific user record in UserDB.",
        "operationId": "get-segments-for-a-user",
        "parameters": [
          {
            "name": "networkId",
            "in": "path",
            "description": "Your account (network) ID",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          },
          {
            "name": "userKey",
            "in": "query",
            "description": "The User ID to fetch",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"key\": \"ue1-e397eb5990\",\n    \"segments\": [\n        78\n    ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "example": "ue1-e397eb5990"
                    },
                    "segments": {
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "example": 78,
                        "default": 0
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "userKey is required"
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```