---
updatedAt: 2026-10-20T09:46:20.000Z
agentTools:
  projectIndex: https://developer.optimove.com/llms.txt
---

# Add Customer Attribute

Add a new customer attribute.

### Rate Limit

> ***For Optimove's general API rate limit, see the&#x20;***[Understanding API Rate Limits](https://developer.optimove.com/reference/understanding-api-rate-limits)***&#x20;reference.***

### Notes

* Limitation: There is an overall limit of 50 attributes for real-time, API, and data ingestion attributes
* Attributes created via the AddCustomerAttribute function can only be updated using the [UpsertCustomers](https://developer.optimove.com/reference/insert-or-update-customers) function.
* Attribute Name must start with a letter (A-Z or a-z), and can only contain letters and numbers (0-9)
* If a Callback URL was defined, you will receive the following response to the Webhook up to 1 minute after the call:
  * Attribute Name
  * IsSuccess: true or false
  * Error ID and error message in case of failure. Possible values for Error in case of failure in the response:
    * **1 =** Attribute was not added. The number of attributes added exceeds the 40 attributes limit
    * **2 =** Attribute was not added. Specified RealFieldName already exists
    * **3 =** Attribute was not added, field\_Type Input should be 'DECIMAL(19,4), 'INT', 'BIGINT', 'DATE' ,'VARCHAR(X)' or 'NVARCHAR(X)'
    * **4 =** Attribute was not added, 'CHAR' value (DefaultValue) cannot be inserted into a column with data type 'INT'
    * **5 =** Attribute was not added, a general error occurred

Examples for reference:

> \{"attributeName":"LoDoTestNVarcharr11","isSuccess":false,"errorId":"3","errorMsg":"Attribute was not added, Type Input should be 'DECIMAL(19,4), 'INT', 'BIGINT', 'DATE' ,'VARCHAR(X)' or 'NVARCHAR(X)'."}
>
> \{"attributeName":"LoDoTestNVarcharr17","isSuccess":true}
>
> \{"attributeName":"LoDoTestNVarcharr17","isSuccess":false,"errorId":"2","errorMsg":"Attribute was not added, specified RealFieldName already exists."}

### Error Handling

Errors while using this endpoint typically occur due to invalid input or schema violations, such as:

* Field values exceeding maximum length or precision.
* Providing unsupported or incorrect data types.
* Missing required attributes.

To understand these errors and how to resolve them, visit the [Error Handling Page](https://developer.optimove.com/reference/error-handling).

**Sample Request**

```json
{
  "Name":"VIP_Level",
  "Type":"VARCHAR(10)",
  "DefaultValue":"Bronze" (optional),
  "CallbackURL":"https://tenantname.requestcatcher.com/test"
}
```

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Optimove API",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api4.optimove.net",
      "description": "US Environment"
    },
    {
      "url": "https://api5.optimove.net",
      "description": "EU Environment"
    }
  ],
  "paths": {
    "/Customers/AddCustomerAttribute": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Add Customer Attribute",
        "description": "Add a new customer attribute.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Optimove.API.Models.OptimoveCustomerAttribute"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Optimove.API.Models.OptimoveCustomerAttribute": {
        "required": [
          "Name",
          "Type"
        ],
        "type": "object",
        "properties": {
          "TenantID": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "Name": {
            "minLength": 1,
            "type": "string"
          },
          "AliasFieldName": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "Type": {
            "minLength": 1,
            "type": "string"
          },
          "DefaultValue": {
            "type": "string",
            "nullable": true
          },
          "IsApiAttribute": {
            "type": "boolean",
            "readOnly": true
          },
          "CallbackURL": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "API KEY",
        "name": "X-API-KEY",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}
```