Error Codes
Marketo REST APIs return errors at the HTTP, response, or record level. This page explains each error type and lists the associated error codes.
Handling and Logging Exceptions
Log requests and responses when your integration encounters an unexpected exception. Some exceptions, such as expired authentication, can be handled by re-authenticating. Other exceptions can require assistance from Support, which will request the associated request and response details.
Error Types
The Marketo REST API can return three types of errors during normal operation:
- HTTP-Level: Indicated by a
4xxcode. - Response-Level: Included in the “errors” array of the JSON response.
- Record-Level: Included in the “result” array of the JSON response and indicated for each record by the “status” field and “reasons” array.
Response-Level and Record-Level errors return HTTP status code 200. For all error types, do not evaluate the HTTP reason phrase because it is optional and subject to change.
HTTP-Level errors
During normal operation, Marketo returns two HTTP status code errors: 413 Request Entity Too Large and 414 Request URI Too Long. To recover from either error, modify the request and retry it. You can prevent these errors by checking request sizes before submission.
Marketo returns 413 when the request payload exceeds 1MB, or 10MB for Import Lead. Check the request size before submission. If records cause the request to exceed the limit, move those records to another request.
Marketo returns 414 when the URI of a GET request exceeds 8KB. Check the query-string length before submission. If it exceeds the limit, change the request method to POST, put the query string in the request body, and add the _method=GET parameter. Long URIs are most common when retrieving large record batches with long filter values, such as a GUID.
The Identity endpoint can return a 401 Unauthorized error, typically because the Client Id or Client Secret is invalid. The following table lists HTTP-Level error codes.
Response-Level errors
Response-Level errors occur when the response sets the success parameter to false. They use the following structure:
{
"requestId": "e42b#14272d07d78",
"success": false,
"errors": [
{
"code": "601",
"message": "Unauthorized"
}
]
}
Each object in the “errors” array contains two members:
code: A quoted integer from 601 to 799.message: The plain-text reason for the error.
A 6xx code indicates that the entire request failed and was not executed. For example, recover from a 601 “Access token invalid” error by re-authenticating and passing the new access token with the request.
A 7xx code indicates that the request failed because no data was returned or the request parameters were invalid. Causes include an invalid date or a missing required parameter.
Response-Level Error Codes
- A date was specified that was not in the correct format
- An invalid dynamic content id was specified
The call cannot be fulfilled because it violates a requirement to create or update an asset, for example, trying to create an email without a template. It is also possible to get this error when trying to:
- Retrieve content for landing pages that contain social content.
- Clone a program that contains certain asset types (see Program Clone for more information).
- Approve an asset that has no draft (that is, has already been approved).
Record-Level record_level_errors
Record-Level errors indicate that the request was valid but the operation could not be completed for an individual record. A response with Record-Level errors follows this pattern:
Response
{
"requestId":"e42b#14272d07d78",
"success":true,
"result":[
{
"id":50,
"status":"created"
},
{
"id":51,
"status":"created"
},
{
"status":"skipped",
"reasons":[
{
"code":"1005",
"message":"Lead already exists"
}
]
}
]
}
Records in the result array appear in the same order as records in the request input array. Each record can succeed or fail independently, as indicated by its status field.
For a failed record, the “status” field is “skipped” and the record includes a “reasons” array. Each reason contains a “code” member and a “message” member. The code is always 1xxx, and the message explains why the record was skipped.
For example, if a Sync Leads request sets “action” to “createOnly” and a lead already exists for one of the submitted keys, the response returns code 1005 and the message “Lead already exists,” as shown above.
Record-Level Error Codes
| table 0-row-3 1-row-3 2-row-3 3-row-3 4-row-3 5-row-3 6-row-3 7-row-3 8-row-3 9-row-3 10-row-3 11-row-3 12-row-3 13-row-3 14-row-3 15-row-3 16-row-3 17-row-3 18-row-3 19-row-3 20-row-3 21-row-3 22-row-3 23-row-3 24-row-3 25-row-3 26-row-3 27-row-3 28-row-3 29-row-3 30-row-3 31-row-3 32-row-3 33-row-3 34-row-3 35-row-3 36-row-3 37-row-3 html-authored no-header | ||
|---|---|---|
| Response Code | Description | Comment |
| 1001 | Invalid value ‘%s'. Required of type ‘%s' | Error is generated whenever a parameter value has a type mismatch. For example the string value specified for an integer parameter. |
| 1002 | Missing value for the required parameter ‘%s' | Error is generated when a required parameter is missing from the request |
| 1003 | Invalid data | When the data submitted is not a valid type for the given endpoint or mode; such as when id is submitted for a lead with action designated as createOnly or when using Request Campaign on a batch campaign. |
| 1004 | Lead not found | For syncLead, when action is “updateOnly” and if lead is not found |
| 1005 | Lead already exists | For syncLead, when action is “createOnly” and if a lead already exists |
| 1006 | Field ‘%s' not found | An included field in the call is not a valid field. |
| 1007 | Multiple leads match the lookup criteria | Multiple leads match the lookup criteria. Updates can only be performed when the key matches a single record |
| 1008 | Access denied to partition ‘%s' | The user for the custom service does not have access to a workspace with the partition where the record exists. |
| 1009 | Partition name must be specified | |
| 1010 | Partition update not allowed | The specified record already exists in a separate lead partition. |
| 1011 | Field ‘%s' not supported | When lookup field or `filterType` specified with unsupported standard fields (ex: firstName, lastName) |
| 1012 | Invalid cookie value ‘%s' | Can occur when calling the Associate Lead with an invalid value for the `cookie` parameter. This also occurs when calling Get Leads by Filter Type with `filterType=cookies` and an invalid value for the `filterValues` parameter. |
| 1013 | Object not found | Get object (list, campaign) by id returns this error code |
| 1014 | Failed to create Object | Failed to create Object (list) |
| 1015 | Lead not in list | The designated lead is not a member of the target list |
| 1016 | Too many imports | There are too many imports queued. A maximum of 10 is allowed |
| 1017 | Object already exists | Creation failed because the record already exists |
| 1018 | CRM Enabled | The action could not be carried out, because the instance has a native CRM integration enabled. |
| 1019 | Import in progress | The target list is already being imported to |
| 1020 | Too many clones to program | The subscription has reached the allotted use of `cloneToProgramName` in the Schedule Program for the day |
| 1021 | Company update not allowed | Company update not allowed during syncLead |
| 1022 | Object in use | Delete is not allowed when an object is in use by another object |
| 1025 | Program status not found | A status was specified to Change Lead Program Status that did not match a status available for the program's channel. |
| 1026 | Custom object not enabled | The action could not be carried out, because the instance does not have custom objects integration enabled. |
| 1027 | Max Activity Type Limit Reached | The subscription has reached the maximum number of available custom activity types. |
| 1028 | Max field limit reached | Custom activities have a maximum of 20 secondary attributes. |
| 1029 |
|
|
| 1035 | Unsupported filter type | In some subscriptions, the following Bulk Lead Extract filter types are not supported: updatedAt, smartListId, smartListName. |
| 1036 | Duplicate object found in input | A call was made to update two or more records using the same foreign key. For example, a Sync Companies call using the same externalCompanyId for more than one company. |
| 1037 | Lead was skipped | The Lead was skipped because it is already in or past this status. |
| 1042 | Invalid runAt date | The runAt date specified for Schedule Campaign was too far into the future (the maximum is 2 years). |
| 1048 | Custom Object Discard Draft Failed | A call was made to discard the draft version of a custom object. |
| 1049 | Failed to Create Activity | Attributes array too long. The array of attributes passed to the record exceeded the max length of 65536 bytes |
| 1076 | Merge Leads call with mergeInCRM flag is 4. | You are creating a duplicate record. It is recommended that you use an existing record instead. This is the error msg, which Marketo receives when merging in Salesforce. |
| 1077 | Merge Leads call failed due to `SFDC Field` length | A Merge Leads call with mergeInCRM set to true failed due to `SFDC Field` exceeding the limit of allowed characters. To correct, reduce the length of `SFDC Field`, or set mergeInCRM to false. |
| 1078 | Merge Leads call failed due to deleted entity, not a lead/contact, or field filter criteria does not match. | Merge failure, unable to perform merge operation in natively synced CRM This is the error msg, which Marketo receives when merging in Salesforce. |
| 1079 | Merge Leads call failed due to Personalized URL conflict in duplicate records | A Merge Leads call specified many Leads with the same Personalized URL. To resolve use Marketo Engage user interface to merge these records. |