import type { CreateCustomFieldInput, CustomField, ListCustomFieldsQuery, Paginated, UpdateCustomFieldInput } from '../../types'; import type { HttpClient } from '../../http'; /** * Custom fields: the per-account schema for contacts. A field's `slug` is the * key its values are stored under in `contact.custom_field_hash`, and the * `field_id` the contact filter addresses it by. * * Every route below takes either the field's id or its slug, so a caller that * knows the schema never has to look an id up first. */ export declare class CustomFields { private readonly http; constructor(http: HttpClient); /** * `GET /v1/audience/custom-fields` -- offset paginated. `search` matches the * slug, the label and the caption. `type` filters by who owns the field * (`system` for platform-provisioned, `user` for the account's own). * * Scope: `custom_fields:read`. */ list(query?: Partial): Promise>; /** * `GET /v1/audience/custom-fields/:ref` -- `ref` is the field's id or its * slug. A value that reads as an id is looked up as one; anything else is * read as a slug. * * Scope: `custom_fields:read`. */ get(ref: string): Promise; /** * `POST /v1/audience/custom-fields` -- 201 with the created field. * * The slug must be snake_case and unclaimed: a name that would shadow a * contact document path (`name`, `tags`, `status`), a channel key * (`whatsapp`, `email`) or a built-in filter field is rejected with 422. * A slug already in use on the account is a 409 `conflict`. * * Scope: `custom_fields:write`. */ create(input: CreateCustomFieldInput): Promise; /** * `PATCH /v1/audience/custom-fields/:ref` -- a partial update. The slug is * not updatable: values already stored under it would be orphaned. * * Scope: `custom_fields:write`. */ update(ref: string, input: UpdateCustomFieldInput): Promise; /** * `DELETE /v1/audience/custom-fields/:ref` -- 204, no body. * * Scope: `custom_fields:write`. */ delete(ref: string): Promise; }