# API Overview

The Kaana API allows you to integrate Kaana with other systems and build custom workflows.

## What is the API?

The API (Application Programming Interface) lets you:

* Access your Kaana data programmatically
* Create custom integrations
* Automate workflows
* Build custom dashboards
* Sync data with other systems

## Who Should Use the API?

The API is designed for:

* Developers building integrations
* Technical teams automating workflows
* Partners building on Kaana
* Power users with technical skills

## What You Can Do

### Read Data

Retrieve information from Kaana:

* List projects and their details
* Get task information
* Fetch contacts and organizations
* Access documents metadata
* Read activities and issues

### Create Data

Add new records to Kaana:

* Create projects
* Add tasks
* Create contacts
* Log activities
* Upload documents

### Update Data

Modify existing records:

* Update project details
* Change task status
* Edit contact information
* Modify issue priority

### Delete Data

Remove records (with appropriate permissions):

* Delete projects
* Remove tasks
* Delete contacts

## Getting Started

{% stepper %}
{% step %}

### Get API Access

First, you need API credentials:

* Go to **Settings** > **API Keys**
* Create a new API key
* Save the key securely
  {% endstep %}

{% step %}

### Authenticate

Include your API key in requests:

* Use Bearer token authentication
* Include it in the Authorization header
  {% endstep %}

{% step %}

### Make Requests

Call API endpoints:

* Use HTTPS for all requests
* Send JSON data
* Receive JSON responses
  {% endstep %}
  {% endstepper %}

## Base URL

All API requests use this base URL:

```
https://app.kaana.com/api
```

For sandbox/development:

```
https://sandbox.kaana.com/api
```

## Request Format

### HTTP Methods

| Method | Purpose              |
| ------ | -------------------- |
| GET    | Retrieve data        |
| POST   | Create new data      |
| PATCH  | Update existing data |
| DELETE | Remove data          |

### Headers

Required headers for all requests:

```
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
```

### Request Body

For POST and PATCH requests, send JSON:

```json
{
  "title": "New Project",
  "description": "Project description"
}
```

## Response Format

### Success Response

```json
{
  "data": {
    "id": 123,
    "title": "New Project"
  }
}
```

### Error Response

```json
{
  "error": "ValidationError",
  "message": "Title is required"
}
```

## Rate Limits

API requests are rate limited:

* 100 requests per minute (standard)
* 1000 requests per minute (enterprise)

If you exceed limits:

* You'll receive a 429 status code
* Wait and retry after the reset period

## API Versioning

The current API version is included in responses. Backward compatibility is maintained and deprecations are announced in advance.
