---
updatedAt: 2026-05-12T17:47:03.000Z
---

Fetch the complete documentation index at: https://developers.pismo.io/pismo-docs/llms.txt. Use this file to discover all available pages before exploring further.

# Create attribute group

Create an attribute group, which is a set of values that can be shared across multiple flex controls within the organization. Once you create an attribute group, you reference it in flex controls in the `conditions` field in the [Create account flex control](ref:post-v1-accounts-flex-controls) or [Create customer flex control](ref:post-v1-customers-flex-controls) endpoint.

For more information, refer to the [Attribute groups](doc:attribute-groups) guide.


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Core platform - Flex controls",
    "version": "1.0.0",
    "description": "Flex controls API",
    "contact": {
      "name": "API Support",
      "url": "https://developers.pismo.io/support/"
    },
    "license": {
      "name": "Copyright Pismo"
    }
  },
  "servers": [
    {
      "url": "https://sandbox.pismolabs.io/rules",
      "description": "Sandbox API server for testing"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Account access token. Tokens can expire quickly, which can result in an \"Unauthorized\" error.",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "AttributeGroupDescription": {
        "type": "string",
        "description": "Short description of the attribute group",
        "maxLength": 50,
        "minLength": 1,
        "example": "High-risk merchant IDs"
      },
      "AttributeGroupID": {
        "type": "string",
        "description": "Attribute group ID, unique within the organization",
        "maxLength": 36,
        "minLength": 1,
        "example": "non-trusted-merchants"
      },
      "AttributeGroupType": {
        "type": "string",
        "enum": [
          "merchant_id",
          "merchant_category_code"
        ],
        "description": "Flex control scope\n  * `merchant_category_code`:  Merchant category code (MCC) is a four-digit number assigned to a business by credit card companies. It is used to classify the business by the type of goods or services it provides.\n  * `merchant_id`: Unique ID assigned to a merchant by the payment processor.\n"
      },
      "AttributeGroupValues": {
        "type": "array",
        "description": "Attribute group values\n- Each value must be unique within the array\n- Maximum of 20,000 items\n- Each item must not exceed 15 characters\n",
        "maxLength": 25000,
        "minLength": 1,
        "items": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9]+$",
          "maxLength": 15,
          "minLength": 1
        },
        "example": [
          "0123",
          "2224",
          "3876"
        ]
      },
      "AttributeGroupObject": {
        "type": "object",
        "description": "Attribute group object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/AttributeGroupID"
          },
          "description": {
            "$ref": "#/components/schemas/AttributeGroupDescription"
          },
          "type": {
            "$ref": "#/components/schemas/AttributeGroupType"
          },
          "values": {
            "$ref": "#/components/schemas/AttributeGroupValues"
          }
        },
        "required": [
          "id",
          "description",
          "type",
          "values"
        ]
      },
      "ErrorDetail": {
        "type": "object",
        "description": "Error detail.",
        "properties": {
          "location": {
            "type": "string",
            "example": "payload.entity_type",
            "description": "Identifies where the request is causing an error."
          },
          "message": {
            "type": "string",
            "description": "Description of error",
            "example": "`entity_type` should be `legal_person` or `natural_person`"
          }
        }
      },
      "ErrorAttributeTypeDetail": {
        "type": "object",
        "description": "Error detail.",
        "properties": {
          "location": {
            "type": "string",
            "example": "payload.type",
            "description": "Location where the request is causing an error"
          },
          "message": {
            "type": "string",
            "description": "Error description",
            "example": "`type` should be `merchant_category_code` or `merchant_id`"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "description": "Error response",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error description"
          },
          "error_code": {
            "type": "string",
            "description": "Error code ID",
            "deprecated": true
          },
          "code": {
            "description": "Error code ID",
            "type": "string"
          }
        }
      },
      "ErrorResponseWithDetails": {
        "type": "object",
        "description": "Error response",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error description"
          },
          "details": {
            "type": "array",
            "description": "Provides more information about the error message.",
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            }
          },
          "error_code": {
            "type": "string",
            "description": "Error code ID",
            "deprecated": true
          },
          "code": {
            "type": "string",
            "description": "Error code ID"
          }
        }
      }
    },
    "examples": {
      "ERUL0001": {
        "description": "Internal server error example.",
        "value": {
          "message": "internal server error",
          "error_code": "RULREP0500",
          "code": "ERUL0001"
        }
      },
      "ERUL0707": {
        "description": "Attribute group already exists example",
        "value": {
          "message": "Attribute group already exists",
          "error_code": "RULVAL0400",
          "code": "ERUL0707"
        }
      }
    }
  },
  "tags": [
    {
      "name": "Attribute groups",
      "description": "API endpoints for managing attribute groups used in flex controls."
    }
  ],
  "paths": {
    "/v1/attribute-groups": {
      "post": {
        "operationId": "post-v1-attribute-group-flex-controls",
        "summary": "Create attribute group",
        "description": "Create an attribute group, which is a set of values that can be shared across multiple flex controls within the organization. Once you create an attribute group, you reference it in flex controls in the `conditions` field in the [Create account flex control](https://developers.pismo.io/pismo-docs/reference/post-v1-accounts-flex-controls) or [Create customer flex control](https://developers.pismo.io/pismo-docs/reference/post-v1-customers-flex-controls) endpoint.\n\nFor more information, refer to the [Attribute groups](https://developers.pismo.io/pismo-docs/docs/attribute-groups) guide.\n",
        "tags": [
          "Attribute groups"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttributeGroupObject"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK. Successful attribute group creation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttributeGroupObject"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Validation error on request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorAttributeTypeDetail"
                }
              }
            }
          },
          "409": {
            "description": "Conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseWithDetails"
                },
                "examples": {
                  "Attribute group already exists": {
                    "$ref": "#/components/examples/ERUL0707"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "Internal server error": {
                    "$ref": "#/components/examples/ERUL0001"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
```