You canmight want to first check that the user you used in the CreatedById field, besides API account, also have permission to create record.
If that's already the case, you might want to try using this method instead:
{
"CreatedById" : "<Record ID of user>"
}
//or you can use
{
"CreatedBy": { "<Unique"<Any Unique Field in User>" : "<value>"}
}
I created the example to update that field following Please see "linkHow to assign value to CreatedById fields via REST API in Salesforce" for detailed steps.