---
title: "Switch the signed-in session's current account"
method: POST
path: "/api/v1/me/account"
tags: ["Account"]
---

# Switch the signed-in session's current account

`POST /api/v1/me/account`

## Request

- Base URL: `https://api.uptimemonitoring.com`
- URL: `https://api.uptimemonitoring.com/api/v1/me/account`
- Auth: HTTP bearer

Session-only, but returns `422 {"error":"session_required"}` for a
non-session caller — deliberately NOT the `403` every other
session-only route in this file uses, per issue #325's acceptance
criteria. Re-validates `account_id` as a current, non-suspended
membership for the caller (`403 {"error":"forbidden"}` on either
failure), persists it as the user's new default, and moves the
session's own current account — both under one per-session mutex,
so two concurrent switches on the same token can't leave the
session and the durable default disagreeing. A session token that
vanishes (logout, expiry) between the start of the switch and the
session update returns `401`; the database write has already
landed and is not undone.

## Request body

- object
  - `account_id` integer, required

## Response `200`

Switched.

- object
  - `account_id` integer

## Other responses

- `400`: Invalid request.
- `401`: The session token vanished mid-switch.
- `403`: Target is not a current membership, or is suspended.
- `422`: Caller did not authenticate via a dashboard session.

---

[API](https://skmtc.dev/uptimemonitoring/apis/uptimemonitoring-com-api.md) · [All operations](https://skmtc.dev/uptimemonitoring/apis/uptimemonitoring-com-api/llms.txt) · [OpenAPI document](https://skmtc.dev/uptimemonitoring/apis/uptimemonitoring-com-api/revisions/ddcb2a8bc70f?raw)
