> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.brevo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.brevo.com/_mcp/server.

# Create a company/deal attribute

POST https://api.brevo.com/v3/crm/attributes
Content-Type: application/json

Create a new custom attribute for companies or deals. The attribute label must be unique within the object type, cannot exceed 50 characters, and cannot use reserved names. For `single-select` or `multi-choice` attribute types, you must also provide the `optionsLabels` array.

Reference: https://developers.brevo.com/reference/create-a-company-deal-attribute

## Authentication

- `api-key` header (required) — The API key should be passed in the request headers as `api-key` for authentication.

## Request

### Body (application/json)

This endpoint expects an object.

- `attributeType` (enum, required) — The type of attribute (must be one of the defined enums)
  - Allowed values: `text`, `user`, `number`, `single-select`, `date`, `boolean`, `multi-choice`
- `label` (string, required) — The label for the attribute (max 50 characters, cannot be empty)
- `objectType` (enum, required) — The type of object the attribute belongs to. Must be either `companies` or `deals`.
  - Allowed values: `companies`, `deals`
- `description` (string, optional) — A description of the attribute
- `optionsLabels` (list of string, optional) — Options for multi-choice or single-select attributes

## Response

### 200

Created new attribute

- `id` (string, required) — Unique ID of the created attribute

## Errors

### 400 Bad Request Error

Returned when invalid data is posted

- `message` (string, required) — Readable message associated to the failure
- `code` (string, optional) — Error code displayed in case of a failure

## Examples

**Request**

```json
{
  "attributeType": "single-select",
  "label": "Attribute Label",
  "objectType": "companies"
}
```

**Response**

```json
{
  "id": "61a5cd07ca1347c82306ad07"
}
```

**SDK Code**

```typescript
import { BrevoClient } from "@getbrevo/brevo";

async function main() {
    const client = new BrevoClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.companies.createACompanyDealAttribute({
        attributeType: "single-select",
        label: "Attribute Label",
        objectType: "companies",
    });
}
main();

```

```python
from brevo import Brevo

client = Brevo(
    api_key="YOUR_API_KEY_HERE",
)

client.companies.create_a_company_deal_attribute(
    attribute_type="single-select",
    label="Attribute Label",
    object_type="companies",
)

```

```php
<?php

namespace Example;

use Brevo\Brevo;
use Brevo\Companies\Requests\PostCrmAttributesRequest;
use Brevo\Companies\Types\PostCrmAttributesRequestAttributeType;
use Brevo\Companies\Types\PostCrmAttributesRequestObjectType;

$client = new Brevo(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->companies->createACompanyDealAttribute(
    new PostCrmAttributesRequest([
        'attributeType' => PostCrmAttributesRequestAttributeType::SingleSelect->value,
        'label' => 'Attribute Label',
        'objectType' => PostCrmAttributesRequestObjectType::Companies->value,
    ]),
);

```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/crm/attributes"

	payload := strings.NewReader("{\n  \"attributeType\": \"single-select\",\n  \"label\": \"Attribute Label\",\n  \"objectType\": \"companies\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/crm/attributes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"attributeType\": \"single-select\",\n  \"label\": \"Attribute Label\",\n  \"objectType\": \"companies\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/crm/attributes")
  .header("api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"attributeType\": \"single-select\",\n  \"label\": \"Attribute Label\",\n  \"objectType\": \"companies\"\n}")
  .asString();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/crm/attributes");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"attributeType\": \"single-select\",\n  \"label\": \"Attribute Label\",\n  \"objectType\": \"companies\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "attributeType": "single-select",
  "label": "Attribute Label",
  "objectType": "companies"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/crm/attributes")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```