swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: Use these REST APIs for performing operations on Certificate entity in your Azure API Management deployment. Certificates can be used to setup mutual authentication with your Backend in API Management. For more information refer to [How to secure backend using Mutual Auth Certificate](https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-mutual-certificates).
  title: ApiManagementClient
  version: 2018-06-01-preview
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2018-06-01-preview/apimcertificates.json
      version: "2.0"
  x-preferred: false
  x-providerName: azure.com
  x-serviceName: apimanagement-apimcertificates
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow.
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
parameters: {}
paths:
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates":
    get:
      description: Lists a collection of all certificates in the specified service instance.
      operationId: Certificate_ListByService
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: "| Field       | Supported operators    | Supported functions               |

            |-------------|------------------------|-----------------------------------|

            \r

            |name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith|

            |subject | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith|

            |thumbprint | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith|

            |expirationDate | ge, le, eq, ne, gt, lt |    |\n"
          in: query
          name: $filter
          required: false
          type: string
        - description: Number of records to return.
          format: int32
          in: query
          minimum: 1
          name: $top
          required: false
          type: integer
          x-ms-parameter-location: method
        - description: Number of records to skip.
          format: int32
          in: query
          minimum: 0
          name: $skip
          required: false
          type: integer
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          description: Returns a collection of Certificate entity.
          schema:
            description: Paged Certificates list representation.
            properties:
              nextLink:
                description: Next page link if any.
                type: string
              value:
                description: Page values.
                items:
                  allOf:
                    - description: The Resource definition.
                      properties:
                        id:
                          description: Resource ID.
                          readOnly: true
                          type: string
                        name:
                          description: Resource name.
                          readOnly: true
                          type: string
                        type:
                          description: Resource type for API Management resource.
                          readOnly: true
                          type: string
                      x-ms-azure-resource: true
                  description: Certificate details.
                  properties:
                    properties:
                      description: Properties of the Certificate contract.
                      properties:
                        expirationDate:
                          description: |
                            Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
                          format: date-time
                          type: string
                        subject:
                          description: Subject attribute of the certificate.
                          type: string
                        thumbprint:
                          description: Thumbprint of the certificate.
                          type: string
                      required:
                        - subject
                        - thumbprint
                        - expirationDate
                type: array
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - Certificate
      x-ms-examples:
        ApiManagementListCertificates:
          parameters:
            api-version: 2018-06-01-preview
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              body:
                nextLink: ""
                value:
                  - id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/kjoshiarmtemplateCert1
                    name: templateCert1
                    properties:
                      expirationDate: 2017-04-23T17:03:41Z
                      subject: CN=mutual-authcert
                      thumbprint: EBA************************48594A6
                    type: Microsoft.ApiManagement/service/certificates
      x-ms-odata: ./definitions.json#/definitions/CertificateContract
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}":
    delete:
      description: Deletes specific certificate.
      operationId: Certificate_Delete
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Identifier of the certificate entity. Must be unique in the current API Management service instance.
          in: path
          maxLength: 80
          minLength: 1
          name: certificateId
          pattern: ^[^*#&+:<>?]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
          in: header
          name: If-Match
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          description: The certificate was successfully deleted.
        "204":
          description: The certificate was successfully deleted.
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - Certificate
      x-ms-examples:
        ApiManagementDeleteCertificate:
          parameters:
            If-Match: "*"
            api-version: 2018-06-01-preview
            certificateId: tempcert
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200": {}
            "204": {}
    get:
      description: Gets the details of the certificate specified by its identifier.
      operationId: Certificate_Get
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Identifier of the certificate entity. Must be unique in the current API Management service instance.
          in: path
          maxLength: 80
          minLength: 1
          name: certificateId
          pattern: ^[^*#&+:<>?]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          description: The response body contains the specified Certificate entity.
          headers:
            ETag:
              description: Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.
              type: string
          schema:
            allOf:
              - description: The Resource definition.
                properties:
                  id:
                    description: Resource ID.
                    readOnly: true
                    type: string
                  name:
                    description: Resource name.
                    readOnly: true
                    type: string
                  type:
                    description: Resource type for API Management resource.
                    readOnly: true
                    type: string
                x-ms-azure-resource: true
            description: Certificate details.
            properties:
              properties:
                description: Properties of the Certificate contract.
                properties:
                  expirationDate:
                    description: |
                      Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
                    format: date-time
                    type: string
                  subject:
                    description: Subject attribute of the certificate.
                    type: string
                  thumbprint:
                    description: Thumbprint of the certificate.
                    type: string
                required:
                  - subject
                  - thumbprint
                  - expirationDate
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - Certificate
      x-ms-examples:
        ApiManagementGetCertificate:
          parameters:
            api-version: 2018-06-01-preview
            certificateId: templateCert1
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/templateCert1
                name: templateCert1
                properties:
                  expirationDate: 2017-04-23T17:03:41Z
                  subject: CN=mutual-authcert
                  thumbprint: EBA**********************8594A6
                type: Microsoft.ApiManagement/service/certificates
    head:
      description: Gets the entity state (Etag) version of the certificate specified by its identifier.
      operationId: Certificate_GetEntityTag
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Identifier of the certificate entity. Must be unique in the current API Management service instance.
          in: path
          maxLength: 80
          minLength: 1
          name: certificateId
          pattern: ^[^*#&+:<>?]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          description: Specified certificate entity exists and current entity state version is present in the ETag header.
          headers:
            ETag:
              description: Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.
              type: string
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - Certificate
      x-ms-examples:
        ApiManagementHeadCertificate:
          parameters:
            api-version: 2018-06-01-preview
            certificateId: templateCert1
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              headers:
                etag: AAAAAAAAAAa=
    put:
      description: Creates or updates the certificate being used for authentication with the backend.
      externalDocs:
        description: How to secure back-end services using client certificate authentication in Azure API Management
        url: https://azure.microsoft.com/en-us/documentation/articles/api-management-howto-mutual-certificates/
      operationId: Certificate_CreateOrUpdate
      parameters:
        - description: The name of the resource group.
          in: path
          name: resourceGroupName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the API Management service.
          in: path
          maxLength: 50
          minLength: 1
          name: serviceName
          pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Identifier of the certificate entity. Must be unique in the current API Management service instance.
          in: path
          maxLength: 80
          minLength: 1
          name: certificateId
          pattern: ^[^*#&+:<>?]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Create or Update parameters.
          in: body
          name: parameters
          required: true
          schema:
            description: Certificate create or update details.
            properties:
              properties:
                description: Parameters supplied to the CreateOrUpdate certificate operation.
                properties:
                  data:
                    description: Base 64 encoded certificate using the application/x-pkcs12 representation.
                    type: string
                  password:
                    description: Password for the Certificate
                    type: string
                required:
                  - data
                  - password
        - description: ETag of the Entity. Not required when creating an entity, but required when updating an entity.
          in: header
          name: If-Match
          required: false
          type: string
          x-ms-parameter-location: method
        - description: Version of the API to be used with the client request.
          in: query
          name: api-version
          required: true
          type: string
        - description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
      responses:
        "200":
          description: The certificate details were successfully updated.
          headers:
            ETag:
              description: Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.
              type: string
          schema:
            allOf:
              - description: The Resource definition.
                properties:
                  id:
                    description: Resource ID.
                    readOnly: true
                    type: string
                  name:
                    description: Resource name.
                    readOnly: true
                    type: string
                  type:
                    description: Resource type for API Management resource.
                    readOnly: true
                    type: string
                x-ms-azure-resource: true
            description: Certificate details.
            properties:
              properties:
                description: Properties of the Certificate contract.
                properties:
                  expirationDate:
                    description: |
                      Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
                    format: date-time
                    type: string
                  subject:
                    description: Subject attribute of the certificate.
                    type: string
                  thumbprint:
                    description: Thumbprint of the certificate.
                    type: string
                required:
                  - subject
                  - thumbprint
                  - expirationDate
        "201":
          description: The new certificate was successfully added.
          headers:
            ETag:
              description: Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.
              type: string
          schema:
            allOf:
              - description: The Resource definition.
                properties:
                  id:
                    description: Resource ID.
                    readOnly: true
                    type: string
                  name:
                    description: Resource name.
                    readOnly: true
                    type: string
                  type:
                    description: Resource type for API Management resource.
                    readOnly: true
                    type: string
                x-ms-azure-resource: true
            description: Certificate details.
            properties:
              properties:
                description: Properties of the Certificate contract.
                properties:
                  expirationDate:
                    description: |
                      Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
                    format: date-time
                    type: string
                  subject:
                    description: Subject attribute of the certificate.
                    type: string
                  thumbprint:
                    description: Thumbprint of the certificate.
                    type: string
                required:
                  - subject
                  - thumbprint
                  - expirationDate
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error Response.
            properties:
              error:
                description: Error Body contract.
                properties:
                  code:
                    description: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
                    type: string
                  details:
                    description: The list of invalid fields send in request, in case of validation error.
                    items:
                      description: Error Field contract.
                      properties:
                        code:
                          description: Property level error code.
                          type: string
                        message:
                          description: Human-readable representation of property-level error.
                          type: string
                        target:
                          description: Property name.
                          type: string
                    type: array
                  message:
                    description: Human-readable representation of the error.
                    type: string
      tags:
        - Certificate
      x-ms-examples:
        ApiManagementCreateCertificate:
          parameters:
            api-version: 2018-06-01-preview
            certificateId: tempcert
            parameters:
              properties:
                data: "****************Base 64 Encoded Certificate *******************************"
                password: "****Certificate Password******"
            resourceGroupName: rg1
            serviceName: apimService1
            subscriptionId: subid
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/tempcert
                name: tempcert
                properties:
                  expirationDate: 2018-03-17T21:55:07+00:00
                  subject: CN=contoso.com
                  thumbprint: "*******************3"
                type: Microsoft.ApiManagement/service/certificates
            "201":
              body:
                id: /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/tempcert
                name: tempcert
                properties:
                  expirationDate: 2018-03-17T21:55:07+00:00
                  subject: CN=contoso.com
                  thumbprint: "*******************3"
                type: Microsoft.ApiManagement/service/certificates
definitions: {}
