Remove identity providers

Deletes the specified identity provider configurations. An enabled identity provider cannot be deleted, so you must disable it first.

Each code is deleted in its own transaction, so the batch is not atomic. This means some codes may be deleted while others remain.

Deletion removes only the configuration record. An identity provider type installed as an app remains and continues to appear in the Get Identity Provider Factories results.

Required Permissions

Requires the ADMIN role or higher. The permission check is performed per code, and a code that fails to delete because of insufficient permission is also reported in the failures list rather than as an HTTP error. If the calling account lacks permission, every code fails, but the HTTP status code is still 200.

HTTP Request

DELETE /api/sonar/id-providers
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     -X DELETE \
     "https://HOSTNAME/api/sonar/id-providers?codes=saml,oidc"
Request Parameters
KeyRequiredTypeDescriptionNotes
codesYesString listList of identity provider codesComma (,) separated list of codes

Success Response

{
  "failures": []
}
  • failures (Array): List of items that could not be deleted. Empty array when every code succeeds
    • code (String): Identity provider code that could not be deleted
    • error (String): Failure reason message

The response does not include the list of codes that succeeded.

Some or all codes fail to delete

A per-code deletion failure is not an HTTP error. Whether some codes fail or every code fails, the response is HTTP status code 200, and the reasons are reported in the failures array.

{
  "failures": [
    {
      "code": "saml",
      "error": "provider is running"
    }
  ]
}

The following strings can appear in error:

StringMeaning
provider not found: <code>No identity provider is installed for that code
provider is runningThe identity provider is enabled and cannot be deleted
no-permissionThe calling account lacks permission to delete
cannot remove config, provider=<code>The deletion transaction failed

Error Responses

The only case that is returned as an HTTP error is a missing codes.

codes is missing

HTTP status code 400

{
  "error_code": "null-argument",
  "error_msg": "codes should be not null"
}