Migrate external authentication connection
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.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your access token.
marketplace-external-auth-migration. writeOAuthSub-Account TokenRequest
Headers
API Version
v3v3Body
Type of authentication - basic or oauth2
oauth2basicoauth2Location ID
location_12345App ID
507f1f77bcf86cd799439011App Version ID
507f1f77bcf86cd799439012Connection identifier
my-connection-identifierAPI Key (supported when type is basic)
sk_test_1234567890Basic auth credentials as key/value pairs (supported when type is basic). Keys are validated against the app version externalAuthConfig.fields.
{
"email": "[email protected]",
"password": "p@ssw0rd"
}
Access token (required when type is oauth2)
ya29.a0AfH6SMBx...Refresh token. Omit only when the provider issues long-lived, non-refreshable tokens (e.g. TikTok Marketing API, ClickUp) and therefore never returns one. Callers are responsible for supplying it whenever their app has a refresh endpoint configured: the migration stores exactly what it is given and replaces any previously stored secret, so omitting a refresh token the connection needs will leave it unable to refresh once the access token expires. Must be a non-empty string when supplied — null is rejected.
1//0gHq5F...Access token expiry time in milliseconds (optional for oauth2)
3600000Timestamp for access token expiry (optional for oauth2)
1735689600000OAuth2 scopes (optional for oauth2)
["contacts.readonly","contacts.write"]Display name for the connection (optional, defaults to accountId)
My Connection Display NameSource of the account identity metadata
providermanualmanualWhether this is the default connection for the location (optional, defaults to false)
falseResponse
Connection migrated successfully
Indicates if the migration was successful
trueUnique identifier for the migrated connection
migration_12345Message describing the result
Connection migrated successfully