Netskope LogoNetskope Logo
  • Security Services
  • AI Services
  • Networking Services
  • Analytics Services
  • Integrations
  • getting-started.svgGetting Started
    • Support
    • Community
    • Netskope.com
    © 2026 All Rights Reserved. Netskope Inc.
    Home
    AI Gateway
    Configuration API

    Configuration API

    The AI Gateway configuration API lets you configure an AI Gateway appliance over HTTPS instead of the interactive console. It covers appliance enrollment, TLS certificate management, and the DLP and AI Guardrails service connections.

    Every endpoint in this API:

    • Uses HTTPS on port 8443. The API does not support plain HTTP.
    • Is rooted at /v1/config.
    • Requires a bearer token in the Authorization header.

    Authentication

    The API is disabled by default. You enable it by connecting to the appliance over SSH as the nsadmin operator account and running enable-api. Enabling the API opens the network port and issues an access token:

    # Enable the API and generate a token with a chosen lifetime
    ssh nsadmin@<appliance_ip> 'enable-api --ttl 168h'
    # {
    #   "token": "<token>",
    #   "expires_at": "2026-06-10T10:00:00Z"
    # }
    # Disable the API again (closes the port)
    ssh nsadmin@<appliance_ip> 'disable-api'
    • Running ssh nsadmin@<appliance_ip> with no command instead drops you into the interactive aig-cli console, where you can type enable-api --ttl 168h directly.
    • The token is shown once at generation time and cannot be retrieved again. Store it securely.
    • The --ttl lifetime is a positive duration written as a number followed by a unit suffix — h (hours), m (minutes) or s (seconds); units may be combined, as in 1h30m. There is no day unit, so use 168h for 7 days. It defaults to 24h when omitted.
    • Only one token is valid at a time. Enabling the API again issues a new token and invalidates the previous one.

    Include the token on every request:

    Authorization: Bearer <token>

    If your request has a missing, malformed, invalid, or expired token, the API returns 401 Unauthorized. When a token expires, the port stays open until you run disable-api. The API simply returns 401 until you generate a new token.

    Endpoint Summary

    GroupMethod and PathDescription
    BootstrapPOST /v1/config/bootstrapStart automated enrollment (optionally with DLP / AI Guardrails config)
    BootstrapGET /v1/config/bootstrapCheck enrollment status
    CertificateGET /v1/config/certificate/statusGet current certificate information
    CertificatePOST /v1/config/certificate/csrGenerate a Certificate Signing Request
    CertificatePOST /v1/config/certificate/installInstall a CA-signed certificate
    DLPGET /v1/config/dlpGet current DLP configuration
    DLPPUT /v1/config/dlp/ca-certUpload the CA certificate for the DLP upstream
    DLPPUT /v1/config/dlp/hostconfigSet the DLP upstream host
    DLPDELETE /v1/config/dlp/hostconfigRemove the DLP host configuration
    AI GuardrailsGET /v1/config/ai-guardrailsGet current AI Guardrails configuration
    AI GuardrailsPUT /v1/config/ai-guardrails/ca-certUpload the CA certificate for the AI Guardrails upstream
    AI GuardrailsPUT /v1/config/ai-guardrails/hostconfigSet the AI Guardrails upstream host and OAuth authentication
    AI GuardrailsDELETE /v1/config/ai-guardrails/hostconfigRemove the AI Guardrails host configuration

    Bootstrap API

    Runs automated appliance enrollment, optionally applying DLP and/or AI Guardrails configuration at the same time.

    POST /v1/config/bootstrap

    Starts appliance enrollment using the enrollment token you provide, and applies any DLP or AI Guardrails configuration you include.

    Request body

    KeyTypeExampleDescription
    enrollment_tokenstring"eyJhbGciOi..."Required. Enrollment token (max 2048 chars).
    dlpobject{"host":"https://dlp.example.com","certificate":"-----BEGIN CERTIFICATE-----..."}Optional. DLP configuration to apply during enrollment. See DLP object below.
    ai_guardrailsobject{"host":"https://llm.example.com","jwt_url":"https://auth.example.com/oauth/token"}Optional. AI Guardrails configuration to apply during enrollment. See AI Guardrails object below.

    dlp object — if the dlp object is present, both fields are required.

    KeyTypeExampleDescription
    certificatestring"-----BEGIN CERTIFICATE-----..."Required. PEM-encoded CA certificate for the DLP upstream (max 5120 chars).
    hoststring"https://dlp.example.com"Required. DLP upstream base URL (valid URL, max 256 chars).

    ai_guardrails object

    KeyTypeExampleDescription
    hoststring"https://llm.example.com"Required. AI Guardrails upstream base URL (valid URL, max 256 chars).
    certificatestring"-----BEGIN CERTIFICATE-----..."Optional. PEM-encoded CA certificate for the AI Guardrails upstream (max 5120 chars).
    jwt_urlstring"https://auth.example.com/oauth/token"Optional. OAuth/JWT token endpoint (valid URL, max 1024 chars).
    client_idstring"aig-client"Optional. OAuth client ID (max 256 chars).
    client_secretstring"s3cr3t"Optional. OAuth client secret (max 10000 chars).
    scopestring"llm.read"Optional. OAuth scope (max 256 chars).

    Example request

    POST /v1/config/bootstrap HTTP/1.1
    Host: <appliance_ip>:8443
    Content-Type: application/json
    {
      "enrollment_token": "eyJhbGciOi...",
      "dlp": {
        "host": "https://dlp.example.com",
        "certificate": "-----BEGIN CERTIFICATE-----..."
      },
      "ai_guardrails": {
        "host": "https://llm.example.com",
        "jwt_url": "https://auth.example.com/oauth/token"
      }
    

    Success response — 202 Accepted. Enrollment runs in the background; poll the status endpoint for progress.

    Bootstrap started, no optional config requested:

    {
      "status": "running"
    }

    Bootstrap started, DLP and AI Guardrails config pending:

    {
      "status": "running",
      "dlp": "pending",
      "ai_guardrails": "pending"
    }

    Error response — 400 Bad Request

    Missing enrollment_token:

    {
      "err_code": "00101",
      "message": "invalid format: validation error occurred in the request",
      "validation_errors": [
        {
          "field": "enrollment_token",
          "error": "enrollment_token is a required field"
        }
      ]
    }

    Invalid dlp.host URL:

    {
      "err_code": "00101",
      "message": "invalid format: validation error occurred in the request",
      "validation_errors": [
        {
          "field": "dlp.host",
          "error": "host must be a valid URL"
        }
      ]
    }

    Error response — 500 Internal Server Error

    Failed to persist bootstrap status:

    {
      "err_code": "00601",
      "message": "System Error"
    }

    GET /v1/config/bootstrap

    Returns the current enrollment status.

    FieldTypeDescription
    statusstringOverall status: not_started, running, completed, or failed
    dlpstringPer-service status: pending, completed, failed, or skipped
    ai_guardrailsstringPer-service status: pending, completed, failed, or skipped

    A failure applying the optional DLP or AI Guardrails configuration does not fail the overall enrollment.

    Example request

    GET /v1/config/bootstrap HTTP/1.1
    Host: <appliance_ip>:8443

    Success response — 200 OK

    Bootstrap not yet triggered:

    {
      "status": "not_started"
    }

    Bootstrap in progress:

    {
      "status": "running",
      "dlp": "pending",
      "ai_guardrails": "pending"
    }

    Bootstrap completed, no optional config requested:

    {
      "status": "completed"
    }

    Bootstrap completed, DLP and AI Guardrails both configured:

    {
      "status": "completed",
      "dlp": "completed",
      "ai_guardrails": "completed"
    }

    Bootstrap failed, optional steps auto-skipped:

    {
      "status": "failed",
      "dlp": "skipped",
      "ai_guardrails": "skipped"
    }

    Certificate API

    Manage the appliance’s gateway TLS certificate. The typical flow is: generate a CSR, have it signed by your CA, then install the signed certificate. Installed certificates take effect without an appliance restart.

    POST /v1/config/certificate/csr

    Generates a Certificate Signing Request for the gateway certificate.

    Request body

    KeyTypeExampleDescription
    common_namestring"gateway.example.com"Required. Certificate CN (max 256 chars).
    organizationstring"Example Inc"Optional. Organization name (O) (max 256 chars).
    organization_unitstring"IT"Optional. Organizational Unit (OU) (max 256 chars).
    emailstring"admin@example.com"Optional. Email address for the subject (valid email format).
    countrystring"US"Optional. Two-letter country code (C), exactly 2 alpha chars.
    statestring"California"Optional. State or Province (ST) (max 256 chars).
    citystring"San Jose"Optional. City or Locality (L) (max 256 chars).
    key_algorithmstring"ecdsa"Optional. Private-key algorithm; one of ecdsa, rsa, ed25519. Defaults to ecdsa (P-256) when unset.
    key_sizeinteger2048Optional. RSA key size in bits; one of 2048, 3072, 4096. Applies when key_algorithm is rsa.
    key_curvestring"P256"Optional. ECDSA curve; one of P256, P384, P521. Applies when key_algorithm is ecdsa.

    Example request

    POST /v1/config/certificate/csr HTTP/1.1
    Host: <appliance_ip>:8443
    Content-Type: application/json
    {
      "common_name": "gateway.example.com",
      "organization": "Example Inc",
      "country": "US"
    }
    
    Success response — 200 OK

    CSR generated:

    {
      "csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIIC...\n-----END CERTIFICATE REQUEST-----\n"
    }

    Error response — 400 Bad Request

    Missing common_name:

    {
      "err_code": "00101",
      "message": "invalid format: validation error occurred in the request",
      "validation_errors": [
        {
          "field": "common_name",
          "error": "common_name is a required field"
        }
      ]
    }

    Error response — 500 Internal Server Error

    Unexpected server error:

    {
      "err_code": "00601",
      "message": "System Error"
    }

    POST /v1/config/certificate/install

    Installs a CA-signed certificate for the gateway. The certificate must match the key pair generated for the most recent CSR. The new certificate takes effect immediately, without a restart.

    Request body

    KeyTypeExampleDescription
    certificatestring"-----BEGIN CERTIFICATE-----..."Required. PEM-encoded X.509 certificate (max 6500 chars).

    Example request

    POST /v1/config/certificate/install HTTP/1.1
    Host: <appliance_ip>:8443
    Content-Type: application/json
    {
      "certificate": "-----BEGIN CERTIFICATE-----..."
    }

    Success response — 204 No Content. Empty body.

    Error response — 400 Bad Request

    Certificate exceeds max length:

    {
      "err_code": "00101",
      "message": "invalid format: validation error occurred in the request",
      "validation_errors": [
        {
          "field": "certificate",
          "error": "certificate must be a maximum of 6,500 characters in length"
        }
      ]
    }

    Error response — 403 Forbidden

    Certificate/key mismatch:

    {
      "err_code": "00502",
      "message": "forbidden: failed to install certificate"
    }

    Error response — 404 Not Found

    No private key on appliance (e.g. generate a CSR first):

    {
      "err_code": "00301",
      "message": "resource not found: failed to install certificate"
    }

    Error response — 500 Internal Server Error

    Unexpected server error:

    {
      "err_code": "00601",
      "message": "System Error"
    }

    GET /v1/config/certificate/status

    Returns the current gateway certificate metadata. No request body.

    Example request

    GET /v1/config/certificate/status HTTP/1.1
    Host: <appliance_ip>:8443

    Success response — 200 OK

    Active certificate:

    {
      "status": {
        "subject": "CN=gateway.example.com,OU=IT,O=Example Inc,L=San Jose,ST=California,C=US",
        "issuer": "CN=Example CA,O=Example Inc",
        "valid_from": "2026-01-15T00:00:00Z",
        "valid_to": "2027-01-15T00:00:00Z",
        "serial_number": "289797283705493259445630949940925559092",
        "status": "Active"
      }
    }

    Error response — 404 Not Found

    No certificate installed:

    {
      "err_code": "00301",
      "message": "resource not found: failed to get certificate status"
    }

    Error response — 500 Internal Server Error

    Unexpected server error:

    {
      "err_code": "00601",
      "message": "System Error"
    }

    DLP Configuration API

    Configures the appliance’s connection to the DLP service. The trust certificate and the upstream host are set through separate endpoints. The DLP host configuration accepts only a host URL (no OAuth fields).

    GET /v1/config/dlp

    Returns the current DLP host and certificate configuration as a combined view. No request body.

    Example request

    GET /v1/config/dlp HTTP/1.1
    Host: <appliance_ip>:8443

    Success response — 200 OK

    DLP not configured yet:

    {
      "service": "dlp",
      "host_config_configured": false,
      "certificate_configured": false
    }

    DLP fully configured:

    {
      "service": "dlp",
      "host_config_configured": true,
      "host_config": {
        "host_url": "https://dlp.example.com"
      },
      "host_config_updated_at": "2026-01-15T00:00:00Z",
      "certificate_configured": true,
      "certificate": {
        "subject": "CN=dlp.example.com,OU=IT,O=Example Inc,L=San Jose,ST=California,C=US",
        "issuer": "CN=Example CA,O=Example Inc",
        "valid_from": "2026-01-15T00:00:00Z",
        "valid_to": "2027-01-15T00:00:00Z",
        "serial_number": "175930482619473850261947385026194738502"
      },
      "certificate_updated_at": "2026-01-15T00:00:00Z"
    }

    Error response — 409 Conflict

    Appliance has not finished enrollment yet:

    {
      "err_code": "00306",
      "message": "invalid resource state: appliance has not finished enrollment yet"
    }

    Error response — 500 Internal Server Error

    Unexpected server error:

    {
      "err_code": "00601",
      "message": "System Error"
    }

    PUT /v1/config/dlp/ca-cert

    Uploads the CA certificate the appliance uses to trust the DLP upstream service. The uploaded certificate must be a CA certificate and currently valid.

    Request body

    KeyTypeExampleDescription
    certificatestring"-----BEGIN CERTIFICATE-----..."Required. PEM-encoded CA certificate or chain (root + intermediates) (max 32768 chars).

    Example request

    PUT /v1/config/dlp/ca-cert HTTP/1.1
    Host: <appliance_ip>:8443
    Content-Type: application/json
    {
      "certificate": "-----BEGIN CERTIFICATE-----..."
    }
    Success response — 204 No Content. Empty body.

    Error response — 400 Bad Request

    Missing certificate:

    {
      "err_code": "00101",
      "message": "invalid format: validation error occurred in the request",
      "validation_errors": [
        {
          "field": "certificate",
          "error": "certificate is a required field"
        }
      ]
    }

    Certificate is not valid PEM/x509:

    {
    “err_code”: “00101”,
    “message”: “invalid format: failed to parse certificate: x509: malformed certificate”
    }
    Error response — 409 Conflict

    Appliance has not finished enrollment yet:

    {
      "err_code": "00306",
      "message": "invalid resource state: appliance has not finished enrollment yet"
    }

    Error response — 500 Internal Server Error

    unexpected server error:

    {
      "err_code": "00601",
      "message": "System Error"
    }

    PUT /v1/config/dlp/hostconfig

    Sets the DLP upstream host. See the connectivity note at the top of this section.

    Request body

    KeyTypeExampleDescription
    host_urlstring"https://dlp.example.com"Required. DLP upstream base URL (valid URL).

    Example request

    PUT /v1/config/dlp/hostconfig HTTP/1.1
    Host: <appliance_ip>:8443
    Content-Type: application/json
    {
      "host_url": "https://dlp.example.com"
    }

    Success response — 204 No Content. Empty body.

    Error response — 400 Bad Request

    Invalid host_url:

    {
      "err_code": "00101",
      "message": "invalid format: validation error occurred in the request",
      "validation_errors": [
        {
          "field": "host_url",
          "error": "host_url must be a valid URL"
        }
      ]
    }

    Error response — 409 Conflict

    Appliance has not finished enrollment yet:

    {
      "err_code": "00306",
      "message": "invalid resource state: appliance has not finished enrollment yet"
    }

    Error response — 500 Internal Server Error

    Unexpected server error:

    {
      "err_code": "00601",
      "message": "System Error"
    }

    DELETE /v1/config/dlp/hostconfig

    Removes the DLP host configuration. No request body.

    Example request

    DELETE /v1/config/dlp/hostconfig HTTP/1.1
    Host: <appliance_ip>:8443

    Success response — 204 No Content. Empty body.

    Error response — 409 Conflict

    Appliance has not finished enrollment yet:

    {
      "err_code": "00306",
      "message": "invalid resource state: appliance has not finished enrollment yet"
    }

    Error response — 500 Internal Server Error

    Unexpected server error:

    {
      "err_code": "00601",
      "message": "System Error"
    }

    AI Guardrails Configuration API

    Configures the appliance’s connection to the AI Guardrails service. The trust certificate and the upstream host are set through separate endpoints. Unlike DLP, the host configuration also accepts OAuth/JWT authentication fields.

    Configure AI Guardrails only after the appliance finishes enrollment. Until then, these endpoints return 409 Conflict.

    GET /v1/config/ai-guardrails

    Returns the current AI Guardrails host and certificate configuration as a combined view. No request body.

    Example request

    GET /v1/config/ai-guardrails HTTP/1.1
    Host: <appliance_ip>:8443

    Success response — 200 OK

    AI Guardrails not configured yet:

    {
      "service": "llm",
      "host_config_configured": false,
      "certificate_configured": false
    }

    AI Guardrails fully configured:

    {
      "service": "llm",
      "host_config_configured": true,
      "host_config": {
        "host_url": "https://llm.example.com",
        "jwt_url": "https://auth.example.com/oauth/token",
        "client_id": "aig-client",
        "client_secret": "********",
        "scope": "aig.read aig.write"
      },
      "host_config_updated_at": "2026-01-15T00:00:00Z",
      "certificate_configured": true,
      "certificate": {
        "subject": "CN=llm.example.com",
        "issuer": "CN=Example CA,O=Example Inc",
        "valid_from": "2026-01-15T00:00:00Z",
        "valid_to": "2027-01-15T00:00:00Z",
        "serial_number": "134817938427490195726719581068945320137"
      },
      "certificate_updated_at": "2026-01-15T00:00:00Z"
    }

    Error response — 409 Conflict

    Appliance has not finished enrollment yet:

    {
      "err_code": "00306",
      "message": "invalid resource state: appliance has not finished enrollment yet"
    }

    Error response — 500 Internal Server Error

    Unexpected server error:

    {
      "err_code": "00601",
      "message": "System Error"
    }

    PUT /v1/config/ai-guardrails/ca-cert

    Uploads the CA certificate the appliance uses to trust the AI Guardrails upstream service. The uploaded certificate must be a CA certificate and currently valid.

    Request body

    KeyTypeExampleDescription
    certificatestring"-----BEGIN CERTIFICATE-----..."Required. PEM-encoded CA certificate or chain (root + intermediates) (max 32768 chars).

    Example request

    PUT /v1/config/ai-guardrails/ca-cert HTTP/1.1
    Host: <appliance_ip>:8443
    Content-Type: application/json
    {
      "certificate": "-----BEGIN CERTIFICATE-----..."
    }

    Success response — 204 No Content. Empty body.

    Error response — 400 Bad Request

    Missing certificate:

    {
      "err_code": "00101",
      "message": "invalid format: validation error occurred in the request",
      "validation_errors": [
        {
          "field": "certificate",
          "error": "certificate is a required field"
        }
      ]
    }

    Certificate is not valid PEM/x509:

    {
      "err_code": "00101",
      "message": "invalid format: failed to parse certificate: x509: malformed certificate"
    }

    Error response — 409 Conflict

    Appliance has not finished enrollment yet:

    {
      "err_code": "00306",
      "message": "invalid resource state: appliance has not finished enrollment yet"
    }

    Error response — 500 Internal Server Error

    Unexpected server error:

    {
      "err_code": "00601",
      "message": "System Error"
    }

    PUT /v1/config/ai-guardrails/hostconfig

    Sets the AI Guardrails upstream host and OAuth/JWT authentication. See the connectivity note at the top of this section.

    Request body

    KeyTypeExampleDescription
    host_urlstring"https://llm.example.com"Required. Upstream service base URL (valid URL).
    jwt_urlstring"https://auth.example.com/oauth/token"Optional. OAuth/JWT token endpoint (valid URL).
    client_idstring"aig-client"Optional. OAuth client ID.
    client_secretstring"s3cr3t"Optional. OAuth client secret.
    scopestring"llm.read"Optional. OAuth scope.

    Example request

    PUT /v1/config/ai-guardrails/hostconfig HTTP/1.1
    Host: <appliance_ip>:8443
    Content-Type: application/json
    {
      "host_url": "https://llm.example.com",
      "jwt_url": "https://auth.example.com/oauth/token",
      "client_id": "aig-client",
      "client_secret": "YOUR_CLIENT_SECRET",
      "scope": "llm.read"
    }

    Success response — 204 No Content. Empty body.

    Error response — 400 Bad Request

    Invalid jwt_url:

    {
      "err_code": "00101",
      "message": "invalid format: validation error occurred in the request",
      "validation_errors": [
        {
          "field": "jwt_url",
          "error": "jwt_url must be a valid URL"
        }
      ]
    }

    Error response — 409 Conflict

    Appliance has not finished enrollment yet:

    {
      "err_code": "00306",
      "message": "invalid resource state: appliance has not finished enrollment yet"
    }

    Error response — 500 Internal Server Error

    Unexpected server error:

    {
      "err_code": "00601",
      "message": "System Error"
    }

    DELETE /v1/config/ai-guardrails/hostconfig

    Removes the AI Guardrails host configuration. No request body.

    Example request

    DELETE /v1/config/ai-guardrails/hostconfig HTTP/1.1
    Host: <appliance_ip>:8443

    Success response — 204 No Content. Empty body.

    Error response — 409 Conflict

    Appliance has not finished enrollment yet:

    {
      "err_code": "00306",
      "message": "invalid resource state: appliance has not finished enrollment yet"
    }

    Error response — 500 Internal Server Error

    Unexpected server error:

    {
    “err_code”: “00601”,
    “message”: “System Error”
    }

    In this Topic
    • Configuration API