# API reference

## Getting started

The Loop API lets you access Loop's functionality.&#x20;

## Authentication

To start using the API, you first need to get your API token. Get it from your Loop web settings, click the **API keys** tab, then the [**Create a new token**](https://docs.intheloop.io/creating-api-tokens) link.

NOTE You need to be part of an workspace with a paid plan in order to generate API tokens.

You must transmit your user token as a `Bearer` token in the `Authorization` HTTP header.

```
POST /api/v1/report/export
Host: api.intheloop.io
Authorization: Bearer 720a62b5-1245-aa31-b111-11290f8079b8
```

## **Responses**

All API responses are formatted as [JSON](http://www.json.org/), including errors. Successful `POST` requests may return the [201](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) status code with no body.

## **Evaluating Responses**

You should infer the success of your requests from the returned HTTP status code. A successful request will return either a [200](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) or [201](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) status code.

## **Post Bodies**

You must explicitly send POST requests with `Content-Type: application/json`.

```
POST /v1/drafts
Host: api.intheloop.io
Authorization: Bearer 720a62b5-1245-aa31-b111-11290f8079b8
Content-Type: application/json

```


---

# Agent Instructions: 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:

```
GET https://docs.intheloop.io/api-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
