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 <token>"

Example Response

json
{
  "success": true,
  "data": [
    {
      "id": "conn_abc123",
      "msTenantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "label": "Contoso Production",
      "connectedAt": "2026-02-01T09:00:00Z",
      "isPrimary": true
    },
    {
      "id": "conn_def456",
      "msTenantId": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
      "label": "Contoso Staging",
      "connectedAt": "2026-03-15T14:30:00Z",
      "isPrimary": false
    }
  ]
}

Response Fields

FieldTypeDescription
idstringConnection identifier
msTenantIdstringMicrosoft Entra tenant ID (GUID)
labelstringDisplay label assigned during connection
connectedAtstringISO 8601 timestamp when the tenant was connected
isPrimarybooleanWhether this is the currently active tenant

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/conn_def456/activate \
  -H "Authorization: Bearer <token>"

Example Response

json
{
  "success": true,
  "data": {
    "id": "conn_def456",
    "msTenantId": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
    "label": "Contoso Staging",
    "connectedAt": "2026-03-15T14:30:00Z",
    "isPrimary": true
  }
}

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

Example Request

bash
curl -X DELETE https://api.aether365.io/tenants/me/connections/conn_def456 \
  -H "Authorization: Bearer <token>"

Example Response

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

Errors

CodeHTTPDescription
CONNECTION_NOT_FOUND404No connection with this ID exists for this tenant
CANNOT_REMOVE_LAST_CONNECTION409Cannot remove the only remaining connection
Was this page helpful?