User Preferences

The User Preferences endpoint stores per-user UI state — for example whether the panel's terminal is open and how tall it is, and mobile-app preferences. Use it to keep preferences in sync across devices or to read them from a third-party integration.

AUTH Authorization: Bearer {API_KEY} Create a token →

Namespaces #

Preferences are organised by namespace. Only two namespaces are accepted by the API:

  • console.* — preferences used by the web panel. The panel stores console.terminal.open (boolean, whether the terminal is open) and console.terminal.height (number, the terminal’s height in px).
  • mobile.* — preferences used by the Depfloy mobile app

Writes outside these namespaces are rejected with 422 Unprocessable Entity.

GET/api/v1/me/preferences

Read all preferences #

Returns every preference currently stored for the authenticated user, grouped by namespace.

GET /api/v1/me/preferences Request
cURL
curl https://app.depfloy.com/api/v1/me/preferences \
  -H "Authorization: Bearer {API_KEY}" \
  -H "Accept: application/json"
Response
{
  "preferences": {
    "console": {
      "terminal": {
        "open": false,
        "height": 320
      }
    },
    "mobile": {
      "notifications": {
        "push_enabled": true
      }
    }
  }
}

PATCH/api/v1/me/preferences

Update preferences #

Patch the current user’s preferences. The request body is deep-merged with the existing state — you only need to send the fields you want to change. Keys you don’t include are preserved.

To delete a key, set it to null in the patch.

Required attributes #

preferences object

An object keyed by namespace (console, mobile). Each namespace’s value is merged into the existing one.

Limits #

  • Total stored preferences size is capped at 16 KB. Requests that would exceed the cap are rejected with 422.
  • Last-write-wins: there’s no per-key locking. If two clients update the same key at nearly the same time, the later request wins.
PATCH /api/v1/me/preferences Request
cURL
curl -X PATCH https://app.depfloy.com/api/v1/me/preferences \
  -H "Authorization: Bearer {API_KEY}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "preferences": {
      "console": {
        "terminal": {
          "open": true
        }
      }
    }
  }'
Response
{
  "preferences": {
    "console": {
      "terminal": {
        "open": true,
        "height": 320
      }
    },
    "mobile": {
      "notifications": {
        "push_enabled": true
      }
    }
  }
}