Skip to content

Open the app window's web session

POST
/auth/window-session
Code sample: Shell / cURL
curl --request POST \
--url https://example.com/api/v1/auth/window-session \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "challenge": "example", "redirectTo": "example" }'

Issues a one-time code (60 seconds) that opens a normal web session for the window of the desktop, iPhone or Android app. Only the full REST sign-in of one of those apps may call it, held by a team member, or by a client when the organization has Client apps on and its client portal verified on its own domain; every other caller (a session cookie, an API token, another app, an MCP client) is refused with 403. A client’s sign-in reaches no other /api/v1 route: each answers 403. The code is bound to this sign-in and to challenge: the app sets the verifier as a cookie in its own window for the host of url (host-only, HttpOnly, Path=/, raw value), then opens url: the server’s own address for a team member, the client portal domain for a client. The cookie name depends on the scheme of the server’s address: __Host-window_session_verifier (also Secure) on https, window_session_verifier on http, and the server reads only that one. Without the cookie the link does nothing. The session it opens ends when this sign-in is revoked, signing out of the window revokes this sign-in, and the session cannot create an API token, passkey, push subscription or other credential: those need the browser.

Media typeapplication/json
object
challenge
required

base64url(SHA-256(verifier)) without padding, 43 characters. The app keeps the verifier, 43 to 128 characters of A-Z a-z 0-9 - . _ ~, and sets it as the verifier cookie in its own window before opening the link: __Host-window_session_verifier on https, window_session_verifier on http (localhost).

string
/^[A-Za-z0-9_-]{43}$/
redirectTo

Path the window lands on once it has the session. Anything that is not a path on the same host (not starting with a single /) becomes /. For a client, a portal path as Chelsea writes it (/portal/...) opens on the portal domain; any other path opens the portal’s home.

string
<= 2048 characters

Example generated

{
"challenge": "example",
"redirectTo": "example"
}

Code issued.

Media typeapplication/json
object
data
required

One-time code that opens the app window’s web session.

object
code
required

One-time code. The window opens url; on a server that sends no url, /auth/handoff?token=<code> on the same host.

string
expiresAt
required

When the code stops working.

string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
url

The full /auth/handoff link that redeems the code. A team member’s opens on the server’s own address; a client’s on the organization’s client portal domain. The app sets the verifier cookie for the host of this URL before opening it. Absent on an older server.

string format: uri

Example generated

{
"data": {
"code": "example",
"expiresAt": "2026-04-15T12:00:00Z",
"url": "https://example.com"
}
}

Validation error. Parse failures include field paths and expectations.

Media typeapplication/json

Validation error with safe field paths and expected values; submitted values are never returned.

object
error
required
object
code
required

Stable machine-readable error code.

string
issues
Array<object>
object
expected
required
string
message
required
string
path
required
Array<string | number>
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.