---
title: "Upsert a SNI in a workspace"
url: "https://nov18-dev.movespot.fyi/apis/konnect-control-planes-configuration-dev-3/versions/76e259e8-9e78-4c0e-ab4a-3df25bddc4f1/operations/upsert-sni-in-workspace"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/konnect-control-planes-configuration-dev-3/versions/76e259e8-9e78-4c0e-ab4a-3df25bddc4f1.md

# Upsert a SNI in a workspace

`PUT` `/control-planes/{controlPlaneId}/core-entities/{workspace}/snis/{SNIId}`

Operation ID: `upsert-sni-in-workspace`

Create or Update SNI using ID or name in a workspace.

## Path parameters

- `SNIId` (string, required) - ID of the SNI to lookup
- `controlPlaneId` (string, uuid, required) - The UUID of your control plane. This variable is available in the Konnect manager.
- `workspace` (string, string, required) - The name of the workspace

## Request body (required)

Content types: `application/json`

## Responses

- `200` - Successfully upserted SNI
- `401` - Unauthorized

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Konnect Control Planes Configuration
  version: 3.14.0
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:
  /control-planes/{controlPlaneId}/core-entities/{workspace}/snis/{SNIId}:
    parameters:
      - $ref: "#/components/parameters/SNIId"
      - $ref: "#/components/parameters/controlPlaneId"
    put:
      operationId: upsert-sni-in-workspace
      summary: Upsert a SNI in a workspace
      description: Create or Update SNI using ID or name in a workspace.
      parameters:
        - $ref: "#/components/parameters/Workspace"
      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"
        "401":
          $ref: "#/components/responses/HTTP401Error"
      tags:
        - SNIs
security:
  - konnectAccessToken: []
  - personalAccessToken: []
components:
  parameters:
    SNIId:
      description: ID of the SNI to lookup
      example: 64c17a1a-b7d7-4a65-a5a4-42e4a7016e7f
      in: path
      name: SNIId
      required: true
      schema:
        type: string
    controlPlaneId:
      name: controlPlaneId
      in: path
      required: true
      schema:
        type: string
        format: uuid
        example: 9524ec7d-36d9-465d-a8c5-83a3c9390458
      description: The UUID of your control plane. This variable is available in the
        Konnect manager.
    Workspace:
      description: The name of the workspace
      in: path
      name: workspace
      required: true
      schema:
        type: string
        format: string
        example: team-payments
  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
          properties:
            id:
              type: string
          x-foreign: true
        created_at:
          description: Unix epoch when the resource was created.
          type: integer
          nullable: true
        description:
          description: User-defined entity description. Konnect only field, not synced to
            the Gateway.
          type: string
          nullable: true
        id:
          description: A string representing a UUID (universally unique identifier).
          type: string
          nullable: true
        managed_by:
          description: Arbitrary JSON data for client responsible for managing the entity.
            Konnect only field, not synced to the Gateway.
          type: object
          additionalProperties: true
          nullable: true
        name:
          description: The SNI name to associate with the given certificate.
          type: string
        tags:
          description: An optional set of strings associated with the SNIs for grouping
            and filtering.
          type: array
          items:
            description: A string representing a tag.
            type: string
          nullable: true
        updated_at:
          description: Unix epoch when the resource was last updated.
          type: integer
          nullable: true
      example:
        certificate:
          id: bd380f99-659d-415e-b0e7-72ea05df3218
        id: 36c4566c-14cc-4132-9011-4139fcbbe50a
        name: some.example.org
      additionalProperties: false
      required:
        - name
        - certificate
    GatewayUnauthorizedError:
      type: object
      properties:
        message:
          type: string
        status:
          type: integer
      required:
        - message
        - status
  responses:
    HTTP401Error:
      description: Unauthorized
      content:
        application/json:
          examples:
            DuplicateApiKey:
              summary: Duplicate API key found
              value:
                message: Duplicate API key found
                status: 401
            InvalidAuthCred:
              summary: Invalid authentication credentials
              value:
                message: Unauthorized
                status: 401
            NoAPIKey:
              summary: No API key found
              value:
                message: No API key found in request
                status: 401
          schema:
            $ref: "#/components/schemas/GatewayUnauthorizedError"
  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.
```
