Authentication

Kourier’s API requires API key authentication to authorize requests. This ensures that only authorized users can access the platform and perform actions.

Using Your API Key

Every request to the Kourier API must include your API key in the header. You can generate an API key from your Kourier dashboard.

Example Header

Authorization: Bearer YOUR_API_KEY

Replace YOUR_API_KEY with the API key you generated from the dashboard.

Example Request with Authentication

Here’s an example of how to authenticate a request to create a delivery:

POST https://api.kourier.com/v1/deliveries
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Example Response

{
  "delivery_id": "abc123",
  "status": "created",
  "estimated_delivery_time": "2024-09-14T15:00:00Z"
}

Handling Authentication Errors

If your API key is missing, invalid, or expired, you will receive an error response.

Example Error Response

{
  "error": "Unauthorized",
  "message": "API key is missing or invalid"
}

Make sure your API key is valid and included in the request header to avoid authentication errors.