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

# Apps API: Create, Read, Delete, Pause and Logs

> Create, list, read, update, pause and delete AuthForge apps from your backend or CI, and read or follow an app's authentication log, with the Developer API.

Everything about an app except its licenses, variables, webhooks and access lists, which have their own pages. Rotating an app's secret or signing key, the customer portal policy and Commerce stay in the dashboard.

## List apps

**GET /v1/apps** `endpoint`

Your apps, sorted by name. Deleted apps are left out. Scope `read:apps`.

```json theme={null}
{
  "apps": [
    { "appId": "4f6c2a1e-8d3b-4c5a-9e7f-0a1b2c3d4e5f", "name": "My Desktop App", "paused": false, "createdAt": "2026-03-14T09:21:00.000Z" }
  ]
}
```

`createdAt` can be `null` on an old app.

## Create an app

**POST /v1/apps** `endpoint`

Creates an app the way the dashboard does: a new app secret and an Ed25519 signing key. Scope `write:apps`. Free. At most **20 apps an hour** per account through the API.

### Request body

| Field | Type | Required | Description |
| - | - | - | - |
| `name` | string | Yes | The app's name, at most 128 bytes |
| `settings` | object | No | A free-form settings object stored with the app, at most 4 KB as JSON |

Any other field is a `400`.

```bash theme={null}
curl -X POST https://api.authforge.cc/v1/apps \
  -H "Authorization: Bearer af_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "name": "My Desktop App" }'
```

### Response (201)

```json theme={null}
{
  "appId": "4f6c2a1e-8d3b-4c5a-9e7f-0a1b2c3d4e5f",
  "name": "My Desktop App",
  "paused": false,
  "createdAt": "2026-12-03T09:00:00.000Z",
  "signingKeyId": "b2d4c6e8-...",
  "signingPublicKey": "q83vEjRWeJq83vEjRWeJq83vEjRWeJq83vEjRWeJq80=",
  "appSecret": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "shownOnce": true
}
```

> [!WARNING]
>
> `appSecret` is in this response only. AuthForge keeps a hash of it. Store it now; if it is lost, rotate it in the dashboard.

`signingPublicKey` is the raw 32-byte Ed25519 public key in base64, the value the SDKs take to verify signed responses.

## Get an app

**GET /v1/apps/:appId** `endpoint`

One app's settings. Never its secret or private key. Scope `read:apps`.

```json theme={null}
{
  "appId": "4f6c2a1e-8d3b-4c5a-9e7f-0a1b2c3d4e5f",
  "name": "My Desktop App",
  "paused": false,
  "pausedAt": null,
  "pauseReason": null,
  "createdAt": "2026-12-03T09:00:00.000Z",
  "signingKeyId": "b2d4c6e8-...",
  "signingPublicKey": "q83vEjRWeJq83vEjRWeJq83vEjRWeJq83vEjRWeJq80=",
  "maxCreditsPerHour": null,
  "maxCreditsPerDay": 5000,
  "offlineSelfServe": { "enabled": false },
  "hasWebhooks": true,
  "isDemoApp": false
}
```

## Update an app

**PUT /v1/apps/:appId** `endpoint`

Set or clear the credit burn caps and turn [self-serve offline activation](https://docs.authforge.cc/api/licenses.md#turn-it-on-for-an-app) on or off. Scope `write:apps`.

```json theme={null}
{ "maxCreditsPerHour": 500, "maxCreditsPerDay": null, "offlineSelfServe": { "enabled": true } }
```

At least one field. `null` removes a cap. Responds `{ "ok": true }`. The name cannot be changed through the API.

## Delete an app

**DELETE /v1/apps/:appId** `endpoint`

Deletes the app, as the dashboard does. Needs **both** `write:apps` and `admin:apps`.

Validations for the app stop at once (`invalid_app`), and the app disappears from every list and route. Deleting an app that is already deleted answers `{ "ok": true, "alreadyDeleted": true }`.

```json theme={null}
{ "ok": true }
```

| Status | `error` | When |
| - | - | - |
| 403 | `insufficient_scope` | The key lacks `write:apps` or `admin:apps` |
| 403 | `forbidden` | Not your app |
| 409 | `demo_app_protected` | The app is the public AuthForge demo app |

## Pause and unpause

**POST /v1/apps/:appId/pause** `endpoint`

Takes the app offline: validations and check-ins answer `app_disabled` for every customer. Optional body `{ "reason": "..." }` (up to 500 characters). Scope `admin:apps`. Responds `{ "ok": true, "pausedAt": "..." }`.

**POST /v1/apps/:appId/unpause** `endpoint`

Brings it back. Scope `admin:apps`. Responds `{ "ok": true }`.

## Usage

**GET /v1/apps/:appId/stats?period=24h|7d** `endpoint`

Authentication totals: `totalAuths`, `successCount`, `failureCount`, `uniqueHwids`. `period` defaults to `24h`. Scope `read:apps`.

**GET /v1/apps/:appId/problems?since=ISO** `endpoint`

Failed authentications grouped by license and result, newest first, at most 20 groups. `since` defaults to 24 hours ago. Scope `read:logs`.

## Auth logs

**GET /v1/apps/:appId/logs** `endpoint`

Search the log, newest first. Scope `read:logs`. Query: `startDate` and `endDate` (ISO 8601, default the last 24 hours), `result`, `licenseKey`, `ip`, `hwid`, `limit` (up to 500, default 100) and `cursor`. A filtered page can hold fewer than `limit` rows; keep paging until `cursor` is `null`.

Your app ID ships inside your app, so anyone can send requests that name it. So that such requests cannot fill your log, a request turned away by the per-IP limit and a check-in whose session token does not verify write no row, and a wrong app secret writes at most 10 `invalid_app` rows a minute per app, with the detail `app secret did not match`.

### Follow the log

**GET /v1/apps/:appId/logs/tail** `endpoint`

The log **oldest first**, for a client that polls, such as a terminal tail. Scope `read:logs`.

| Query | Description |
| - | - |
| `since` | The `cursor` from the previous response, or any ISO 8601 time. Rows after it are returned. Leave it out to get the newest rows. |
| `limit` | 1 to 500, default 100 |

```bash theme={null}
curl "https://api.authforge.cc/v1/apps/YOUR_APP_ID/logs/tail?since=2026-12-03T09:00:00.000Z" \
  -H "Authorization: Bearer af_live_your_key"
```

```json theme={null}
{
  "logs": [
    {
      "timestamp": "2026-12-03T09:00:04.512Z",
      "licenseKey": "A3K9-BFWX-7NP2-QHDT",
      "hwid": "hw-9c2f",
      "ip": "203.0.113.9",
      "result": "success",
      "source": "validate",
      "detail": null,
      "sdk": "node/2.1.0",
      "count": 1
    }
  ],
  "cursor": "2026-12-03T09:00:04.512Z",
  "hasMore": false,
  "settledUntil": "2026-12-03T09:00:10.000Z"
}
```

* Send `cursor` as `since` next time. It stays the same when nothing new came in.
* `hasMore: true` means a full page came back and more may be waiting: ask again at once. Otherwise wait a few seconds; every 3 to 5 seconds is plenty and well inside the rate limit.
* Reads stop two seconds behind the clock (`settledUntil`). A log row is stamped when its request starts and written just after, so the newest two seconds are left for the next poll and no row is skipped.
* `count` is how many events the row stands for. Successful check-ins are logged once per credit they cost, so such a row stands for several.
* Each call reads only the rows it returns, with no filter. Filter on your side, or search with `GET /v1/apps/:appId/logs`.
* Rows are kept for 90 days.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.