> You are reading the Docusign Developer Documentation. For clean Markdown of any page, append .md to the page URL. > > Documentation indexes by section: > - APIs and SDKs: https://docusign.docs.buildwithfern.com/docs/llms.txt > - Platform 101: https://docusign.docs.buildwithfern.com/platform/llms.txt > - Extension Apps: https://docusign.docs.buildwithfern.com/extension-apps/llms.txt > - Docusign CLI: https://docusign.docs.buildwithfern.com/docusign-cli/llms.txt > > Authentication (OAuth, JWT Grant, M2M): https://docusign.docs.buildwithfern.com/platform/auth > Webhooks and Connect: https://docusign.docs.buildwithfern.com/platform/webhooks > > OpenAPI specifications: https://docusign.docs.buildwithfern.com/openapi.json > MCP server: https://docusign.docs.buildwithfern.com/_mcp/server # Error codes > Learn about the error codes used by the eSignature REST API. ## Error codes The Docusign REST APIs return either 200 (OK) or 201 (Created) when an API request successfully runs to completion. It may also return 204 (No Content) to that the requested action was completed successfully, but the server does not need to return any data or a new resource in the response body. Status codes in the 400-500 range indicate failures. For APIs that process a single item, this overall status code determines success or failure. There are special considerations for `PUT` and `POST` calls that process multiple items. See [Error response handling for API requests that support multiple items](/docs/esign-rest-api/esign101/error-codes#error-response-handling-for-api-requests-that-support-multiple-items) for more information on error response handling. If an API request is not successful, the HTTP response code returned is generally one of the following: | Error code | Message | Description | | ---------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 400 | Bad Request | A portion of the request was not valid or could not be processed in the current context. | | 401 | Unauthorized | The authentication or authorization required for the API request did not pass. | | 403 | Forbidden | This resource is not allowed for the caller | | 404 | Not Found | The resource does not exist. This might occur on `GET` or `DELETE` requests. | | 408 | Request Timeout | It took too long to get a response | | 415 | Unsupported Media Type | The data type of some data in the request is not supported. For example: your request may be in XML, but you did not specify `Content-Type: application/xml` in the request header. | | 429 | Too Many Requests | API limit was reached | | 444 | The API request is forbidden. Request blocked due to excess usage | The request was blocked by Docusign's traffic management system. | The following error codes occur with much less frequency: | Error code | Message | Description | | ---------- | --------------------- | -------------------------------------------------------------------------------------------- | | 405 | Method Not Allowed | The HTTP method (`GET`, `PUT`, `POST`, or `DELETE`) is not valid for the given resource URI. | | 500 | Internal Server Error | An internal server-side error has occurred. | In most cases, the response body contains a more detailed `errorDetails` structure when an error occurs. However, depending on the error, the server might return HTML in place of the `errorDetails` structure, or nothing in the case of certain error types. ## General error response handling The general flow for response handling is: ```text if (statusCode == 200 || statusCode == 201) { // successful call - but do special processing for multi-item PUT & POST requests } else if (statusCode == 404) { // call was processed but the resource being accessed was not found // envelope doesn’t exist, user doesn’t exist, etc. There may not be any more details in the errorDetails response. } else // other errors { var errorDetails = Json.Decode(response.body); if (errorDetails != null) { // process errorDetails.errorCode - See table of error codes if (errorDetails.message != null) { // use errorDetails.message to get more information in textual form. } } } ``` ## Error response handling for API requests that support multiple items The [eSignature REST API](/docs/esign-rest-api) supports many calls that operate on multiple items, such as adding one or more users to an account or adding one or more documents to a draft envelope. This decreases the number of HTTP requests required to perform some common operations. For API requests that support multiple items, the overall HTTP response code will be 200 (OK) or 201 (Created) if the API request has run to completion, which means all items in the request structure were processed. This response code is returned even if there were failures for individual items in the array. The response body contains information about each item processed, and the structure for each item contains an `errorDetails` element if that item was not successfully processed. You are responsible for checking for the `errorDetails` element for each item in the array to perform proper error handling. The general response processing logic for these types of APIs is: ```text if (statusCode == 200 || statusCode == 201) { // check for errors with each item processed. var itemsArray = Json.Decode(response.body); foreach(var item in itemsArray) { if (item.errorDetails != null) { // an error occurred during processing - handle it string errorCode = item.errorDetails.errorCode; string errorMessage = item.errorDetails.message; // perform error handling based on errorCode } else { // item processing was successful } } } else { // statusCode indicated overall error with the request. } ``` ## Next steps * See [Troubleshooting for common errors](/docs/esign-rest-api/esign101/error-codes/troubleshooting-common-errors) for causes and resolutions for specific errors. * Learn more about [Envelope status codes](/docs/esign-rest-api/esign101/concepts/envelopes/status-codes). * Get an overview of [Recipient status codes](/docs/esign-rest-api/esign101/concepts/recipients/status-codes). > Learn about the error codes used by the eSignature REST API. ## Docs - [Troubleshooting for common errors](https://developers.docusign.com/docs/esign-rest-api/esign101/error-codes/troubleshooting-common-errors.md): Learn about causes and remedies for common eSignature REST API error responses.