---
title: "Upsert an SNI associated with a certificate"
url: "https://nov18-dev.movespot.fyi/apis/konnect-runtime-groups-configuration-0/versions/af18902c-58f1-49d7-8ec2-9987b4e0d1bd/operations/upsert-sni-for-certificate"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/konnect-runtime-groups-configuration-0/versions/af18902c-58f1-49d7-8ec2-9987b4e0d1bd.md

# Upsert an SNI associated with a certificate

`PUT` `/runtime-groups/{runtimeGroupId}/core-entities/certificates/{certificate_id}/snis/{sni_id}`

Operation ID: `upsert-sni-for-certificate`

Create or Update an SNI associated with a Certificate using ID or name. Inserts (or replaces) the SNI under the requested resource with the definition specified in the body. The SNI will be identified by the id attribute. When the name or id attribute has the structure of a UUID, the SNI being inserted/replaced will be identified by its id. Otherwise it will be identified by its name. When creating a new SNI without specifying id (neither in the URL nor in the body), then it will be auto-generated.

## Path parameters

- `certificate_id` (string, required) - The unique identifier of the Certificate to retrieve.
- `sni_id` (string, required) - The unique identifier or the name of the SNI to retrieve.
- `runtimeGroupId` (string, required) - The ID of your runtime group. This variable is available in the Konnect manager

## Request body (required)

Content types: `application/json`

## Responses

- `200` - Successfully upserted SNI
- `400` - Invalid SNI

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Konnect Runtime Groups Configuration
  version: 0.0.1
servers:
  - url: https://us.api.konghq.com/v2
    description: United-States Production region
  - url: https://eu.api.konghq.com/v2
    description: Europe Production region
  - url: https://au.api.konghq.com/v2
    description: Australia Production region
  - url: https://me.api.konghq.com/v2
    description: Middle-East Production region
  - url: https://in.api.konghq.com/v2
    description: India Production region
  - url: https://sg.api.konghq.com/v2
    description: Singapore Production region
paths:
  /runtime-groups/{runtimeGroupId}/core-entities/certificates/{certificate_id}/snis/{sni_id}:
    parameters:
      - $ref: "#/components/parameters/certificate_id"
      - $ref: "#/components/parameters/sni_id"
      - $ref: "#/components/parameters/runtimeGroupId"
    put:
      operationId: upsert-sni-for-certificate
      summary: Upsert an SNI associated with a certificate
      description: >-
        Create or Update an SNI associated with a Certificate using ID or name.


        Inserts (or replaces) the SNI under the requested resource with the
        definition specified in the body. The SNI will be identified by the id
        attribute.


        When the name or id attribute has the structure of a UUID, the SNI being
        inserted/replaced will be identified by its id. Otherwise it will be
        identified by its name.


        When creating a new SNI without specifying id (neither in the URL nor in
        the body), then it will be auto-generated.
      requestBody:
        description: Description of the SNI
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SNI"
      responses:
        "200":
          description: Successfully upserted SNI
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SNI"
        "400":
          description: Invalid SNI
          content:
            application/json:
              schema:
                type: object
      tags:
        - SNIs
security:
  - konnectAccessToken: []
  - personalAccessToken: []
components:
  parameters:
    certificate_id:
      name: certificate_id
      in: path
      required: true
      schema:
        type: string
        example: 7fca84d6-7d37-4a74-a7b0-93e576089a41
      description: The unique identifier of the Certificate to retrieve.
    sni_id:
      name: sni_id
      in: path
      required: true
      schema:
        type: string
        example: my-sni
      description: The unique identifier or the name of the SNI to retrieve.
    runtimeGroupId:
      name: runtimeGroupId
      in: path
      required: true
      schema:
        type: string
        example: 9524ec7d-36d9-465d-a8c5-83a3c9390458
      description: The ID of your runtime group. This variable is available in the
        Konnect manager
  schemas:
    SNI:
      description: An SNI object represents a many-to-one mapping of hostnames to a
        certificate. That is, a certificate object can have many hostnames
        associated with it; when Kong receives an SSL request, it uses the SNI
        field in the Client Hello to lookup the certificate object based on the
        SNI associated with the certificate.
      type: object
      properties:
        certificate:
          description: The id (a UUID) of the certificate with which to associate the SNI
            hostname. The Certificate must have a valid private key associated
            with it to be used by the SNI object.
          type: object
          additionalProperties: false
          properties:
            id:
              type: string
              example: 147f5ef0-1ed6-4711-b77f-489262f8bff7
        created_at:
          description: Unix epoch when the resource was created.
          type: integer
          example: 1422386534
        id:
          type: string
          example: b87eb55d-69a1-41d2-8653-8d706eecefc0
        name:
          description: The SNI name to associate with the given certificate.
          type: string
          example: my-sni
        tags:
          description: An optional set of strings associated with the SNIs for grouping
            and filtering.
          type: array
          items:
            type: string
            example: user-level, enterprise
      example:
        certificate:
          id: bd380f99-659d-415e-b0e7-72ea05df3218
        id: 36c4566c-14cc-4132-9011-4139fcbbe50a
        name: some.example.org
  securitySchemes:
    konnectAccessToken:
      type: http
      scheme: bearer
      description: >-
        The Konnect access token is meant to be used by the Konnect dashboard
        and the decK CLI to

        authenticate with.
    personalAccessToken:
      type: http
      scheme: bearer
      description: The personal access token is meant to be used as an alternative to
        basic-auth when accessing Konnect via APIs. You can generate a Personal
        Access Token (PAT) from the personal access token page in the Konnect
        dashboard.
```
