Skip to content

Connections API

Maintained by: Aether365 Team Audience: Developers Scope: Connection API endpoints - managing Microsoft 365 tenant connections

Connections represent linked Microsoft 365 tenants. Each connection corresponds to a Microsoft tenant (identified by its msTenantId) that has been granted admin consent.

List Connections

Returns all Microsoft 365 tenants connected to the authenticated account.

GET /tenants/me/connections

Example Request

bash
curl https://api.aether365.io/tenants/me/connections \
  -H "Authorization: Bearer ak_live_..."

Example Response

json
{
  "success": true,
  "data": [
    {
      "id": "0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
      "msTenantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "label": "Contoso Production",
      "connectedAt": "2026-02-01T09:00:00+00:00",
      "isPrimary": true,
      "displayName": "Contoso Ltd",
      "primaryDomain": "contoso.com",
      "defaultDomain": "contoso.onmicrosoft.com",
      "country": "Ireland",
      "countryLetterCode": "IE",
      "tenantType": "AAD",
      "verifiedDomains": ["contoso.com", "contoso.onmicrosoft.com"],
      "technicalNotificationMails": ["it@contoso.com"],
      "orgCreatedAt": "2019-05-01T00:00:00+00:00",
      "orgMetadata": {},
      "orgFetchedAt": "2026-02-01T09:00:05+00:00",
      "consentLevel": "read",
      "remediationEnabled": false,
      "needsReconsent": false,
      "writeConsentedAt": null,
      "mode": "manual"
    }
  ]
}

Response Fields

FieldTypeDescription
idstringConnection identifier (UUID)
msTenantIdstringMicrosoft Entra tenant ID (GUID)
labelstring or nullDisplay label assigned during connection
connectedAtstringISO 8601 timestamp when the tenant was connected
isPrimarybooleanWhether this is the currently active tenant
displayName / primaryDomain / defaultDomainstring or nullOrganization metadata read from Microsoft Graph
country / countryLetterCode / tenantTypestring or nullOrganization metadata
verifiedDomains / technicalNotificationMailsarray or nullOrganization metadata
orgCreatedAt / orgFetchedAtstring or nullOrganization creation time and when metadata was last fetched
orgMetadataobject or nullAdditional raw organization metadata
consentLevelstringread or write - level of admin consent granted
remediationEnabledbooleanWhether AI Pilot remediation is enabled for this connection
needsReconsentbooleanWhether a Graph write was rejected and consent must be re-granted
writeConsentedAtstring or nullWhen write consent was granted
modestringmanual or ai_pilot

Activate a Connection

Sets a connected tenant as the active tenant. Dashboard views and API calls without an explicit tenant filter operate on the active tenant.

POST /tenants/me/connections/{connectionId}/activate

Path Parameters

ParameterTypeDescription
connectionIdstringThe connection ID to activate

Example Request

bash
curl -X POST https://api.aether365.io/tenants/me/connections/9f8e7d6c-5b4a-3c2d-1e0f-a9b8c7d6e5f4/activate \
  -H "Authorization: Bearer ak_live_..."

Example Response

Returns the updated list of all connections (each with the base fields only):

json
{
  "success": true,
  "data": [
    {
      "id": "0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
      "msTenantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "label": "Contoso Production",
      "connectedAt": "2026-02-01T09:00:00+00:00",
      "isPrimary": false
    },
    {
      "id": "9f8e7d6c-5b4a-3c2d-1e0f-a9b8c7d6e5f4",
      "msTenantId": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
      "label": "Contoso Staging",
      "connectedAt": "2026-03-15T14:30:00+00:00",
      "isPrimary": true
    }
  ]
}

Rename a Connection

Updates the display label of a connection. Send { "label": "New name" }; an empty label clears it.

PATCH /tenants/me/connections/{connectionId}

Returns the connection id, msTenantId, updated label and connectedAt. An unknown connection returns 404 NOT_FOUND.


Remove a Connection

Disconnects a Microsoft 365 tenant. Stops future scans for this tenant. Existing scan data is retained according to the retention policy.

DELETE /tenants/me/connections/{connectionId}

WARNING

This action cannot be undone. Reconnecting the tenant requires going through the admin consent flow again.

Path Parameters

ParameterTypeDescription
connectionIdstringThe connection ID to remove

If the removed connection was the primary one, another remaining connection becomes primary automatically. Removing the last connection is allowed - it leaves the account with no primary Microsoft tenant and tears down the automatic scan schedules.

Example Request

bash
curl -X DELETE https://api.aether365.io/tenants/me/connections/9f8e7d6c-5b4a-3c2d-1e0f-a9b8c7d6e5f4 \
  -H "Authorization: Bearer ak_live_..."

Example Response

json
{
  "success": true,
  "data": null
}

Errors

CodeHTTPDescription
NOT_FOUND404No connection with this ID exists for this tenant
VALIDATION_ERROR400connectionId path parameter missing
Was this page helpful?