# Create a new UI segment Creates a new UI segment for yourself or to share with others within your organization. Endpoint: POST /grid-segments Version: latest Security: SecretApiKey, JWT ## Request fields (application/json): - `data` (object, required) Object that contains a schema that is used to set up the UI for the segment. This schema is built and consumed by the frontend. It includes information such as: segment name, UI settings, and so on. - `data.name` (string) Name of data grid segment. - `data.columns` (array) List of columns to display in grid segment. - `data.filters` (string,null) Combination of filters to apply on grid segment data. Example: "averageValue/amount:10;bin:555,2058" - `data.page` (string) Where to display grid segment: data tables or customer details. Enum: "data-tables", "customer-details" - `data.sort` (string) Column to sort data by. To sort in descending order, prefix with . - `data.type` (string) Data to display in grid segment. Enum: "customers", "invoices", "transactions", "subscriptions", "api-logs", "coupon-redemptions", "webhook-logs", "tax-logs", "credit-memos", "kyc", "journal-entry", "aml", "payout-requests", "organizations", "quotes", "deposit-requests" - `isStarred` (boolean) Specifies if this segment is starred by the current user. Starring a segment marks it as a favorite segment, and also adds the segment to a starred folder in the UI. - `isVisible` (boolean) Specifies if the segment is visible to the current user. - `userIds` (array) List of user IDs with which the segment is shared. This field is used when the field is set to . Example: ["4f6cf35x-2c4y-483z-a0a9-158621f77a21"] - `scope` (string, required) Controls the visibility of the segment. Enum: "private", "public", "shared" - `systemId` (string) If the segment is derived from a system segment, this field contains the ID of the related system segment. To provide this field in a request, the field must be set to . ## Response 201 fields (application/json): - `id` (string) ID of the segment. Example: "grd_seg_0YVCNRJW0ADV49TN8BD9X91XB5" - `owner` (object, required) Creator of segment. - `owner.id` (string) Unique resource ID. Example: "4f6cf35x-2c4y-483z-a0a9-158621f77a21" - `owner.name` (string) First and last name of the creator. - `data` (object, required) Object that contains a schema that is used to set up the UI for the segment. This schema is built and consumed by the frontend. It includes information such as: segment name, UI settings, and so on. - `data.name` (string) Name of data grid segment. - `data.columns` (array) List of columns to display in grid segment. - `data.filters` (string,null) Combination of filters to apply on grid segment data. Example: "averageValue/amount:10;bin:555,2058" - `data.page` (string) Where to display grid segment: data tables or customer details. Enum: "data-tables", "customer-details" - `data.sort` (string) Column to sort data by. To sort in descending order, prefix with . - `data.type` (string) Data to display in grid segment. Enum: "customers", "invoices", "transactions", "subscriptions", "api-logs", "coupon-redemptions", "webhook-logs", "tax-logs", "credit-memos", "kyc", "journal-entry", "aml", "payout-requests", "organizations", "quotes", "deposit-requests" - `isStarred` (boolean) Specifies if this segment is starred by the current user. Starring a segment marks it as a favorite segment, and also adds the segment to a starred folder in the UI. - `isVisible` (boolean) Specifies if the segment is visible to the current user. - `users` (array) List of user details with which this segment is shared. - `users.name` (string) First and last name. - `scope` (string, required) Controls the visibility of the segment. Enum: "private", "public", "shared" ## Response 403 fields (application/json): - `status` (integer) HTTP status code. - `type` (string) Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. It should provide human-readable documentation for the problem type. When this member is not present, its value is assumed to be "about:blank". - `title` (string) Short, human-readable summary of the problem type. Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. - `detail` (string) Human-readable explanation that is specific to this occurrence of the problem. - `instance` (string) URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. ## Response 422 fields (application/json): - `status` (integer) HTTP status code. - `type` (string) Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. It should provide human-readable documentation for the problem type. When this member is not present, its value is assumed to be "about:blank". - `title` (string) Short, human-readable summary of the problem type. Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. - `detail` (string) Human-readable explanation that is specific to this occurrence of the problem. - `instance` (string) URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. - `invalidFields` (array) Invalid field details. Example: [{"field":"field1","message":"field1 is invalid"},{"field":"subObject.field2","message":"field2 is invalid"},{"field":"subObject.field2","message":"another error in the field2"}] - `invalidFields.field` (string) Name of the field. Dot notation is used for nested object field names. - `invalidFields.message` (string) Message field. ## Response 429 fields (application/json): - `type` (string) Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. It should provide human-readable documentation for the problem type. When this member is not present, its value is assumed to be "about:blank". Example: "about:blank" - `title` (string) Short, human-readable summary of the problem type. Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. Example: "Rate Limit Exceeded" - `status` (integer) HTTP status code. - `detail` (string) Human-readable explanation that is specific to this occurrence of the problem. Example: "A request cannot be executed because the user has sent too many requests within a certain period of time" - `instance` (string) URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.