---
title: "API reference"
description: "Sign in, upload, publish, and roll back apps with the iqobi API."
image: "https://iqobi.com/share/iqobi.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://iqobi.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference

The API is at `https://api.iqobi.com`. The [OpenAPI document](https://api.iqobi.com/v1/openapi.json) has every route, field, and status. The [skill](https://iqobi.com/skill.md) walks through each call with curl.

## Sign in

iqobi uses the OAuth 2.0 device flow. You need no API key.

1. Ask for a sign-in link.
2. Show the person `verification_uri_complete`. They sign in and approve.
3. Ask for the token every `interval` seconds until they approve.

```sh
curl -X POST https://api.iqobi.com/oauth/device
curl -X POST https://api.iqobi.com/oauth/token -d device_code="$DEVICE_CODE"
```

Send `Authorization: Bearer $TOKEN` on every call. An access token lasts 15 minutes. To get a new one, send `refresh_token` to `/oauth/token` and save the new refresh token it returns.

## Routes

| Route | Scope | Does |
| --- | --- | --- |
| `GET /v1/me` | `account:read` | Returns your account. |
| `GET /v1/apps` | `library:read` | Lists your apps. |
| `POST /v1/apps` | `apps:create` or `studio:write` | Uploads files as a new app, or a new version with `app_id`. Returns a job. |
| `GET /v1/jobs/{job_id}` | `studio:read`, `apps:create`, or `studio:write` | Returns the job's state and, when done, the version. |
| `GET /v1/apps/{app_id}` | `library:read` | Returns one app. |
| `GET /v1/apps/{app_id}/versions` | `studio:read` | Lists the app's versions. |
| `POST /v1/apps/{app_id}/previews` | `studio:read` | Returns a preview link that works for 3 minutes. |
| `POST /v1/apps/{app_id}/publish` | `apps:publish` | Returns a review. Send its `review_token` back to publish. |
| `POST /v1/apps/{app_id}/rollback` | `apps:publish` | Makes an earlier published version live again. |

## Files

- Upload one entry file, `app.js` or `app.ts`. Add `app.css` for styles.
- Add other modules, stylesheets, and text files in folders, and refer to them with relative paths.
- Upload at most 400 files, 256 KiB each, and 10 MiB in all.
- Do not upload media files, `node_modules`, or secrets.

## Errors

An error answer has this shape:

```json
{"error": {"code": "not_found", "message": "…", "retryable": false, "request_id": "…"}}
```

When an answer has a `Retry-After` header, wait that many seconds and send the request again. The skill lists every error code and what to do.
