Newer Version Available

This content describes an older version of this product. View Latest

Create a Record

Create a record. First, make a request to the Clone Record Default or Create Record Default resources to get the default metadata and data for the record.
Resource
1/ui-api/records
Available Version
41.0
HTTP Method
POST
Example
1POST /ui-api/records
1{
2  "apiName": "Account",
3  "fields": {
4    "Name": "Universal Containers"
5  }
6}
To provide an address, provide the individual fields as separate inputs. The compound field is only available in the response.
1{
2  "apiName": "Account",
3  "fields" : {
4    "Name": "Local Boxes",
5    "BillingState": "WA",
6    "BillingStreet" : "123 Main Street",
7    "BillingCountry" : "USA"
8  }
9}
This is an example response body.
1{
2  "apiName" : "Account",
3  "fields" : {
4    "AnnualRevenue" : {
5      "displayValue" : null,
6      "value" : null
7    },
8    "BillingCity" : {
9      "displayValue" : null,
10      "value" : null
11    },
12    "BillingCountry" : {
13      "displayValue" : null,
14      "value" : null
15    },
16    "BillingPostalCode" : {
17      "displayValue" : null,
18      "value" : null
19    },
20    "BillingState" : {
21      "displayValue" : null,
22      "value" : null
23    },
24    "BillingStreet" : {
25      "displayValue" : null,
26      "value" : null
27    },
28    "CreatedBy" : {
29      "displayValue" : "Deanna Li",
30      "value" : {
31        "apiName" : "User",
32        "fields" : {
33          "Id" : {
34            "displayValue" : "005R0000000IEDsIAO",
35            "value" : "005R0000000IEDsIAO"
36          },
37          "Name" : {
38            "displayValue" : "Deanna Li",
39            "value" : "Deanna Li"
40          }
41        },
42        "id" : "005R0000000IEDsIAO",
43        "recordTypeInfo" : null
44      }
45    },
46    "CreatedById" : {
47      "displayValue" : "005R0000000IEDsIAO",
48      "value" : "005R0000000IEDsIAO"
49    },
50    "CreatedDate" : {
51      "displayValue" : "11/22/2016 12:36 PM",
52      "value" : "2016-11-22T20:36:12.000Z"
53    },
54    "Description" : {
55      "displayValue" : null,
56      "value" : null
57    },
58    "Fax" : {
59      "displayValue" : null,
60      "value" : null
61    },
62    "Industry" : {
63      "displayValue" : null,
64      "value" : null
65    },
66    "LastModifiedBy" : {
67      "displayValue" : "Deanna Li",
68      "value" : {
69        "apiName" : "User",
70        "fields" : {
71          "Id" : {
72            "displayValue" : "005R0000000IEDsIAO",
73            "value" : "005R0000000IEDsIAO"
74          },
75          "Name" : {
76            "displayValue" : "Deanna Li",
77            "value" : "Deanna Li"
78          }
79        },
80        "id" : "005R0000000IEDsIAO",
81        "recordTypeInfo" : null
82      }
83    },
84    "LastModifiedById" : {
85      "displayValue" : "005R0000000IEDsIAO",
86      "value" : "005R0000000IEDsIAO"
87    },
88    "LastModifiedDate" : {
89      "displayValue" : "11/22/2016 12:36 PM",
90      "value" : "2016-11-22T20:36:12.000Z"
91    },
92    "Name" : {
93      "displayValue" : "Universal Containers",
94      "value" : "Universal Containers"
95    },
96    "NumberOfEmployees" : {
97      "displayValue" : null,
98      "value" : null
99    },
100    "Owner" : {
101      "displayValue" : "Deanna Li",
102      "value" : {
103        "apiName" : "User",
104        "fields" : {
105          "Id" : {
106            "displayValue" : "005R0000000IEDsIAO",
107            "value" : "005R0000000IEDsIAO"
108          },
109          "Name" : {
110            "displayValue" : "Deanna Li",
111            "value" : "Deanna Li"
112          }
113        },
114        "id" : "005R0000000IEDsIAO",
115        "recordTypeInfo" : null
116      }
117    },
118    "OwnerId" : {
119      "displayValue" : "005R0000000IEDsIAO",
120      "value" : "005R0000000IEDsIAO"
121    },
122    "ParentId" : {
123      "displayValue" : null,
124      "value" : null
125    },
126    "Phone" : {
127      "displayValue" : null,
128      "value" : null
129    },
130    "ShippingCity" : {
131      "displayValue" : null,
132      "value" : null
133    },
134    "ShippingCountry" : {
135      "displayValue" : null,
136      "value" : null
137    },
138    "ShippingPostalCode" : {
139      "displayValue" : null,
140      "value" : null
141    },
142    "ShippingState" : {
143      "displayValue" : null,
144      "value" : null
145    },
146    "ShippingStreet" : {
147      "displayValue" : null,
148      "value" : null
149    },
150    "Type" : {
151      "displayValue" : null,
152      "value" : null
153    },
154    "Website" : {
155      "displayValue" : null,
156      "value" : null
157    }
158  },
159  "id" : "001R0000003GeJ1IAK",
160  "recordTypeInfo" : null
161}
Request body
Name Type Description Required or Optional Available Version
apiName String To create a record, specify the API name of an Object from which to create the record. To update a record, use null or don’t pass this property. Required 41.0
fields Map<String, Object> Map of field names to field values.

Format data types according to these rules:

  • Address—JSON String
  • Base64—JSON String
  • Boolean—JSON Boolean, true or false
  • Currency—JSON Float
  • Date—JSON string in correct format
  • DateTime—JSON string in ISO 8601 format
  • Double—JSON Float
  • Email—JSON String
  • EncryptedString—JSON String
  • Int—JSON Number
  • Location—JSON String
  • MultiPicklist—JSON String
  • Percent—JSON Float
  • Phone—JSON String
  • Picklist—JSON String
  • Reference—JSON String.
  • String—JSON String
  • TextArea—JSON String
  • Time—JSON String in format HH:MM:SS
  • Url—JSON String
Required 41.0
Response Body
Record