> For the complete documentation index, see [llms.txt](https://docs.sarafa.live/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sarafa.live/api-reference/setup.md).

# Setup

## Authentication

To interact with the Sarafa API, you will utilize API keys for authentication.&#x20;

* **Format:** Secret keys follow the UUID version 4 (Universally Unique Identifier) format.

  ```
  xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
  ```

  Example: `a1b2c3d4-e5f6-4789-9012-34567890abcd`

## Base URL

All API requests to Sarafa should be directed to the following base URLs for the production environment:

* **<https://api.sarafa.live/v2>**
* **<https://api.sarafa.ss/v2>**

## API Usage

You will need to include your API key in the header of every API request for authentication. The key should be passed in a header with the name `api-key`.

```bash
curl -X GET \
     https://api.sarafa.live/v2/wallets \
     -H 'api-key: your_secret_key_here'
```

All responses from the Sarafa API will be formatted in JSON.Example JSON Response (Success - HTTP 200 OK):

```json
{
  "status": "success",
  "data": {
        "account_number": "9020260000001",
        "wallets": [
            {
                "balance": 1009.19,
                "currency": "USD",
                "meta": null
            }
        ]
    },
}
```

Error Handling The Sarafa API uses standard HTTP status codes to indicate the outcome of your requests.

200 OK: This status code indicates that your request was successful and you are properly authenticated with a valid API key. The response body will contain the requested data in JSON format (as shown in the example above).

401 Unauthorized: This status code indicates that your API key is invalid, missing, or has expired. Ensure you are including a valid API key in the api-key header of your request.When integrating with the Sarafa API, it’s crucial to handle these HTTP status codes appropriately to ensure your application functions correctly and provides informative feedback.&#x20;

Always store your secret keys securely.
