Skip to content

Dynamics 365 Connector

Connect Dynamics 365 with OAuth2 client credentials. Send providerConfigKey: "microsoft-oauth2-cc" (this is not the OAuth integration connect-session flow).

Base URL

BASE_URL = "https://api.fermi.dev/public/v1"

Authentication

Authorization: Bearer <service-actor-token>

Required Scopes: connectors:read, connectors:write, connectors:sync

Connect

POST /connect/integrations/connect-session

{
  "providerConfigKey": "microsoft-oauth2-cc",
  "credentials": {
    "type": "OAUTH2_CC",
    "client_id": "APPLICATION_CLIENT_ID",
    "client_secret": "APPLICATION_CLIENT_SECRET"
  },
  "connectionConfig": {
    "tenant_id": "AZURE_AD_TENANT_ID",
    "organization_url": "https://org.crm.dynamics.com",
    "oauth_scopes": "https://org.crm.dynamics.com/.default"
  },
  "metadata": {
    "provider": "dynamics-365",
    "connectionName": "Production Dynamics"
  }
}

tenantId is also accepted. Optional credentials.token and credentials.expires_at can seed an existing token.

curl --request POST \
  --url "${BASE_URL}/connect/integrations/connect-session" \
  --header "Authorization: Bearer <token>" \
  --header "Content-Type: application/json" \
  --data '{
    "providerConfigKey": "microsoft-oauth2-cc",
    "credentials": {
      "type": "OAUTH2_CC",
      "client_id": "APPLICATION_CLIENT_ID",
      "client_secret": "APPLICATION_CLIENT_SECRET"
    },
    "connectionConfig": {
      "tenant_id": "AZURE_AD_TENANT_ID",
      "organization_url": "https://org.crm.dynamics.com",
      "oauth_scopes": "https://org.crm.dynamics.com/.default"
    }
  }'

Response: { "success": true, "connectionId": "...", "connection": { ... } }

List connections

GET /connect/integrations/connections?providerConfigKey=microsoft-oauth2-cc

Sync

Dynamics metadata writes do not enqueue sync unless triggerSyncEnqueue is true.

POST /sync/enqueue

{
  "connectionId": "CONNECTION_ID",
  "providerKey": "microsoft-oauth2-cc"
}

Summary

Method Path
POST /connect/integrations/connect-session
GET /connect/integrations/connections?providerConfigKey=microsoft-oauth2-cc
POST /sync/enqueue

Next Steps