On this page

logout

End an SDK session. Its refresh token stops working at once, and its access token is refused from its next call. Call it when the user signs out of your app. Logging out an unknown or already-ended refresh token also succeeds, so a retried logout never fails.

A session can also end without a logout: when the user resets or changes their password, is suspended or removed, or ends the session from Signed-in apps in the console, and when a project admin revokes it under Developer access → SDK sessions. Your app sees this as an AuthError on its next call and should send the user back to its login page.

What it is called on each surface

logout is not on the Wexa MCP server, because it belongs to an SDK session and MCP clients sign in through OAuth.

SurfaceName
REST APIPOST /v1/auth/logout
TypeScript SDKfabric.auth.logout()
Python SDKfabric.auth.logout()

Arguments

ArgumentTypeRequiredNotes
refresh_tokenstringRequiredAny refresh token of the session. The SDKs send it for you and take no arguments.

What it returns

A real response, captured from a live call to logout:

{
  "ok": true
}

Calling it

curl -sS https://fabric.wexa.ai/v1/auth/logout \
  -H "content-type: application/json" \
  -d '{"refresh_token": "'"$FABRIC_REFRESH_TOKEN"'"}'

Errors

ErrorStatusRaised when
ForbiddenError403The call came from a browser origin that is not in the project's allowed origins.
ValidationError400No refresh token was sent.
UpstreamError502The account service behind the gateway could not be reached, so the session could not be ended. Retry.
ConfigurationError—Raised in the SDK: the client was built with an API key, which has no session to end.

Governance

Not a governed tool: it runs before any tool call. The logout is written to the audit log.

See also

login, refresh-session, and the tool index.