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
| Property | Type | Required | Notes |
|---|
| Name | string (≤100) | yes | API 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. |
| Label | string (≤100) | yes | Singular display name. |
| PluralLabel | string (≤100) | yes | Plural display name. |
| Type | int | no | 0 = Object (default), 1 = Person. Integer only. |
| Description | string (≤255) | no | Free-text description. |
| NameFieldLabel | string (≤64) | no | Label for the built-in Name field. Defaults to Label. |
| StartsWithVowel | bool | no | Use "an" instead of "a" in generated UI text ("Create an Invoice"). |
| IsReadOnly | bool | no | Records are readable but cannot be created/edited through the Setup UI. Does not affect API writes with sufficient permission. |
| IsAutoNumber | bool | no | Make the built-in Name field an auto-number. Requires the three properties below when true. |
| AutoNumberFormat | string | with IsAutoNumber | Display pattern. Must match ^.*\{0\:0{1,}\}[^\{^\}]*$ — exactly one {0:0+} counter token, no other braces. |
| StartingNumber | long | with IsAutoNumber | First number issued. |
| AutoIncrement | long | with IsAutoNumber | Step between numbers, usually 1. |
| EntityOptions | object | no | Behavioral 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
| Option | Type | Notes |
|---|
| TrackActivities | bool | Enable task/event tracking on records of this entity. |
| TrackFeeds | bool | Enable activity-stream (feed) tracking on records. |
| AllowReports | bool | Allow the entity as a data source for reports. |
| ShowStandardHelp | bool | Show the platform's built-in help content. |
| PortalOwnerField | string | Name of the field used to determine record ownership in portal contexts. |
| AccountSecurityFieldId | string | The 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
| HTTP | When |
|---|
| 200 OK | Read / update / delete succeeded. |
| 201 Created | Entity created. |
| 404 Not Found | Entity name is missing or you lack permission on the resource. |
| 406 Not Acceptable | Validation failed — missing required field, invalid Name format, invalid AutoNumberFormat, or an attempt to change an immutable property. |
<< Entity Management API Overview | EntityField Resource >>