---
updatedAt: 2026-10-20T16:43:20.000Z
---

# Create a custom attribute definition

Use this API to create a custom attribute definition.<br><br><a href="https://api.solace.dev/cloud/reference/authentication">Token Permissions</a>: [ <code>custom_attribute:write</code> ]

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Event Portal - Designer",
    "description": "REST API Concepts\n\nSolace Event Portal provides REST APIs that you can use to manage your data in Solace Cloud. \nThe REST APIs allow you to model your event-driven architectures from your own client applications.\n\nThe following document describes the public REST APIs available for use in Event Portal 2.0. Objects created in this \nversion will not be available in Event Portal 1.0. APIs that display (Beta) in their summary are provided as-is and \nare subject to change or removal. They may not be of the quality expected for generally available APIs and have no \nguaranteed forward compatibility with the generally available version of the API.\n\n",
    "version": "2.15.2"
  },
  "servers": [
    {
      "url": "https://api.solace.cloud",
      "description": "Solace Cloud US EAST Region"
    },
    {
      "url": "https://api.solacecloud.com.au",
      "description": "Solace Cloud AU Region"
    },
    {
      "url": "https://api.solacecloud.eu",
      "description": "Solace Cloud EU Region"
    },
    {
      "url": "https://api.solacecloud.sg",
      "description": "Solace Cloud SG Region"
    }
  ],
  "security": [
    {
      "APIToken": []
    }
  ],
  "tags": [
    {
      "name": "Custom Attribute Definitions"
    }
  ],
  "paths": {
    "/api/v2/architecture/customAttributeDefinitions": {
      "post": {
        "tags": [
          "Custom Attribute Definitions"
        ],
        "summary": "Create a custom attribute definition",
        "description": "Use this API to create a custom attribute definition.<br><br><a href=\"https://api.solace.dev/cloud/reference/authentication\">Token Permissions</a>: [ <code>custom_attribute:write</code> ]",
        "operationId": "createCustomAttributeDefinition",
        "requestBody": {
          "description": "The custom attribute definition.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomAttributeDefinition"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created a custom attribute definition. Returns the newly saved custom attribute definition in the response body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomAttributeDefinitionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AssociatedEntity": {
        "type": "object",
        "properties": {
          "entityType": {
            "type": "string"
          },
          "applicationDomainIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CustomAttributeDefinition": {
        "type": "object",
        "properties": {
          "createdTime": {
            "type": "string",
            "description": "The time the entity was created",
            "example": "2021-12-31T20:30:57.920Z",
            "readOnly": true
          },
          "updatedTime": {
            "type": "string",
            "description": "The time the entity was last updated",
            "example": "2021-12-31T20:30:57.920Z",
            "readOnly": true
          },
          "createdBy": {
            "type": "string",
            "description": "The user who created the entity",
            "example": 12345678,
            "readOnly": true
          },
          "changedBy": {
            "type": "string",
            "description": "The user who last updated the entity",
            "example": 12345678,
            "readOnly": true
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "example": "colour",
            "pattern": "[a-zA-Z0-9\\._-]+"
          },
          "valueType": {
            "type": "string",
            "enum": [
              "STRING",
              "LONG_TEXT",
              "MULTI_STRING_VALUE"
            ]
          },
          "scope": {
            "type": "string",
            "enum": [
              "organization",
              "applicationDomain"
            ]
          },
          "associatedEntityTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "example": [
                "event",
                "application"
              ]
            }
          },
          "associatedEntities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssociatedEntity"
            }
          },
          "validationMessages": {
            "$ref": "#/components/schemas/ValidationMessagesDTO"
          },
          "applicationDomainId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "scope"
        ]
      },
      "CustomAttributeDefinitionResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/CustomAttributeDefinition"
          },
          "meta": {
            "type": "object",
            "additionalProperties": {}
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "discriminator": {
          "propertyName": "errorType"
        },
        "properties": {
          "message": {
            "type": "string",
            "description": "A user-friendly message that describes the error.",
            "example": "An error occurred."
          },
          "errorId": {
            "type": "string",
            "description": "The UUID (Universally Unique Identifier) that is logged with an appropriate stack trace for a WARN or ERROR log that allows support to better determine what cause the error.",
            "example": "123e4567-e89b-12d3-a456-426655440000"
          },
          "meta": {
            "type": "object",
            "additionalProperties": {},
            "example": "'object': { 'field': 'description' }"
          },
          "validationDetails": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "When applicable, these are the details of issues with the fields provided for the REST call.",
            "example": "'name': ['Not unique']"
          },
          "errorType": {
            "type": "string",
            "writeOnly": true
          }
        }
      },
      "InvalidNonStateReference": {
        "type": "object",
        "properties": {
          "entityId": {
            "type": "string"
          },
          "entityType": {
            "type": "string"
          }
        }
      },
      "InvalidStateReference": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ErrorResponse"
          },
          {
            "type": "object",
            "properties": {
              "targetStateId": {
                "type": "string"
              },
              "inboundInvalidNonStateReferences": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/InvalidNonStateReference"
                }
              },
              "inboundInvalidStateReferences": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/InvalidStateReference"
                }
              },
              "outboundInvalidStateReferences": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/InvalidStateReference"
                }
              },
              "errorType": {
                "type": "string"
              }
            }
          }
        ]
      },
      "ValidationMessageContext": {
        "type": "object",
        "properties": {
          "entityNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "entityType": {
            "type": "string"
          }
        }
      },
      "ValidationMessageDTO": {
        "type": "object",
        "properties": {
          "messageKey": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "context": {
            "$ref": "#/components/schemas/ValidationMessageContext"
          }
        }
      },
      "ValidationMessagesDTO": {
        "type": "object",
        "properties": {
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationMessageDTO"
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationMessageDTO"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "APIToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
```