> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pgw.sipmicro.services/llms.txt
> Use this file to discover all available pages before exploring further.

# Load the certificate again

> Loads the certificate and key files of the app listener again, so a
renewed certificate takes effect without a restart. Connections that
are already open keep the certificate they started with. The
certificate belongs to the whole gateway, so the endpoint needs the
server's `PGW_BOOTSTRAP_TOKEN`, not a tenant API key.




## OpenAPI

````yaml /reference/openapi.yaml post /tls/reload
openapi: 3.1.0
info:
  title: pgw admin API
  version: 0.4.0
  description: |
    Manage a pgw tenant: its apps, upstreams, managed mode users, bindings,
    and push log.

    The API listens on `admin_listen`, `127.0.0.1:8080` by default, over plain
    HTTP. Every endpoint except `POST /bootstrap`, `POST /tls/reload`, and the
    register bans needs a tenant API key in the `Authorization` header. Those
    need the server's `PGW_BOOTSTRAP_TOKEN`. Request bodies are JSON objects
    of at most 1 MiB, or 16 MiB for `POST /config/sync`, and pgw rejects
    unknown fields. Responses are never cached.

    An unknown path gets `404`, and a method that the path doesn't serve gets
    `405` with an `Allow` header. Every `GET` endpoint also answers `HEAD`.
    An endpoint that needs an API key answers `500` when pgw can't check the
    key.

    The same listener also serves `GET /metrics`, `GET /healthz`, and
    `GET /readyz`, outside `/api/v1` and without authentication. The health
    checks and metrics pages describe them.
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
  - url: '{baseUrl}'
    description: Your pgw admin listener
    variables:
      baseUrl:
        default: http://127.0.0.1:8080/api/v1
        description: The address of admin_listen, followed by /api/v1.
  - url: http://localhost:8080/api/v1
    description: pgw on this computer
security:
  - apiKey: []
tags:
  - name: Tenant
    description: Create the first tenant and read the caller's tenant.
  - name: Apps
    description: Mobile and web apps and their push credentials.
  - name: Upstreams
    description: PBXs that pgw registers apps with.
  - name: Users
    description: >-
      SIP accounts that pgw checks itself and registers at the PBX in managed
      mode.
  - name: Bindings
    description: Devices registered through pgw.
  - name: Push events
    description: The log of push attempts.
  - name: TLS
    description: The certificate that pgw presents to apps.
  - name: Register bans
    description: >-
      Source addresses that pgw refuses REGISTERs from after too many refused
      credentials.
  - name: Config
    description: Export a tenant's configuration and make it match a snapshot.
paths:
  /tls/reload:
    post:
      tags:
        - TLS
      summary: Load the certificate again
      description: |
        Loads the certificate and key files of the app listener again, so a
        renewed certificate takes effect without a restart. Connections that
        are already open keep the certificate they started with. The
        certificate belongs to the whole gateway, so the endpoint needs the
        server's `PGW_BOOTSTRAP_TOKEN`, not a tenant API key.
      operationId: reloadTLS
      responses:
        '200':
          description: The new certificate is in use.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TLSReload'
              example:
                not_after: '2027-01-11T00:00:00Z'
        '401':
          $ref: '#/components/responses/BootstrapUnauthorized'
        '403':
          $ref: '#/components/responses/NoBootstrapToken'
        '422':
          description: >-
            The files aren't a valid certificate and key pair. The old
            certificate stays in use.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: >-
                  the certificate files are not a valid pair; the old
                  certificate stays
      security:
        - bootstrapToken: []
components:
  schemas:
    TLSReload:
      type: object
      required:
        - not_after
      properties:
        not_after:
          type: string
          format: date-time
          description: When the new certificate expires.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: What went wrong. Never contains the values that you sent.
  responses:
    BootstrapUnauthorized:
      description: The token is missing or wrong. A tenant API key isn't accepted.
      headers:
        WWW-Authenticate:
          schema:
            type: string
            const: Bootstrap
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: missing or wrong bootstrap token
    NoBootstrapToken:
      description: The server has no `PGW_BOOTSTRAP_TOKEN`, so it refuses the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            bootstrap:
              summary: POST /bootstrap
              value:
                error: set PGW_BOOTSTRAP_TOKEN to bootstrap
            reloadTLS:
              summary: POST /tls/reload
              value:
                error: set PGW_BOOTSTRAP_TOKEN to reload the certificate
            listBans:
              summary: GET /register-bans
              value:
                error: set PGW_BOOTSTRAP_TOKEN to list REGISTER bans
            liftBan:
              summary: DELETE /register-bans/{source}
              value:
                error: set PGW_BOOTSTRAP_TOKEN to lift REGISTER bans
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: The tenant API key that `POST /bootstrap` returned.
    bootstrapToken:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        `Bootstrap <token>`, where the token is the server's
        `PGW_BOOTSTRAP_TOKEN`. Type the word `Bootstrap`, a space, and the
        token.

````

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