You need to sign in to do that
Don't have an account?

How can I set the RecordTypeId when creating a Lead through the REST API?
I'm able to create a new Lead through the API but unable to set the RecordTypeId. Even if I set the RecordTypeId in the request, and the request succeeds it will always fallback to the default Record Type.
I have checked the accessability level of the RecordTypeId field and it is editable by all.
Does anyone know where I'm going wrong?
I have checked the accessability level of the RecordTypeId field and it is editable by all.
Does anyone know where I'm going wrong?
Can you export one record from the 0120Y000000ZAA7 record type along with the record type ID to check whether the ID is correct, your code seems correct to me just perform an export and verify the record type ID
For the integration purposes you might have created a dummy user with some profile considering this is a REST API, for example we create an Integration user for any sort of integration and assign a profile to this user, can you check whether that profile has access to this record type, if not please provide the same and verify.
Instead of setting the RecordTypeId when creating the lead, I'm making a second API call to update the RecordTypeId once the Lead has been created.
It's far from ideal but at least it works.
Thaks for your help Deepesh.
I'm having a similar issue again with OwnerId this time, but I can't even change the value in a PATCH request now.
I've tried running a request in the Salesforce Workbench (https://workbench.developerforce.com/restExplorer.php) with no exceptions being thrown however the OwnerId of the lead still isn't updated.
Hi, here we have exactly the same problem, submitting the request from our NodeJS API.
Both also for RecordTypeId and OwnerId.
We want to create a given RecordType and add its 15-digit Id, and the API indeed checks on creation that the right values for this RecordType are sent altogether. But then the RecordType is set back to default...
Regarding creating a lead, update the lead conversion settings to push the correct lead. Make sure you select "Keep the existing record type" when manually created records.
Hi, we have faced the same problem and a solution was:
send record type ID in the 15-digit format as
please, note that the main difference is in the key name - recordType instead of RecordTypeId
Set the following header:
Sforce-Auto-Assign: False