---
agentTools:
  projectIndex: https://docs.storyly.io/llms.txt
---

# Create segment

Create a new segment.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Storyly External API",
    "version": "1.0.0",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://api.storyly.io"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "JWT token for API authentication"
      }
    }
  },
  "paths": {
    "/external/segment": {
      "post": {
        "tags": [
          "segment"
        ],
        "summary": "Create segment",
        "description": "Create a new segment.",
        "operationId": "createSegment",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "example": "label_name"
                  }
                }
              },
              "examples": {
                "Create segment": {
                  "value": {
                    "label": "label_name"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Segments successfully created"
                    },
                    "status": {
                      "type": "string",
                      "example": "ok"
                    }
                  }
                },
                "examples": {
                  "200": {
                    "value": {
                      "message": "Segments successfully created",
                      "status": "ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "segment",
      "description": "Segment management endpoints"
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 104,
      "1": 249,
      "2": 255,
      "3": 26,
      "4": 178,
      "5": 168,
      "6": 65,
      "7": 240,
      "8": 58,
      "9": 114,
      "10": 176,
      "11": 107
    }
  }
}
```