identityApiConnector: uploadClientCertificate

Namespace: microsoft.graph

Upload a PKCS 12 format key (.pfx) to an API connector's authentication configuration. The input is a base-64 encoded value of the PKCS 12 certificate contents. This method returns an apiConnector.

This API is available in the following national cloud deployments.

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


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.

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

  • Global administrator
  • External Identity User Flow administrator

HTTP request

POST /identity/apiconnectors/{id}/uploadClientCertificate

Request headers

Name Description
Authorization Bearer {token}. Required.
Content-type application/json. Required.

Request body

In the request body, provide a JSON object with the following parameters.

Property Type Description
pkcs12Value String This is the field for sending the pfx content. The value should be a base-64 encoded version of the actual certificate content. Required.
password String This is the password for the pfx file. Required. If no password is used, must still provide a value of "".


If successful, this method returns a 200 OK response code and the apiConnector whose authenticationConfiguration contains the public information of the client certificate.



The following example shows a request.

Content-type: application/json

    "pkcs12Value": "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ...kDJ04sJShkkgjL9Bm49plA",
    "password": "<password>"


The following example shows the response.

Note: authenticationConfiguration in the response is of type microsoft.graph.clientCertificateAuthentication because this represents the public information of uploaded certificates.

HTTP/1.1 200 OK
Content-type: application/json

    "@odata.context": "$metadata#identity/apiConnectors/$entity",
    "id": "45715bb8-13f9-4bf6-927f-ef96c102d394",
    "displayName": "My API connector",
    "targetUrl": "",
    "authenticationConfiguration": {
        "@odata.type": "#microsoft.graph.clientCertificateAuthentication",
        "certificateList": [
                "thumbprint": "0EB255CC895477798BA418B378255204304897AD",
                "notAfter": 1666350522,
                "notBefore": 1508670522,
                "isActive": true