> ## Documentation Index
> Fetch the complete documentation index at: https://developers.aptranet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Import a certificate

> Requires Create certificate and available imported-certificate quota. Supply a PEM chain and matching unencrypted PEM private key. The certificate is not automatically assigned to a distribution.



## OpenAPI

````yaml /openapi-products.json post /tls-manager/certificates
openapi: 3.1.0
info:
  title: Aptranet delivery controls and TLS Manager
  version: 1.0.0
  description: >-
    Public project-scoped API. Use the access key and secret together.
    Browser-only organization administration is documented separately.
servers:
  - url: https://api.aptranet.com
security:
  - bearerAuth: []
    apiSecret: []
paths:
  /tls-manager/certificates:
    post:
      tags:
        - TLS Manager certificates
      summary: Import a certificate
      description: >-
        Requires Create certificate and available imported-certificate quota.
        Supply a PEM chain and matching unencrypted PEM private key. The
        certificate is not automatically assigned to a distribution.
      operationId: POST_tls_manager_certificates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: >-
                    Unique project name; at most 64 UTF-8 bytes, without control
                    characters.
                certificate:
                  type: string
                  description: PEM certificate chain, at most 256 KiB.
                private_key:
                  type: string
                  writeOnly: true
                  description: >-
                    Matching unencrypted PEM private key, at most 64 KiB. Never
                    log this value.
                validate_root_ca:
                  type: boolean
                  default: false
              required:
                - name
                - certificate
                - private_key
      responses:
        '201':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Certificate'
        default:
          description: >-
            Request rejected or service unavailable. See the error code and
            description; refresh before retrying a mutation whose result is
            uncertain.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Certificate:
      type: object
      properties:
        id:
          type: integer
          minimum: 1
        name:
          type: string
        type:
          type: string
          enum:
            - managed
            - advanced_managed
            - imported
        type_label:
          type: string
        read_only:
          type: boolean
        status:
          type: string
          enum:
            - active
            - expired
            - pending
        issuer:
          type: string
        serial_number:
          type: string
        fingerprint_sha256:
          type: string
        subject_cn:
          type: string
        domains:
          type: array
          items:
            type: string
        created_at:
          type: string
          format: date-time
        not_before:
          type: string
          format: date-time
        valid_until:
          type: string
          format: date-time
        provisioning:
          type: boolean
        issuing:
          type: object
          properties:
            status:
              type: string
            active:
              type: boolean
            attempts:
              type: integer
            started:
              type: string
            finished:
              type: string
            next_attempt:
              type: string
            error:
              type: string
            details:
              type: string
            retry_after:
              type: string
      required:
        - id
        - name
        - type
        - read_only
        - status
        - domains
        - valid_until
        - provisioning
    Error:
      type: object
      properties:
        error:
          type: string
        error_description:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Project API access key.
    apiSecret:
      type: apiKey
      in: header
      name: Aptranet-Secret
      description: Current secret for the access key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.