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

# Set App Data

> Store a JSON value under a key for your app

Creates or replaces one record of your app's key/value storage. Use it for
small app state — per-store settings, OAuth state, idempotency markers —
when you don't want to run your own database.

> [!NOTE]
>
> App data is authenticated with your app's **client credentials**, not a
> store's access token — so your app can read what it stored (for example a
> store's access token) before it has a token to use:
>
> ```
> Authorization: Basic base64(<client_id>:<client_secret>)
> ```
>
> Records are private to your app. `storeId` is a partition you choose: pass
> the store's id to keep a record per store, or omit it for app-wide records.

## Request

```bash theme={null}
curl -X POST "https://api.launchmystore.io/api/v1/app-data" \
  -H "Authorization: Basic $(printf '%s:%s' "$CLIENT_ID" "$CLIENT_SECRET" | base64)" \
  -H "Content-Type: application/json" \
  -d '{
    "storeId": "ef10744c-5c4a-4f47-85fc-062ba44afb5f",
    "key": "settings",
    "value": { "threshold": 50, "enabled": true }
  }'
```

## Body Parameters

**key** `string` *required*

The record's key, up to 512 characters. Writing an existing key (in the
same `storeId` partition) replaces its value.

**value** `any` *required*

Any JSON value, up to 512 KB. To remove a record, use
[Delete App Data](https://docs.launchmystore.io/api-reference/app-data/delete.md).

**storeId** `string`

The store the record belongs to. Omit for an app-wide record.

**ttlSeconds** `integer`

Expire the record after this many seconds. Expired records are no longer
returned; without `ttlSeconds` the record never expires.

## Response

The record under `data.record`.

**key** `string`

The record's key

**storeId** `string`

The store partition, or `null` for an app-wide record

**value** `any`

The stored JSON value

**expiresAt** `string`

When the record expires (ISO 8601), or `null`

**updatedAt** `string`

Last write (ISO 8601)

```json theme={null}
{
  "status": 200,
  "state": "success",
  "message": null,
  "data": {
    "record": {
      "key": "settings",
      "storeId": "ef10744c-5c4a-4f47-85fc-062ba44afb5f",
      "value": { "threshold": 50, "enabled": true },
      "expiresAt": null,
      "updatedAt": "2026-09-27T10:00:00.000Z"
    }
  }
}
```

## Errors

| Status | Description |
| - | - |
| `400` | `key` or `value` missing, or `key` longer than 512 characters |
| `413` | `value` larger than 512 KB |
| `401` | Missing, malformed or wrong client credentials |


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