---
updatedAt: 2026-07-06T16:30:24.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# Replace Segments for a User

Replace the full list of segments

# 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": {
      "put": {
        "summary": "Replace Segments for a User",
        "description": "Replace the full list of segments",
        "operationId": "replace-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 update",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "group",
            "schema": {
              "type": "integer"
            },
            "description": "Optional. Sets the user's incrementality group (1–100) as part of this request; use `group=null` to clear it, or omit to leave it unchanged. Invalid values reject the entire request."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "segments"
                ],
                "properties": {
                  "segments": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "format": "int32"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"key\": \"ue1-e397eb5990\",\n    \"segments\": [\n        40,\n        41,\n        42\n    ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "example": "ue1-e397eb5990"
                    },
                    "segments": {
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "example": 40,
                        "default": 0
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "userKey is required"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```