Update identityApiConnector

Namespace: microsoft.graph

Update the properties of an identityApiConnector object.

This API is supported in the following national cloud deployments.

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

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) APIConnectors.ReadWrite.All
Delegated (personal Microsoft account) Not supported.
Application APIConnectors.ReadWrite.All

The work or school account needs to belong to one of the following roles:

  • Global administrator
  • External Identity User Flow administrator

HTTP request

PATCH /identity/apiConnectors/{identityApiConnectorId}

Request headers

Name Description
Authorization Bearer {token}. Required.
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 is an example of the 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 is an example of 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 is an example of the 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 is an example of the response.

HTTP/1.1 204 No Content