Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

List Keys

List custom field keys
client.v1.customFields.listKeys(CustomFieldListKeysParamsparams?, RequestOptionsoptions?): dataarraynext_pageunionCustomFieldListKeysResponse
post/v1/customFields/listKeys

List all active custom field keys, optionally filtered by entity type.

Parameters
paramsnext_pagestringentitiesarrayCustomFieldListKeysParams
Hide ParametersShow Parameters
next_pagestring
optional

Query param: Cursor that indicates where the next page of results should start.

entitiesarray
optional
Array<"alert" | "billable_metric" | "charge" | 15 more>

Body param: Optional list of entity types to return keys for

Hide ParametersShow Parameters
"alert"
"billable_metric"
"charge"
"commit"
"contract_credit"
"contract_product"
"contract"
"credit_grant"
"customer_plan"
"customer"
"discount"
"invoice"
"plan"
"professional_service"
"product"
"rate_card"
"scheduled_charge"
"subscription"
Returns
CustomFieldListKeysResponse
Hide ParametersShow Parameters
dataarray
Array<Data>
Hide ParametersShow Parameters
enforce_uniquenessboolean
entityunion
"alert" | "billable_metric" | "charge" | 15 more
Hide ParametersShow Parameters
"alert"
"billable_metric"
"charge"
"commit"
"contract_credit"
"contract_product"
"contract"
"credit_grant"
"customer_plan"
"customer"
"discount"
"invoice"
"plan"
"professional_service"
"product"
"rate_card"
"scheduled_charge"
"subscription"
keystring
next_pageunion
string | null
import Metronome from '@metronome/sdk';

const client = new Metronome({
  bearerToken: 'My Bearer Token',
});

const response = await client.v1.customFields.listKeys({ entities: ['customer'] });

console.log(response.data);
200 Example
{
  "data": [
    {
      "enforce_uniqueness": true,
      "entity": "alert",
      "key": "key"
    }
  ],
  "next_page": "next_page"
}