v1

latestOpenAPI 3.1.02026-08-04103211436.0 KB
Attributes

Create attribute

Creates an attribute. If customId is omitted, Embat auto-generates one. If an attribute with the given customId already exists, its fields are overwritten instead of raising a duplicate error — this endpoint behaves as an upsert. Sending values replaces the attribute's full value list, and omitting values on an existing attribute removes all of its current values — always resend the values you want to keep.

post/attributes/{companyId}

Path parameters

companyIdstring required

Request body

customIdstring nullable

Your own unique ID for the attribute. If omitted, Embat auto-generates one.

source'erp' | 'api' | 'embat' required
activeboolean

Whether the attribute is active.

namestring required

Display name of the attribute.

type'list' | 'string' | 'number' required
requiredboolean

Whether a value for this attribute should be mandatory wherever it is used. Informational only: this API does not enforce it.

parentCustomIdstring nullable

Custom ID of the parent attribute, to nest this attribute under another one (e.g. a "City" attribute nested under "Country"). Must reference an existing attribute.

Example request

{
  "customId": "cost-center",
  "name": "Cost Center",
  "values": [
    {
      "customId": "madrid",
      "name": "Madrid",
      "parentCustomId": "spain"
    }
  ],
  "parentCustomId": "country"
}

Response

Successful Response

idstring required

Embat resource ID

customIdstring required

Client-provided custom ID