Easymailing
Company attributes

Create a company attribute

POST /company_attributes

POST/company_attributes

Defines a new custom attribute for companies, placed after the existing ones. Once created, it can be filled in on any company through its public_code. Its visual presentation (languages, help text, display style) is left at the defaults and can be tuned in the app.

When to use: When the account needs to store a new piece of data on organizations that the company does not already have, for example a market segment or a renewal date.

When not to use: To change an existing attribute, use update_company_attribute. To set a value on a company, use update_company: this operation only defines the field, it does not set any value.

Side effects: Records the creation in the account's attribute change log, under the person who made the call. No webhook is fired.

Permissions: Requires the crm.companies.attributes.manage capability.

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Request Body

The new CompanyAttribute resource

TypeScript Definitions

Use the request body type in TypeScript.

Company attributes of the public API (plan fase 3, Task 21): the definitions of the custom fields of a company, over AttributeDefinitionManager. Generated from the approved proposal by fase-3/tools/gen_attribute_resources.py and edited by hand afterwards: the texts are the proposal's.

Response Body

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://api.easymailing.com/company_attributes" \  -H "X-Auth-Token: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "type": "text",    "description": "string",    "public_code": "string",    "currency": "string",    "options": [      {        "label": "string",        "color": "string",        "integration_key": "string"      }    ]  }'
{  "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",  "name": "string",  "description": "string",  "public_code": "string",  "type": "text",  "currency": null,  "status": "active",  "position": 0,  "version": 0,  "current_value_count": 0,  "ever_used": true,  "options": [    {      "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",      "label": "string",      "color": "string",      "integration_key": "string",      "position": 0,      "status": "active"    }  ]}