Update a custom field
Updates an existing custom field definition and returns the updated field. Request: PATCH /v1/custom-fields/{id}. Scope: contacts:update.
PATCH
Updates an existing custom field definition and returns the updated field.
apiKeyheader
x-api-key<token>id*stringMatch
^cfield_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
label?string|nulloptions?array<string>|nulldefaultValue?string|null|nullisRequired?boolean|nullsortOrder?|nullSuccess
application/json- response
id*CustomFieldDefinitionIdMatch
^cfield_[0-9a-hjkmnp-tv-z]{16,24}$organizationId*OrganizationIdMatch
^org_[0-9a-hjkmnp-tv-z]{16,24}$key*stringlabel*stringtype*stringValue in
"text""number""boolean""date""select"options*array<string>|nulldefaultValue*string|nullisRequired*booleansortOrder*integerRange
0 <= value <= 9007199254740991createdAt*stringupdatedAt*stringimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.customFields.update({
"id": "example"
});Example Response
{
"id": "string",
"organizationId": "string",
"key": "string",
"label": "string",
"type": "text",
"options": [
"string"
],
"defaultValue": "string",
"isRequired": true,
"sortOrder": 0,
"createdAt": "string",
"updatedAt": "string"
}