Migrate external authentication connection
POST/marketplace/external-auth/migration
Migrates an external authentication connection credentials (basic or oauth2) for a specific app and location. This endpoint validates the app configuration, stores credentials safely in CRM's native encrypted storage. With this the lifecycle of the token is managed by CRM.
Request
API Version
v3- application/json
- Body
- Example (auto)
Bodyrequired
Type of authentication - basic or oauth2
oauth2basicLocation ID
App ID
App Version ID
Connection identifier
API Key (supported when type is basic)
Basic auth credentials as key/value pairs (supported when type is basic). Keys are validated against the app version externalAuthConfig.fields.
Access token (required when type is oauth2)
Refresh token (required when type is oauth2)
Access token expiry time in milliseconds (optional for oauth2)
Timestamp for access token expiry (optional for oauth2)
OAuth2 scopes (optional for oauth2)
Display name for the connection (optional, defaults to accountId)
Whether this is the default connection for the location (optional, defaults to false)
{
"type": "oauth2",
"locationId": "location_12345",
"appId": "507f1f77bcf86cd799439011",
"appVersionId": "507f1f77bcf86cd799439012",
"accountId": "my-connection-identifier",
"apiKey": "sk_test_1234567890",
"basicCredentials": {
"password": "p@ssw0rd"
},
"accessToken": "ya29.a0AfH6SMBx...",
"refreshToken": "1//0gHq5F...",
"expiryIn": 3600000,
"expiryAt": 1735689600000,
"scopes": [
"contacts.readonly",
"contacts.write"
],
"displayName": "My Connection Display Name",
"isDefault": false
}
Connection migrated successfully
- application/json
- Schema
- Example (auto)
Schema
Indicates if the migration was successful
Unique identifier for the migrated connection
Message describing the result
{
"success": true,
"identifier": "migration_12345",
"message": "Connection migrated successfully"
}