---
updatedAt: 2025-09-18T21:59:41.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# Update Segment

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "management-api-2",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.kevel.co"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "X-Adzerk-ApiKey",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/segment/{SegmentId}": {
      "put": {
        "summary": "Update Segment",
        "description": "",
        "operationId": "update-segment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "Name": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "The human-friendly name of the segment. Max length is 200 characters."
                  },
                  "Source": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Where the segment came from. Max length is 100 characters."
                  },
                  "Reach": {
                    "type": "object",
                    "description": "The estimated reach of the segment for all time and the last 4 weeks.",
                    "properties": {
                      "all_time": {
                        "type": "integer",
                        "format": "int32"
                      },
                      "28d": {
                        "type": "integer",
                        "format": "int32"
                      }
                    }
                  },
                  "Description": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "An extended human-friendly description of the segment. Max length is 500 characters."
                  },
                  "Category": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "The category a segment belongs to. Max length is 100 characters."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"Id\": 123456,\n  \"Source\": \"audience\",\n  \"Name\": \"Updated Name\",\n  \"Reach\": { \"all_time\": 3187463, \"28d\": 387434 },\n  \"Description\": \"top 1% spenders in the last 30 days.\",\n  \"Category\": \"CRM\",\n  \"IsDeleted\": false\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "Id": {
                      "type": "integer",
                      "example": 123456,
                      "default": 0
                    },
                    "Source": {
                      "type": "string",
                      "example": "audience"
                    },
                    "Name": {
                      "type": "string",
                      "example": "Updated Name"
                    },
                    "Reach": {
                      "type": "object",
                      "properties": {
                        "all_time": {
                          "type": "integer",
                          "example": 3187463,
                          "default": 0
                        },
                        "28d": {
                          "type": "integer",
                          "example": 387434,
                          "default": 0
                        }
                      }
                    },
                    "Description": {
                      "type": "string",
                      "example": "top 1% spenders in the last 30 days."
                    },
                    "Category": {
                      "type": "string",
                      "example": "CRM"
                    },
                    "IsDeleted": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X PUT -H \"X-Adzerk-ApiKey:<APIKEY>\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/segment/{SegmentId} --data-binary '{\"Category\":\"CRM\",\"Source\":\"audience\",\"Description\":\"top 1% spenders in the last 30 days.\",\"Reach\":\"{\"all_time\":3187463, \"28d\":387434}\",\"Name\":\"Updated Name\",\"Id\":123456}'"
            },
            {
              "language": "javascript",
              "code": "// coming soon to @adzerk-management-sdk\n\nconst Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\nlet segment = await client.run(\"segment\", \"update\", {\n\t\tid:123456,\n    name: \"updated name\",\n    source: \"audience,\n    description: \"top 1% spenders in the last 30 days.\",\n  });\n\n  console.log(segment);\n}\n\nupdateSegment();"
            },
            {
              "language": "ruby",
              "code": "require \"adzerk\"\n\ndef update_segment()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.segment.update(id: 123456, name: \"Updated Name\", source: \"audience\", description: \"top 1% spenders in the last 30 days.\")\nend\nupdate_segment()"
            }
          ],
          "samples-languages": [
            "curl",
            "javascript",
            "ruby"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "X-Adzerk-Sdk-Version",
        "value": "Readme.io:ManagementAPI2"
      }
    ],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```