Update identityApiConnector

Namespace: microsoft.graph

Update the properties of an identityApiConnector object.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) APIConnectors.ReadWrite.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application APIConnectors.ReadWrite.All Not available.

In delegated scenarios with work or school accounts, the signed-in user must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. External ID User Flow Administrator is the least privileged role supported for this operation.

HTTP request

PATCH /identity/apiConnectors/{identityApiConnectorId}

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type application/json. Required.

Request body

In the request body, supply a JSON representation of the identityApiConnector object.

The following table shows the properties of the identityApiConnector that can be updated.

Property Type Description
displayName String The name of the API connector.
targetUrl String The URL of the API endpoint to call.
authenticationConfiguration apiAuthenticationConfigurationBase The object which describes the authentication configuration details for calling the API. Only Basic authentication and PKCS 12 client certificate are supported.

Response

If successful, this method returns a 204 No Content response code.

Examples

Example 1: Changing display name, targetUrl, and username & password used for basic authentication

Request

The following example shows a request.

PATCH https://graph.microsoft.com/v1.0/identity/apiConnectors/{identityApiConnectorId}
Content-Type: application/json

{
  "displayName": "New Test API",
  "targetUrl": "https://otherapi.com/api/endpoint",
  "authenticationConfiguration": {
    "@odata.type": "microsoft.graph.basicAuthentication",
    "username":"<NEW_USERNAME>", 
    "password":"<NEW_PASSWORD>"
  }
}

Response

The following example shows the response.

HTTP/1.1 204 No Content

Example 2: Changing API connector to use client certificate authentication

This will overwrite any previous authenticationConfiguration settings. To change from Basic authentication to certificate authentication, use this. To add additional certificates to list of certificates, use the Upload client certificate method. When using this method, consequent "Get" or "List" operations of API connectors, authenticationConfiguration will be of type microsoft.graph.clientCertificateAuthentication.

Request

The following example shows a request.

PATCH https://graph.microsoft.com/v1.0/identity/apiConnectors/be1f769b-9b13-437e-b540-79a905c4932c
Content-Type: application/json

{
  "authenticationConfiguration": {
    "@odata.type": "#microsoft.graph.pkcs12Certificate",
    "pkcs12Value": "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ...kDJ04sJShkkgjL9Bm49plA",
    "password": "secret"
  }
}

Response

The following example shows the response.

HTTP/1.1 204 No Content