Set the caller's workspace choice for an OAuth client
Records which workspace an OAuth client should use for the caller, replacing any previous choice for that client. Naturally idempotent: the row is upserted per caller and client. The caller must be a member of the target workspace, otherwise the request is denied. Send an `Idempotency-Key` header to make retries safe; a replay within the window returns the original response.
Authorization
apiKey Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X PUT "https://example.com/v1/me/oauth-client-workspace-preferences" \ -H "Content-Type: application/json" \ -d '{ "oauthClientId": "string", "workspaceId": "string" }'{ "data": { "oauthClientId": "string", "workspaceId": "string" }}{ "_tag": "ApiNotFound", "error": "not_found", "message": "That item does not exist, or this key cannot see it.", "status": 404}{ "_tag": "ApiNotFound", "error": "not_found", "message": "That item does not exist, or this key cannot see it.", "status": 404}Read the caller's workspace choice for an OAuth client
Returns the workspace the caller last selected for the given OAuth client, or null when they have never chosen one. Scoped to the authenticated caller's own preferences; one user's choice is never visible to another.
List the workspaces the caller belongs to
Returns every active workspace the authenticated user is a member of, each with the caller's role and effective permission set. Accepts a Clerk session or a `snoze_sk_` API key, and the result is derived from membership rows, so it never includes workspaces the caller cannot see.