Start free

API reference

Contact attributes

Define your organization's custom contact attributes, with type and label, and read the dictionary that validates each contact's attributes field.

  • 2 operations
  • Base URLhttps://api.messages.ccxcompany.co
  • AuthenticationBearer with your API key

The technical text below comes from the public contract, openapi.json, in the language the contract was written in.

List the org's typed custom attribute definitions

GET/v2/organizations/me/custom-attribute-defs

Returns the dictionary that drives Contact.attributes validation. Returns { defs: [] } for orgs that haven't configured any.

Auth: contacts:read — every member that can read contacts also needs the schema to render the editor.

Responses

  • 200Default Response

    Response fields and example
    FieldTypeDescription
    defsrequiredobject[]
    defs[].keyrequiredstring
    defs[].typerequiredstringValues:stringnumberbooleandate
    defs[].labeloptionalstring
    defs[].requiredrequiredboolean
    JSON
    {  "defs": [    {      "key": "string",      "type": "string",      "label": "string",      "required": true    }  ]}
  • 401RFC 7807 problem details for UNAUTHORIZED (401).

  • 403RFC 7807 problem details for FORBIDDEN (403).

Error responses follow RFC 7807 (application/problem+json), with a stable code in the code field. See the error codes

curl example

cURL
curl 'https://api.messages.ccxcompany.co/v2/organizations/me/custom-attribute-defs' \  -H "Authorization: Bearer $CCX_API_KEY"
Required fields only. Swap the sample values for your own.

Replace the org's typed custom attribute definitions

PUT/v2/organizations/me/custom-attribute-defs

Full replace — caller passes { defs: [...] } matching the wire schema. Drop a key by omitting it.

Service rejects duplicate keys (CONFLICT) and arrays > 50 entries (VALIDATION_ERROR via Zod).

A definition that looks like a document, password, card or token (by key OR label) and still has values stored in contacts cannot be dropped nor relabeled: 409 with meta.code = PROPRIEDADE_SENSIVEL_EM_USO (clear the values first). If the check does not fit in 5 s, 503.

Request bodyapplication/json

FieldTypeDescription
defsrequiredobject[]
defs[].keyrequiredstring
defs[].typerequiredstringValues:stringnumberbooleandate
defs[].labeloptionalstring
defs[].requiredoptionalboolean
Full body example
JSON
{  "defs": [    {      "key": "string",      "type": "string",      "label": "string",      "required": true    }  ]}

Responses

  • 200Default Response

    Response fields and example
    FieldTypeDescription
    defsrequiredobject[]
    JSON
    {  "defs": [    {}  ]}
  • 401RFC 7807 problem details for UNAUTHORIZED (401).

  • 403RFC 7807 problem details for FORBIDDEN (403).

  • 409RFC 7807 problem details for CONFLICT (409).

  • 422RFC 7807 problem details for VALIDATION_ERROR (422).

Error responses follow RFC 7807 (application/problem+json), with a stable code in the code field. See the error codes

curl example

cURL
curl -X PUT 'https://api.messages.ccxcompany.co/v2/organizations/me/custom-attribute-defs' \  -H "Authorization: Bearer $CCX_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "defs": [      {        "key": "string",        "type": "string"      }    ]  }'
Required fields only. Swap the sample values for your own.

Stuck on a route? Talk to the people who run the API.

Sign up through the site and get a US$5 test credit.