Docs
Workspaces

Register a workspace

Register a Google Workspace or Microsoft 365 tenant

Google: supply adminEmail, a super-admin mailbox the service account impersonates for Directory discovery. Microsoft: supply the tenantId and state returned by the admin-consent redirect. Registering only makes the tenant's mailboxes discoverable - nothing is connected until .../sync runs.

POST
/v2/workspaces/{workspaceId}/provider-workspaces

Path Parameters

workspaceIdnumber
providerstring
Value in"google" | "microsoft"
adminEmail?string

Required when provider=google. A Google Workspace super-admin mailbox the service account impersonates for Directory discovery.

tenantId?string

Required when provider=microsoft. Tenant id from the admin-consent redirect.

state?string

Required when provider=microsoft. Opaque state echoed back from the admin-consent redirect; binds the consent to the requesting caller. Obtain the consent URL from GET .../provider-workspaces/microsoft/consent-url.

Response Body

curl -X POST "https://lynx-api.trulyinbox.com/v2/workspaces/0/provider-workspaces" \  -H "Content-Type: application/json" \  -d '{    "adminEmail": "admin@acme.com",    "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"  }'
{
  "data": {
    "id": 0,
    "provider": "google",
    "adminEmail": "string",
    "tenantId": {},
    "status": "active",
    "lastSyncedAt": "2019-08-24T14:15:22Z",
    "domains": [
      {
        "domain": "string",
        "mailboxCount": 0
      }
    ],
    "createdAt": "2019-08-24T14:15:22Z"
  },
  "meta": {
    "request_id": "req_2f1c…",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "invalid_request",
    "message": "string",
    "details": {},
    "retry_after": 34
  },
  "meta": {
    "request_id": "req_2f1c…",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "invalid_request",
    "message": "string",
    "details": {},
    "retry_after": 34
  },
  "meta": {
    "request_id": "req_2f1c…",
    "timestamp": "2019-08-24T14:15:22Z"
  }
}