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

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

# Create a new SNI associated with a Certificate

`POST` `/runtime-groups/{runtimeGroupId}/core-entities/certificates/{certificate_name_or_id}/snis`

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

Create a new SNI and associate it with a certificate in the system. Use this endpoint to add a new SNI to the system and link it to a specific certificate.

## Path parameters

- `certificate_name_or_id` (string, required) - The unique identifier or the `name` attribute of the Certificate whose SNIs are to be retrieved. When using this endpoint, only SNIs associated to the specified Certificate will be listed.
- `runtimeGroupId` (string, required) - The ID of your runtime group. This variable is available in the Konnect manager

## Request body

Content types: `application/json`

## Responses

- `200` - Successfully created 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_name_or_id}/snis:
    parameters:
      - $ref: "#/components/parameters/certificate_name_or_id"
      - $ref: "#/components/parameters/runtimeGroupId"
    post:
      operationId: create-sni-for-certificate
      summary: Create a new SNI associated with a Certificate
      description: Create a new SNI and associate it with a certificate in the system.
        Use this endpoint to add a new SNI to the system and link it to a
        specific certificate.
      requestBody:
        $ref: "#/components/requestBodies/create-sni"
      responses:
        "200":
          description: Successfully created SNI
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SNI"
        "400":
          description: Invalid SNI
          content:
            application/json:
              schema:
                type: object
              examples:
                Bad Request:
                  value:
                    code: 3
                    message: data constraint error
                    details:
                      - "@type": type.googleapis.com/kong.admin.model.v1.ErrorDetail
                        type: ERROR_TYPE_REFERENCE
                        field: certificate.id
                        messages:
                          - "certificate_id (type: foreign) constraint failed
                            for value 'a3ad71a8-6685-4b03-a101-980a953544f6': "
      tags:
        - SNIs
security:
  - konnectAccessToken: []
  - personalAccessToken: []
components:
  parameters:
    certificate_name_or_id:
      name: certificate_name_or_id
      in: path
      required: true
      schema:
        type: string
        example: name
        enum:
          - a3ad71a8-6685-4b03-a101-980a953544f6
          - name
      description: The unique identifier or the `name` attribute of the Certificate
        whose SNIs are to be retrieved. When using this endpoint, only SNIs
        associated to the specified Certificate will be listed.
    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
  requestBodies:
    create-sni:
      content:
        application/json:
          schema:
            type: object
            properties:
              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, low-priority]"
              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. With
                  form-encoded, the notation is `certificate.id=<certificate
                  id>`. With JSON, use `“certificate:{id:<certificate id>”}`.
                type: object
                properties:
                  id:
                    description: 91020192-062d-416f-a275-9addeeaffaf2
                    type: string
                    example: 91020192-062d-416f-a275-9addeeaffaf2
                required:
                  - id
            required:
              - name
              - certificate
            x-examples:
              Example 1:
                name: my-sni
                tags:
                  - user-level
                  - low-priority
                certificate:
                  id: a2e013e8-7623-4494-a347-6d29108ff68b
      description: A JSON object containing the details of the new SNI, including the
        name, certificate, and tags.
  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.
```
