API7 Docs

Update an SNI on a gateway group

PUT /apisix/admin/snis/{sni_id}

PUT /apisix/admin/snis/{sni_id}

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Path Parameters

sni_id*string

The unique identifier of the SNI object.

Match^[a-zA-Z0-9-_.]+$
Length1 <= length <= 256

Query Parameters

gateway_group_id*string

Gateway group ID. Optional when using the gateway group admin key to authenticate.

Length1 <= length

Request Body

application/json

The sni description.

Response Body

application/json

application/json

curl -X PUT "$API_BASE_URL/apisix/admin/snis/bd58fce2-b6cc-4d2d-a53c-6ce11b19c101?gateway_group_id=86fb9981-d9d2-4555-9df8-91ae92129335" \  -H "Content-Type: application/json" \  -d '{}'

SNI updated successfully.

{
  "value": {
    "name": "us-west-rsc",
    "domain": "httpbin.org",
    "desc": "Object description.",
    "certificates": [
      "$secret://aws/john/apisix-secrets/john-key-auth"
    ],
    "mtls": {
      "enabled": true,
      "ca_certificates": [
        "$secret://aws/john/apisix-secrets/john-key-auth"
      ],
      "skip_mtls_uri_regex": [
        "string"
      ]
    },
    "labels": {
      "version": "v2",
      "env": "prod"
    },
    "ssl_protocols": [
      "TLSv1.2",
      "TLSv1.3"
    ],
    "id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
    "created_at": 1742288232,
    "updated_at": 1742288235
  }
}
Complete operation details and schema variants

PUT /apisix/admin/snis/{sni_id}

Update an SNI on a gateway group

Replace an existing SNI configuration in full, such as domain mappings, certificate bindings, or mTLS options. Updates take effect on TLS handshakes for matching hostnames. Required IAM Permission: Action gateway:UpdateSNI, Resource arn:api7:gateway:gatewaygroup/%s

Parameters

  • sni_id (path, string, required): The unique identifier of the SNI object.
  • gateway_group_id (query, string, required): Gateway group ID. Optional when using the gateway group admin key to authenticate.

Request body

Content type: application/json

  • allOf variant 1
  • name (string, optional): The object name.
  • domain (string, optional): The HTTP host.
  • desc (string, optional): The object description.
  • certificates (array, optional): An array of certificates.
  • oneOf variant 1: Certificate Reference
  • oneOf variant 2: Certificate Content
  • mtls (object, optional): mTLS configurations.
  • mtls.enabled (boolean, optional): If true, enable mTLS.
  • mtls.ca_certificates (array, optional): An array of CA certificates used for mTLS.
  • oneOf variant 1: Certificate Reference
  • oneOf variant 2: Certificate Content
  • mtls.skip_mtls_uri_regex (array, optional): URI regular expressions to skip mTLS verification. Requests matching any of these patterns will bypass client certificate verification.
  • labels (object, optional): Key-value pairs of labels.
  • ssl_protocols (array, optional): An array of TLS protocol versions.

Responses

  • 200: SNI updated successfully.
  • allOf variant 1
  • value (object, optional): The specific resource.
  • allOf variant 2
  • value (object, optional): The Certificate response format, with filtering the sensitive fields and some other fields.
  • allOf variant 1
  • value.name (string, optional): The object name.
  • value.domain (string, optional): The HTTP host.
  • value.desc (string, optional): The object description.
  • value.certificates (array, optional): An array of certificates.
  • oneOf variant 1: Certificate Reference
  • oneOf variant 2: Certificate Content
  • value.mtls (object, optional): mTLS configurations.
  • value.mtls.enabled (boolean, optional): If true, enable mTLS.
  • value.mtls.ca_certificates (array, optional): An array of CA certificates used for mTLS.
  • oneOf variant 1: Certificate Reference
  • oneOf variant 2: Certificate Content
  • value.mtls.skip_mtls_uri_regex (array, optional): URI regular expressions to skip mTLS verification. Requests matching any of these patterns will bypass client certificate verification.
  • value.labels (object, optional): Key-value pairs of labels.
  • value.ssl_protocols (array, optional): An array of TLS protocol versions.
  • allOf variant 2
  • value.id (string, optional): The object ID.
  • value.created_at (integer, optional): The object created timestamp.
  • value.updated_at (integer, optional): The object updated timestamp.
  • 400: Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.
  • value (object, optional): The specific resource.
  • error_msg (string, optional): The error message.

cURL

curl -X PUT '$API_BASE_URL/apisix/admin/snis/{sni_id}'