Contacts: Custom fields

List Fields

Every custom field of the account, with its type and options, sorted by key.

POSThttps://g.sendcorex.com/v1/contactscommand: list_fields
i

Needs the contact:read scope on your API key.

Arguments

This endpoint takes no arguments.

Quick start

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/contacts',
  {
    commands: [
      {
        command: "list_fields"
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_API_KEY } },
);

const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);

Response

{
  "type": "SUCCESS",
  "results": [
    {
      "command": "list_fields",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 14,
      "data": {
        "fields": [
          {
            "key": "age",
            "name": "Age",
            "type": "number",
            "options": null,
            "created_at": "2026-10-01T10:00:00.000Z",
            "updated_at": "2026-10-01T10:00:00.000Z"
          },
          {
            "key": "plan",
            "name": "Plan",
            "type": "enum",
            "options": [
              "free",
              "pro",
              "business"
            ],
            "created_at": "2026-10-01T10:00:00.000Z",
            "updated_at": "2026-10-01T10:00:00.000Z"
          }
        ],
        "limit": 100
      }
    }
  ]
}

Response fields

  • fields[].key

    The key used in fields, in where and in sort (fields.<key>).

  • fields[].name

    Display name.

  • fields[].type

    text, number, date, bool, enum or multi_enum.

  • fields[].options

    The allowed values of enum and multi_enum fields.

  • limit

    How many fields the account can have (100).

Errors

HTTP-level errors return type, code and message. Errors marked CMD come back inside the command result, with HTTP 200.

  • 401INVALID_API_KEY

    The API key does not exist, was revoked or was disabled in the dashboard.

  • 429RATE_LIMITED

    More than 15 requests/s or 15 in flight for the same IP + API key. Wait the number of seconds in Retry-After.

  • CMDMISSING_SCOPE

    The API key does not have the scope this command needs. The other commands in the request still run.

  • CMDINTERNAL

    Server error. The detail is only written to the server log.