# Responses and Errors

Sendstack's API is RESTful and as such, uses conventional HTTP response codes to indicate the success or failure of requests.

NOTE: Fields marked with an asterisk (<mark style="color:red;">\*</mark>) in the request parameter are required.

| HTTP Status Code | Description                                                                                                                                              |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 200              | Request was successful and intended action was carried out.                                                                                              |
| 201              | A resource has successfully been created.                                                                                                                |
| 400              | A validation or client side error occurred and the request was not fulfilled.                                                                            |
| 401              | The request was not authorized. This can be triggered by passing an app\_id or app\_secret in the request headers or the lack of one.                    |
| 404              | Request could not be fulfilled as the request resource does not exist.                                                                                   |
| 5xx              | Request could not be fulfilled due to an error on Sendstack's end. This shouldn't happen so please report as soon as you encounter any instance of this. |

Sample success response

```json
// Successful Reponse - 200 OK
{
    "status": true,
    "message": "Partners fetched successfully",
    "data": {
        "partners": [
            {
                "type": "deliveryCompany"
            }
        ],
        "page": 1,
        "totalPages": 1,
        "totalCount": 1
    }
}

```

Sample Error Response

```json
// Error Reponse - 401 unauthorized
{
    "status": false,
    "message": "Invalid app_id or app_secret"
}

```


---

# 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.sendstackhq.com/the-basics/responses-and-errors.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.
