# App model

An app that signs people in with hematite, as its maker sees it: its client id, its type, the addresses it may send people back to, and how many people have it connected.

## Fields

| Field | Type | Present | Notes |
|---|---|---|---|
| `clientId` | `string` |  | The `client_id` it sends, made by hematite when it was registered. |
| `name` | `string` |  | What the consent page and people's connected apps call it. |
| `type` | `enum` |  | Public: in a browser or on a phone, proving itself with PKCE alone. confidential: on a server, with PKCE and its secret. One of `public`, `confidential`. |
| `redirectUris` | `string[]` |  | The exact addresses it may send people back to; a request's redirect_uri must be one of them, character for character. |
| `userCount` | `number` |  | How many people have it connected now, each counted once however often they allowed it. |
| `createdAt` | `date-time` |  |  |
| `updatedAt` | `date-time` |  |  |

## Returned by

The endpoints whose `data` holds an App as it is, and where.

- [`PATCH /apps/:clientId`](https://hematite.gg/docs/developers/reference/apps#patch-apps-clientid), in `data`
- [`GET /users/:userId/apps`](https://hematite.gg/docs/developers/reference/users#get-users-userid-apps), in `data[]`

## Extended by

The endpoints that return an App with fields of their own, and the fields they add.

- [`POST /apps`](https://hematite.gg/docs/developers/reference/apps#post-apps) adds `clientSecret`

## Example

```json
{
  "clientId": "string",
  "name": "Ranked",
  "type": "public",
  "redirectUris": [
    "string"
  ],
  "userCount": 0,
  "createdAt": "2026-11-10T18:24:00.000Z",
  "updatedAt": "2026-11-10T18:24:00.000Z"
}
```
