On this page

SDKs and APIs

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. logout is not on the MCP server.

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

Parameters

ParameterTypeRequiredNotes
refresh_tokenstringRequiredAny refresh token of the session. A missing one is refused (400). The SDKs send it for you and take no arguments.
Errors
  • ForbiddenError (403): the call came from a browser origin that is not in the project's allowed origins.
  • UpstreamError (502): the account service behind the gateway could not be reached, so the session could not be ended. Retry.
Show full response

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

{
  "ok": true
}
More details

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.

ConfigurationError is raised in the SDK when the client was built with an API key, which has no session to end.

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

See login and refresh-session. When and how to use sessions is in Authentication.

Every tool call works the same way: How every tool call works.