---
updatedAt: 2025-06-09T22:12:48.000Z
agentTools:
  projectIndex: https://developers.baremetrics.com/llms.txt
---

# Set Attributes

Create or update properties on customers. This will work across all sources.

> ❗️ If you have multiple customers with the same OID (across multiple Sources) then this will update them all.
>
> You must specify an oid, or email.

> 🚧 Array fields should have a comma separated list value

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "production",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.baremetrics.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer",
        "x-default": "APIKEY"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/attributes": {
      "post": {
        "summary": "Set Attributes",
        "description": "Create or update properties on customers. This will work across all sources.",
        "operationId": "set-attributes",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "attributes": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "customer_oid": {
                          "type": "string",
                          "description": "Supply this, or customer_email"
                        },
                        "customer_email": {
                          "type": "string",
                          "description": "Supply this, or customer_oid"
                        },
                        "field_id": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string",
                          "description": "For an array field, use a comma seperated string"
                        }
                      },
                      "required": [
                        "customer_oid",
                        "customer_email",
                        "field_id",
                        "value"
                      ],
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"error\": \"Title has already been taken\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Title has already been taken"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "409",
            "content": {
              "text/plain": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"error\": \"Title has already been taken\",\n  \"duplicated_id\": 6\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Title has already been taken"
                    },
                    "duplicated_id": {
                      "type": "integer",
                      "example": 6,
                      "default": 0
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": false
  },
  "x-readme-fauxas": true
}
```