Confirm a workspace integration’s target

A workspace key reads one workspace’s ID, name, and organization ID. Use it to confirm which workspace an integration serves before it acts.

Create a workspace key

  1. Only the organization’s owner can authorize a workspace. The owner manages organizations and their workspaces in Profile and security.
  2. In Developer access, choose New application. Under Resource owner, choose the workspace, keep Read the name and organization of the authorized workspace selected, choose Create application, and confirm with a passkey.
  3. On the new application, choose Add key, then Create API key and Copy key.

Read the workspace

With the key in FOCUS_API_KEY, read the workspace:

Bash
printf 'Authorization: Bearer %s\n' "$FOCUS_API_KEY" |
  curl --silent --show-error --fail-with-body --header @- \
    'https://couldfocus.com/api/v1/workspace'
JSON
{"data":{"id":"d50b28ed-0939-4f24-b559-711001931c3a","name":"Methods","organizationId":"0d1ca340-b444-49e6-8bf7-c24dc3482ddc"}}

Store the returned IDs with the integration’s configuration and compare them on each start.

What can go wrong

When the organization gets a new owner or is deleted, the grant ends and its keys return 401. Transferring ownership back does not restore it, so the owner creates a new application. Workspace keys cannot read a library, and personal keys cannot read a workspace: both return 403 insufficient_scope.