> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update segment

> Used to update an existing segment.

For more information on segments review our [segmentation guide](https://docs.xtremepush.com/docs/segmentation). For details on the available conditions for this endpoint see our dedicated [segment model properties guide](https://docs.xtremepush.com/reference/segment-model).

## OpenAPI

````json POST /update/segment
{
  "openapi": "3.1.0",
  "info": {
    "title": "external-api",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.eu.xtremepush.com/api/external"
    }
  ],
  "paths": {
    "/update/segment": {
      "post": {
        "summary": "Update segment",
        "description": "Used to update an existing segment.\n\nFor more information on segments review our [segmentation guide](https://docs.xtremepush.com/docs/segmentation). For details on the available conditions for this endpoint see our dedicated [segment model properties guide](https://docs.xtremepush.com/reference/segment-model).",
        "operationId": "segment-update",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "apptoken",
                  "id"
                ],
                "properties": {
                  "apptoken": {
                    "type": "string",
                    "description": "Your App token"
                  },
                  "id": {
                    "type": "integer",
                    "format": "int32",
                    "description": "ID of the segment"
                  },
                  "title": {
                    "type": "string",
                    "description": "Updated title of the segment"
                  },
                  "condition": {
                    "type": "string",
                    "format": "json",
                    "description": "Updated conditions for the segment"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": "true",
                      "default": "true"
                    },
                    "code": {
                      "type": "integer",
                      "example": "200",
                      "default": "0"
                    },
                    "message": {
                      "type": "string",
                      "example": "Segment is successfully updated"
                    },
                    "model": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "SEGMENT_ID"
                        },
                        "project_id": {
                          "type": "string",
                          "example": "PROJECT_ID"
                        },
                        "title": {
                          "type": "string",
                          "example": "Email subscribed"
                        },
                        "conditions": {
                          "type": "object"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": {
                      "success": "true",
                      "code": "200",
                      "message": "Segment is successfully updated",
                      "model": {
                        "id": "SEGMENT_ID",
                        "project_id": "PROJECT_ID",
                        "title": "Email subscribed",
                        "conditions": {
                          "0": {
                            "0": [
                              "email_subscription",
                              "=",
                              "0"
                            ],
                            "operator": "AND"
                          },
                          "operator": "AND"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": "false",
                      "default": "true"
                    },
                    "code": {
                      "type": "integer",
                      "example": "400",
                      "default": "0"
                    },
                    "message": {
                      "type": "string",
                      "example": "General error information"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": {
                      "success": "false",
                      "code": "400",
                      "message": "General error information"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": "false",
                      "default": "true"
                    },
                    "code": {
                      "type": "integer",
                      "example": "404",
                      "default": "0"
                    },
                    "message": {
                      "type": "string",
                      "example": "Not Found"
                    }
                  }
                },
                "examples": {
                  "Result": {
                    "value": {
                      "success": "false",
                      "code": "404",
                      "message": "Not Found"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Segmentation Methods"
        ]
      }
    }
  }
}
````

