---
agentTools:
  projectIndex: https://kosmo.readme.io/llms.txt
---

# API Authentication

Requests to Kosmo API must be authenticated otherwise they will fail with `Unauthorized 401` error response.

[block:api-header]
{
  "title": "Obtain API Key"
}
[/block]

[block:callout]
{
  "type": "info",
  "title": "Getting your key",
  "body": "To get started, request an api key by sending an email to `developer@kosmo.delivery` along with your business phone number you want or have attached to your account"
}
[/block]

The  `api_key` will be used to bypass authentication to Kosmo API.

[block:api-header]
{
  "title": "Usage"
}
[/block]

To authenticate your requests, you must add the `Authorization` header with Bearer + your API key as the value.

[block:callout]
{
  "type": "danger",
  "title": "Security",
  "body": "Your secret key is extremely sensitive, be sure to safely store it and to never share it with anyone outside your tech team.\nIf you acknowledge a breach, contact us immediately to deprecate your former key and get a new one."
}
[/block]

Here is an example of a request to test your key:

[block:code]
{
  "codes": [
    {
      "code": "curl --location --request GET 'http://api.kosmo.delivery/users/org/all' \\\n--header 'Authorization: Bearer {api_key}'",
      "language": "curl",
      "name": "/users/profile"
    }
  ]
}
[/block]

The response should contain your organization team information.