Create a custom field
Creates a new custom field definition and returns it with a 201 status; the field key must be unique, and an organization defines at most 100.
POST
Creates a new custom field definition and returns it with a 201 status; the field key must be unique, and an organization defines at most 100.
apiKeyheader
x-api-key<token>application/json- body
key*stringlabel*stringtype*stringValue in
"text""number""boolean""date""select"options?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.create({
"key": "example",
"label": "example",
"type": "text"
});Example Response
{
"id": "string",
"organizationId": "string",
"key": "string",
"label": "string",
"type": "text",
"options": [
"string"
],
"defaultValue": "string",
"isRequired": true,
"sortOrder": 0,
"createdAt": "string",
"updatedAt": "string"
}