curl --request GET \
--url https://app.hookie.ai/admin/api/workspace/google-domain \
--cookie hookie_session=const options = {method: 'GET', headers: {cookie: 'hookie_session='}};
fetch('https://app.hookie.ai/admin/api/workspace/google-domain', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/workspace/google-domain"
headers = {"cookie": "hookie_session="}
response = requests.get(url, headers=headers)
print(response.text){
"link": {
"domain": "<string>",
"default_role": "viewer",
"created_by": "<string>",
"created_by_email": "<string>",
"created_at": "2023-11-07T05:31:56Z"
},
"session": {
"google_workspace_domain": "<string>",
"can_link": true
},
"roles": [
"viewer"
]
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>",
"max_members": 123,
"members": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"account_id": "<string>",
"terms_version": "<string>",
"claim_required": true
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>",
"max_members": 123,
"members": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"account_id": "<string>",
"terms_version": "<string>",
"claim_required": true
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>",
"max_members": 123,
"members": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"account_id": "<string>",
"terms_version": "<string>",
"claim_required": true
}The workspace's Google Workspace domain link
Any member, an agent or API key included. Google Workspace teams (#326). A workspace can be linked to one Google Workspace domain, and a domain to one workspace. Anyone who then signs in to the console with Google using an account in that domain joins the workspace automatically with the link’s default_role, before Hookie would create an empty workspace for them, and, when it is their first workspace, it becomes their active one (someone already in other workspaces joins this one as well but is not moved: it appears in their workspace switcher). No WorkOS organization is created: the grouping is Hookie’s. Linking is first come, first served among the domain’s own Google accounts; a platform operator can unlink a domain or reassign it to another workspace, audited in both workspaces’ logs. The domain is Google’s hd claim, read once at sign-in from Google’s OpenID Connect userinfo endpoint with the Google access token WorkOS returns, and sealed into an HttpOnly cookie bound to that session. It is never taken from the email address: a personal Google account on a company address, an email-code sign-in and a GitHub sign-in never join, and gmail.com / googlemail.com can never be linked. A join respects the plan’s member limit (at the limit the person is not added, and GET /admin/api/me carries googleWorkspaceNotice, which names only their own domain, never the workspace or its headcount), never happens for a suspended or closing workspace, and never re-adds someone who left or was removed, including before this feature shipped (an invite still can). Joins are audited as member_joined_google_workspace, and on Team the subscription’s seat count follows. Requires the WorkOS environment’s Google provider to return OAuth tokens; without that no domain is ever verified, so nothing links and nobody joins.
curl --request GET \
--url https://app.hookie.ai/admin/api/workspace/google-domain \
--cookie hookie_session=const options = {method: 'GET', headers: {cookie: 'hookie_session='}};
fetch('https://app.hookie.ai/admin/api/workspace/google-domain', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/workspace/google-domain"
headers = {"cookie": "hookie_session="}
response = requests.get(url, headers=headers)
print(response.text){
"link": {
"domain": "<string>",
"default_role": "viewer",
"created_by": "<string>",
"created_by_email": "<string>",
"created_at": "2023-11-07T05:31:56Z"
},
"session": {
"google_workspace_domain": "<string>",
"can_link": true
},
"roles": [
"viewer"
]
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>",
"max_members": 123,
"members": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"account_id": "<string>",
"terms_version": "<string>",
"claim_required": true
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>",
"max_members": 123,
"members": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"account_id": "<string>",
"terms_version": "<string>",
"claim_required": true
}{
"error": "<string>",
"retry_after": 123,
"upgrade_url": "<string>",
"reason": "<string>",
"code": "agent_scope_insufficient",
"required_scope": "hookie:read",
"granted_scopes": [
"<string>"
],
"manage_url": "<string>",
"scheme": "<string>",
"max_members": 123,
"members": 123,
"customer_id": "<string>",
"customer_name": "<string>",
"account_id": "<string>",
"terms_version": "<string>",
"claim_required": true
}Authorizations
The console's sealed session cookie, set by WorkOS AuthKit. Mutating requests also require the X-Requested-With CSRF header.