Get Field and Other Metadata for an Object

Use the sObject Describe resource to retrieve all the metadata for an object, including information about each field, URLs, and child relationships.

Example

1curl https://MyDomainName.my.salesforce.com/services/data/v67.0/sobjects/Account/describe/ -H "Authorization: Bearer token"

Example request body

none required

Example response body

1{
2  "name" : "Account",
3  "fields" :
4  [
5    {
6      "length" : 18,
7      "name" : "Id",
8      "type" : "id",
9      "defaultValue" : {    "value" : null  },
10      "updateable" : false,
11      "label" : "Account ID",
12      ...
13    },
14
15    ...
16
17  ],
18
19
20  "updateable" : true,
21  "label" : "Account",
22  "keyPrefix" : "001",
23  "custom" : false,
24
25  ...
26
27  "urls" :
28  {
29    "uiEditTemplate" : "https://MyDomainName.my.salesforce.com/{ID}/e",
30    "sobject" : "/services/data/v67.0/sobjects/Account",
31    "uiDetailTemplate" : "https://MyDomainName.my.salesforce.com/{ID}",
32    ...
33  },
34
35  "childRelationships" :
36  [
37    {
38      "field" : "ParentId",
39      "deprecatedAndHidden" : false,
40      ...
41    }, 
42
43    ....
44
45  ],
46
47  "createable" : true,
48  "customSetting" : false,
49  ...
50}

For more information about the items in the request body, see DescribesObjectResult in the SOAP API Developers Guide.