Table of Contents


Entity Resource

Manage custom entities (tables) in your tenant's data model. Every custom entity is stored with a __c suffix on its Name. Send the plain name on create; the platform appends __c and returns the entity's new ID.

See the Entity Management API Overview for authentication, permission requirements, and response shape.


Create an Entity

POST /api/3.0/entity/Entity
Authorization: Bearer <token>
Content-Type: application/json
Accept: application/json

{
  "Name": "SampleContract",
  "Label": "Sample Contract",
  "PluralLabel": "Sample Contracts",
  "NameFieldLabel": "Contract Name"
}

Successful response returns the new entity ID:

{ "id": "7NS0000000000A50001", "errors": [], "success": true }

Save the returned id; you need it as EntityId on every EntityField call that adds columns to this entity.

Object vs Person entity

Set Type to 1 to create a Person entity (built-in name-part fields, contact-style attributes). Default is 0 (Object). No other values are accepted.

{
  "Name": "SampleApplicant",
  "Label": "Sample Applicant",
  "PluralLabel": "Sample Applicants",
  "Type": 1
}

Auto-numbered Name field

To make the entity's built-in Name field an auto-number instead of free text, set IsAutoNumber = true and supply AutoNumberFormat, StartingNumber, and AutoIncrement:

{
  "Name": "Invoice",
  "Label": "Invoice",
  "PluralLabel": "Invoices",
  "IsAutoNumber": true,
  "AutoNumberFormat": "INV-{0:0000}",
  "StartingNumber": 1000,
  "AutoIncrement": 1
}

The format uses exactly one {0:0+} counter token — for example INV-{0:0000} yields INV-1000, INV-1001, and so on. The token must include the 0: prefix; formats such as INV-{0000} are rejected as invalid.


Payload Reference

PropertyTypeRequiredNotes
Namestring (≤100)yesAPI name. Must match ^[a-zA-Z][A-Za-z0-9_]+$ — alphanumeric, must start with a letter, no leading/trailing underscore, no consecutive underscores. Send the plain name; __c is appended.
Labelstring (≤100)yesSingular display name.
PluralLabelstring (≤100)yesPlural display name.
Typeintno0 = Object (default), 1 = Person. Integer only.
Descriptionstring (≤255)noFree-text description.
NameFieldLabelstring (≤64)noLabel for the built-in Name field. Defaults to Label.
StartsWithVowelboolnoUse "an" instead of "a" in generated UI text ("Create an Invoice").
IsReadOnlyboolnoRecords are readable but cannot be created/edited through the Setup UI. Does not affect API writes with sufficient permission.
IsAutoNumberboolnoMake the built-in Name field an auto-number. Requires the three properties below when true.
AutoNumberFormatstringwith IsAutoNumberDisplay pattern. Must match ^.*\{0\:0{1,}\}[^\{^\}]*$ — exactly one {0:0+} counter token, no other braces.
StartingNumberlongwith IsAutoNumberFirst number issued.
AutoIncrementlongwith IsAutoNumberStep between numbers, usually 1.
EntityOptionsobjectnoBehavioral toggles — see below.

System-assigned; do not send:Id, KeyPrefix, Code. Schema is technically writable but restricted to internal values (standard, schema, system, Force, DynamicsCrm); leave it unset to default to standard.


EntityOptions

OptionTypeNotes
TrackActivitiesboolEnable task/event tracking on records of this entity.
TrackFeedsboolEnable activity-stream (feed) tracking on records.
AllowReportsboolAllow the entity as a data source for reports.
ShowStandardHelpboolShow the platform's built-in help content.
PortalOwnerFieldstringName of the field used to determine record ownership in portal contexts.
AccountSecurityFieldIdstringThe Account lookup field ID used for account-based row security.

Standard Fields Provisioned Automatically

Every entity ships with these system-managed fields; you do not create them:

  • Id — 19-character record identifier (first three characters are the entity's KeyPrefix).
  • Name — the display name (auto-number when IsAutoNumber = true).
  • OwnerId — Lookup to the User who owns the record.
  • CreatedById, CreatedOn, ModifiedById, ModifiedOn — audit fields (UTC).
  • IsDeleted — soft-delete flag.

Get an Entity

Retrieve one entity by ID:

GET /api/3.0/entity/Entity/<entity id>
Authorization: Bearer <token>
Accept: application/json

Retrieve one entity's metadata (fields, layouts, and other schema data returned by the platform):

GET /api/3.0/entity/Entity/<entity id>/metadata
Authorization: Bearer <token>
Accept: application/json

Retrieve metadata for many entities in one call:

GET /api/3.0/entity/metadata?entities=Account,Contact,Invoice__c
Authorization: Bearer <token>
Accept: application/json

List Entities

GET /api/3.0/entity/Entity?limit=100&sort=Name
Authorization: Bearer <token>
Accept: application/json

Supports the same query-string filters, fields, sort, order, limit, and offset parameters as the record-CRUD API. See Read records.


Update an Entity

PATCH /api/3.0/entity/Entity/<entity id>
Authorization: Bearer <token>
Content-Type: application/json
Accept: application/json

{
  "Label": "Renamed Contract",
  "Description": "Contracts issued to customers after negotiation",
  "EntityOptions": { "TrackFeeds": true, "AllowReports": true }
}

Editable after creation:Label, PluralLabel, Description, NameFieldLabel, StartsWithVowel, IsReadOnly, and EntityOptions.*.

Immutable:Name, KeyPrefix, Code, Schema, Type. Once the entity is created, these cannot be changed via PATCH.


Delete an Entity

DELETE /api/3.0/entity/Entity/<entity id>
Authorization: Bearer <token>

Deletion is destructive — it drops the underlying table, not just the metadata. All records in the entity are removed and cannot be recovered. Fields on the entity, layouts, list layouts, and buttons that reference the entity are also removed.

Add ?isPermanent=true to bypass the recycle bin. Without it, the entity is soft-deleted and can be restored by a Host user via the platform Recycle Bin.


Status Codes

HTTPWhen
200 OKRead / update / delete succeeded.
201 CreatedEntity created.
404 Not FoundEntity name is missing or you lack permission on the resource.
406 Not AcceptableValidation failed — missing required field, invalid Name format, invalid AutoNumberFormat, or an attempt to change an immutable property.

<< Entity Management API Overview | EntityField Resource >>

Last updated on 7/28/2026

Attachments