Pick the workspace for the agent being authorized
POST
/api/v1/oauth/workspace
const url = 'https://api.crossmart.io/api/v1/oauth/workspace';const options = { method: 'POST', headers: { cookie: 'better-auth.session_token=<better-auth.session_token>', 'Content-Type': 'application/json' }, body: '{"workspaceId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.crossmart.io/api/v1/oauth/workspace \ --header 'Content-Type: application/json' \ --cookie better-auth.session_token=<better-auth.session_token> \ --data '{ "workspaceId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Called by the web app before it continues the OAuth flow. The agent will only ever act in this workspace, within your role there.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
workspaceId
required
A workspace the signed-in user belongs to
string format: uuid
Example generated
{ "workspaceId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}