EntityField Resource
Add columns to a custom or standard entity. Every custom field receives a __c suffix automatically — send the plain name in the payload.
See the Entity Management API Overview for auth, permissions, and response shape, and Field Type Reference for the per-type required properties.
Create a Field
POST /api/3.0/entity/EntityField
Authorization: Bearer <token>
Content-Type: application/json
Accept: application/json
{
"EntityId": "7NS0000000000A50001",
"Name": "ContractNumber",
"Label": "Contract Number",
"FieldTypeId": "7NY0000000000000000",
"Length": 100
}The response returns the new field ID:
{ "id": "7NX0000000000CB0001", "errors": [], "success": true }
Payload Reference
| Property | Type | Required | Notes |
|---|
| EntityId | string | yes | The Entity this field belongs to. |
| Name | string (≤77) | yes | API name. Alphanumeric, cannot contain spaces, cannot be purely numeric, cannot equal the parent entity's Name. Reserved names (listed below) are rejected. Send the plain name; __c is appended for custom fields. |
| Label | string (≤70) | yes | Display label. |
| FieldTypeId | string | yes | The type of field. See Field Type Reference. IDs are case-sensitive. |
| Description | string (≤255) | no | Admin-facing description. |
| HelpText | string (≤510) | no | Help text shown next to the field in Setup and the UI. |
| DefaultValue | string (≤2046) | no | Default value. Format-validated per type (must be a valid email / URL / phone / date / boolean / etc.). See per-type notes in the Field Type Reference. |
| IsRequired | bool | no | Records must have a value on save. Not allowed on Formula, RollupSummary, or Calculated fields. Setting this also adds the field to the entity's default page layouts. |
| IsUnique | bool | no | Values must be unique across records. Allowed on Text, Number, Currency, Percent, Email, Phone, URL, Date, DateTime, and AutoNumber fields only. |
| Searchable | bool | no | Include the field in the entity's search index. |
| IsAudited | bool | no | Track changes to this field in the audit log. Not allowed on external-schema entities (Salesforce, Dynamics). |
| IsCreateable | bool | no | Whether the field is writable on record create. |
| IsUpdateable | bool | no | Whether the field is writable on record update. |
| Length | int | type-dependent | Required for Text and TextArea. Required for Number/Currency/Percent (digits left of the decimal). See the per-type table. |
| DecimalPlaces | int | type-dependent | Required for Number/Currency/Percent. Also settable on Formula, RollupSummary, and Calculated for numeric return types. |
| NumberOfVisibleLines | int | type-dependent | Required for TextArea and PicklistMultiSelect. Sets the visible line-count (TextArea) or list-box height (PicklistMultiSelect). |
| DisplayFormat | string | AutoNumber only | Auto-number pattern for the field. Same regex as entity-level AutoNumberFormat — must contain exactly one {0:0+} counter token. |
| StartingNumber | long | AutoNumber only | First number issued. |
| Increments | long | AutoNumber only | Step between numbers. |
| PicklistSortAlphabetically | bool | Picklist only | Display picklist values alphabetically instead of by their Order. |
| PicklistTypeId | string | GlobalPicklist only | The GlobalPicklistType whose values this field binds to. See Picklists and Global Picklists. |
| Picklists | array | Picklist / MultiSelect | Embedded values on create only. See Picklists and Global Picklists. |
| RelatedToEntityId | string | Lookup / MasterDetail / Rollup | The target entity for a relationship (for Rollup, the child entity being aggregated). |
| RelatedToRelationshipName | string | Lookup / MasterDetail | Display label for the related-records section on the parent's page layout. |
| RelatedToFilterFieldId | string | Rollup only | The Master-Detail or Lookup field on the child that links back to the parent. |
| RelatedToFieldId | string | Rollup / Formula | For Rollup: the child field being aggregated. For Formula: the return-type field-type ID. |
| LookupFilter | object | Lookup / MasterDetail | Restrict which records are selectable. See Lookup Filters. |
| RollupFilterCriteria | array | Rollup only | Only children matching all criteria are included. See Rollup Summary Fields. |
| FieldOptions | object | no | Nested per-type options — see below. |
Reserved Field Names
These names are rejected on create — they are already provisioned by the platform:
Id, Name, OwnerId, IsDeleted, CreatedOn, ModifiedOn, CreatedById, ModifiedById, RecordTypeId
The comparison is case-insensitive against the base name (before the __c suffix). Additionally, a field's Name cannot equal its parent entity's Name, cannot contain spaces, and cannot be purely numeric.
FieldOptions
Advanced per-field options live inside a nested FieldOptions object. Send only options that apply to the field type — unrelated options are rejected.
| Option | Applies to | Notes |
|---|
| IsHtmlField | TextArea | Turns the TextArea into a rich-text / HTML editor. Cannot be reverted once enabled. |
| TreatBlankAsZero | Number / Currency / Percent | Treat a blank value as 0 in formulas and rollups. Defaults to true. |
| DateTimeOptions | DateTime | Storage granularity: "Minutes" (default), "Seconds", or "Milliseconds". |
| AllowReparenting | MasterDetail | Allow a child record to be moved to a different parent. |
| RecordAuditingEnabled | Any | Enable external-audit tracking on this field. |
| MinValue / MaxValue | Number / Currency / Percent | Enforce a minimum or maximum numeric value. |
{
"EntityId": "7NS0000000000A50001",
"Name": "Notes",
"Label": "Notes",
"FieldTypeId": "7NY0000000000040000",
"Length": 32000,
"NumberOfVisibleLines": 5,
"FieldOptions": { "IsHtmlField": true }
}
Get a Field
GET /api/3.0/entity/EntityField/<field id>
Authorization: Bearer <token>
Accept: application/json
List Fields on an Entity
GET /api/3.0/entity/EntityField?entityid=<entity id>&limit=200
Authorization: Bearer <token>
Accept: application/json
Supports the same filters, sorting, and pagination as the record-CRUD API (see Read records).
Update a Field
PATCH /api/3.0/entity/EntityField/<field id>
Authorization: Bearer <token>
Content-Type: application/json
Accept: application/json
{
"Label": "Contract # (Updated)",
"HelpText": "External contract number from the CRM."
}Editable after creation
Label, Description, HelpText, DefaultValue, IsRequired, Searchable, IsAudited.Length — can be increased on Text fields. Cannot be increased above 4,000 if the field is referenced by any formula.PicklistSortAlphabetically, NumberOfVisibleLines.LookupFilter — the full filter is replaced on PATCH (send the complete criteria array).FieldOptions.* — partial merge; only the keys you send are updated, the rest are preserved.
Immutable after creation
FieldTypeId — the field type cannot be changed. Delete and recreate if a type change is needed.Name — the API name is set at creation and does not change.RelatedToEntityId and RelatedToFieldId when the field is already referenced by another field (formula, rollup, etc.).- On "critical" entities (User, Account, Contact, and other platform-managed types), even data-type-compatible property changes may be rejected.
Delete a Field
DELETE /api/3.0/entity/EntityField/<field id>
Authorization: Bearer <token>
Deletion drops the underlying database column and all its data. It is blocked, not cascaded, in these cases:
- The field is referenced by a RecordType.
- The field is referenced by a field on another entity (Lookup target, cross-entity formula).
- The field is referenced by a formula on the same entity.
Remove the dependent references first, then retry the delete.
Status Codes
| HTTP | When |
|---|
| 200 / 201 | Operation succeeded. |
| 404 Not Found | You lack permission on the EntityField resource, or the referenced entity does not exist. |
| 406 Not Acceptable | Validation failed — missing required per-type property, invalid Name, reserved name, duplicate name on the entity, attempt to change immutable property, unsupported FieldOptions for the type, or DELETE blocked by a dependency. |
<< Entity Resource | Field Type Reference >>