# HTTP response status codes

HTTP response status codes described in this section indicate whether a specific HTTP request has been successfully completed. Refer to their descriptions below when integrating WebSpellChecker into your applications and testing REST API.

* 400 Bad Request
* 403 Forbidden
* 404 Not Found
* 409 Conflict
* 500 Internal Server Error
* 503 Service Unavailable

#### Error response structure <a href="#httpresponsestatuscodes-errorresponsestructure" id="httpresponsestatuscodes-errorresponsestructure"></a>

The response structure below is applicable to all error messages you may receive. The difference depends on the command used and the message returned.

```javascript
{
	"error": true, 
	"is_critical": 0, 
	"message": "...", 
	"command": "..." 
}
```

### 400 Bad Request <a href="#httpresponsestatuscodes-400badrequest" id="httpresponsestatuscodes-400badrequest"></a>

The HTTP 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error.

**Possible cause**

* Incorrect syntax;
* Incorrect spelling of command, parameter, or value name.

**Remediation**

* Check the command correctness,
* Verify if the request command syntax is correct, and the command is not empty,
* Make sure the request message is framed correctly.

#### Example 1.1. Command error issue <a href="#httpresponsestatuscodes-example1.1.commanderrorissue" id="httpresponsestatuscodes-example1.1.commanderrorissue"></a>

For example, the following has an error in "check\_spelling" command name:

```javascript
{ 
	"error": true, 
	"is_critical": 0, 
	"message": "The command value 'check_spellin' for 'cmd' parameter is unknown. 
	Check available commands. Contact  for more details.", 
	"command": "check_spellin" 
}
```

**Remediation**: Specify a correct command name. Refer to the list of available commands in [HTTP API](/api-reference/overview.md) documentation.

#### Example 1.2. Unspecified command <a href="#httpresponsestatuscodes-example1.2.unspecifiedcommand" id="httpresponsestatuscodes-example1.2.unspecifiedcommand"></a>

For example, the command in the request wasn't specified:

```javascript
{ 
	"error": true, 
	"is_critical": 0, 
	"message": "The command value for 'cmd' parameter is not specified in your request. 
	Contact  for more details.", 
	"command": "" 
}
```

**Remediation:** Specify the command value.

### 403 Forbidden <a href="#httpresponsestatuscodes-403forbidden" id="httpresponsestatuscodes-403forbidden"></a>

The HTTP 403 Forbidden client error status response code indicates that the server understood the request but refuses to authorize it.

**Possible causes**

Some issues usages or occurrences in the response, for example:

* Language is disabled/unallowed;
* Service on the unallowed domain;
* Command, check type unallowed; for example, grammar checking command is not available under free services.
* Product unavailable for the given license;
* Exceeded usage limitations;
* Service subscription expiration.

**Remediation**

In most cases an error description provides the exact cause of the issue and solution on how to fix the issue in response on your side.

#### Example 2.1. Incorrect service ID <a href="#httpresponsestatuscodes-example2.1.incorrectserviceid" id="httpresponsestatuscodes-example2.1.incorrectserviceid"></a>

Example of an incorrect value used for a service/customer ID parameter:

```javascript
{ 	"error": true, 
	"is_critical": 0, 
	"message": "Service key is incorrect.", "command": "check" 
}
```

**Remediation**: Check the value used in the service/customer ID parameter and make sure that you have copied and pasted the whole key without any extra characters. For older versions, please note that “**1:**” is also a part of your activation key.

#### Example 2.2. Expired subscription <a href="#httpresponsestatuscodes-example2.2.expiredsubscription" id="httpresponsestatuscodes-example2.2.expiredsubscription"></a>

Example of an expired customer ID:

```javascript
{ 	"error": true, 
	"is_critical": 0, 
	"message": "Subscription expired. Contact  for more details.",
	"command": "check" 
}
```

**Remediation**: Renew the service subscription.

#### Example 2.3. Unallowed domains issue <a href="#httpresponsestatuscodes-example2.3.unalloweddomainsissue" id="httpresponsestatuscodes-example2.3.unalloweddomainsissue"></a>

Example of an attempt to use the service on the domain(s) where the use is not granted:

```javascript
{ 
	"error": true, 
	"is_critical": 0, 
	"message": "Requests from '' are not allowed. Check domain permissions. Contact  for more details.", 
	"command": "check" 
}
```

**Remediation**: Verify the subscription covers the domain where you are using the service. Contact <support@webspellchecker.net> to whitelist a domain for your subscription.

#### Example 2.4. Subscription key issue <a href="#httpresponsestatuscodes-example2.4.subscriptionkeyissue" id="httpresponsestatuscodes-example2.4.subscriptionkeyissue"></a>

Example of the subscription key which is either turned off or does not exist yet:

```javascript
{ 
	"error": true, 
	"is_critical": 0, 
	"message": "Subscription is disabled or doesn't exist. Contact  for more details.",
	"command": "check" 
}
```

**Remediation**: Contact our support team for details. If you have just subscribed to the Cloud services, please allow up to 5-10 mins for the changes to take effect.

### 404 Not Found <a href="#httpresponsestatuscodes-400badrequest" id="httpresponsestatuscodes-400badrequest"></a>

The server can’t find the requested resource. No forwarding address. In browsers, the link’s broken or wrong. In APIs, the endpoint exists but the resource doesn’t. These are broken links. They can be temporary or permanent.

**Possible cause**

* Provided object is not found

**Remediation**

* Check if an object is available with the get request.

#### Example 1.1. A rule is not found <a href="#httpresponsestatuscodes-example1.1.commanderrorissue" id="httpresponsestatuscodes-example1.1.commanderrorissue"></a>

For example, the following has an error in the "getrules" action with provided `rule` param:

```javascript
{
  "error": true,
  "is_critical": 0,
  "message": "Failed to get rules. Rule not found. Use 'getrules' to check available rules.",
  "command": "style_guide"
}
```

**Remediation**: Verify that the provided rule exists with the "getrules" action, not specifying `rule` id to get list of existing rules.

#### Example 1.2. A collection is not found <a href="#httpresponsestatuscodes-example1.2.unspecifiedcommand" id="httpresponsestatuscodes-example1.2.unspecifiedcommand"></a>

For example, the follwing has an error in the "deletecollection" action with provided `collection` is not found:

```javascript
{
  "error": true,
  "is_critical": 0,
  "message": "Failed to delete collection. Collection 'not-found-collection' for 'en_US' language(s) not found.",
  "command": "style_guide"
}
```

**Remediation:** Verify that the provided collection exists with the "getcollections" action.

### 409 Conflict <a href="#httpresponsestatuscodes-400badrequest" id="httpresponsestatuscodes-400badrequest"></a>

The server can’t process the request due to a conflict with the resource. It explains the issue so you can fix it and retry. Common with PUT requests when resources conflict.

**Possible cause**

* Provided object already exists.

**Remediation**

* Try again with a different name

#### Example 1.1. A collection already exists <a href="#httpresponsestatuscodes-example1.1.commanderrorissue" id="httpresponsestatuscodes-example1.1.commanderrorissue"></a>

For example, the following has an error in the "addcollection" action with provided ~~collection~~ param:

```javascript
{
  "error": true,
  "is_critical": 0,
  "message": "Failed to add collection. Collection 'not-unique-collection' for 'en_US' language(s) already exists (case-insensitive match)",
  "command": "style_guide"
}
```

**Remediation**: try again with a different name that is not exist.

### 500 Internal Server Error <a href="#httpresponsestatuscodes-500internalservererror" id="httpresponsestatuscodes-500internalservererror"></a>

The HTTP 500 Internal Server Error server error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

#### **Possible cause** <a href="#httpresponsestatuscodes-possiblecause" id="httpresponsestatuscodes-possiblecause"></a>

This error response is a generic "catch-all" response. Usually, this indicates the server cannot find a better 5xx error code to respond. This error usually denotes some situation when the server is not aware of how to handle it properly. It can be for example, any exceptions of the server logic including all hardware issues.

#### **Remediation** <a href="#httpresponsestatuscodes-remediation" id="httpresponsestatuscodes-remediation"></a>

If the error message doesn't give clear steps to fix the issue, contact our support team at <support@webspellchecker.net>.

### 503 Service Unavailable <a href="#httpresponsestatuscodes-503serviceunavailable" id="httpresponsestatuscodes-503serviceunavailable"></a>

The HTTP 503 Service Unavailable server error response code indicates that the server is not ready to handle the request.

#### **Possible cause** <a href="#httpresponsestatuscodes-possiblecause.1" id="httpresponsestatuscodes-possiblecause.1"></a>

You may encounter this error if the license is invalid.

#### **Remediation** <a href="#httpresponsestatuscodes-remediation.1" id="httpresponsestatuscodes-remediation.1"></a>

Verify the server license and update/request new license if it is necessary. If you are a holder of the self-hosted, Server version of WebSpellChecker, check if you have any errors in the logs which are located **AppServer/Logs** folder. Also contact our support team at <support@webspellchecker.net>.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wproofreader.com/api-reference/http-response-status-codes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
