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

# Kiflo REST API: Overview, Authentication, and URLs

Explore Kiflo's resource-oriented REST API: base URL, authentication, when to use the API versus the JS SDK, and links to the full reference.

The Kiflo REST API gives you programmatic control over your partner program data. It follows REST conventions with predictable, resource-oriented URLs, standard HTTP verbs, and JSON responses — so any HTTP client, backend language, or integration platform can talk to it without friction.

## Base URL

All API requests go to:

```
https://api.kiflo.com
```

For the interactive API reference with full endpoint documentation, request/response schemas, and live examples, visit [**https://docs-api.kiflo.com**](https://docs-api.kiflo.com).

## Authentication

Every request must include an **API Access Token** in the `Authorization` header:

```bash
Authorization: Bearer YOUR_API_ACCESS_TOKEN
```

Generate your token from **Account Settings → Integration** inside your Kiflo account. See the [Authentication guide](/developers/api/authentication.md) for step-by-step instructions, including how to revoke a token when it is no longer needed.

{% hint style="warning" %}
Your API Access Token is shown only once at generation time. Copy it immediately — Kiflo does not store it, and you will need to generate a new one if you lose it.
{% endhint %}

## API vs. JS SDK — when to use each <a href="#api-vs-js-sdk--when-to-use-each" id="api-vs-js-sdk--when-to-use-each"></a>

Kiflo offers two integration surfaces. Choose based on where your code runs:

| Scenario                                                                                | Recommended approach                                                                                                                          |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Tracking referrals and creating customers/leads/partners from **your website**          | [Kiflo JS SDK](/developers/js-sdk/get-started.md) — automatically reads the browser referral cookie                                           |
| Creating customers, leads, or transactions from your **backend or server-side code**    | REST API — pass the `trackingCode` you read from the browser via the JS SDK's [`getTrackingCode`](/developers/js-sdk/tracking-code.md) method |
| Automating data sync, building custom dashboards, or integrating with third-party tools | REST API                                                                                                                                      |
| Triggering partner rewards from a payment provider like Stripe                          | REST API or native integrations                                                                                                               |

{% hint style="info" %}
When you create a customer from your backend, use [`kiflo('getTrackingCode')`](/developers/js-sdk/tracking-code.md) in the browser to retrieve the referral cookie value, pass it to your server, and then include it in your API request so Kiflo can attribute the conversion to the correct partner.
{% endhint %}

## Full API reference

The complete reference — including all endpoints, parameters, and example responses — is available at [**https://docs-api.kiflo.com**](https://docs-api.kiflo.com).

{% hint style="success" %}
Use the interactive "Try it" panel in the API reference to test requests directly from your browser with your own Access Token.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs-vnext.kiflo.com/developers/api/api-overview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
