Help Center/ Virtual Private Network/ API Reference/ API/ P2C VPN APIs/ Server/ Exporting the Client Configuration Corresponding to a VPN Server
Updated on 2026-10-22 GMT+08:00

Exporting the Client Configuration Corresponding to a VPN Server

Function

This API is used to export client configuration information based on a specified VPN server ID.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

vpn:p2cVpnGateway:exportClientConfig

write

p2cVpnGateway

g:ResourceTag/<tag-key>

-

-

URI

POST /v5/{project_id}/p2c-vpn-gateways/vpn-servers/{vpn_server_id}/client-config/export

Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Specifies a project ID. You can obtain the project ID by referring to Obtaining the Project ID.

vpn_server_id

String

Yes

Specifies the ID of a VPN server.

Request

  • Request parameters
    Table 2 Request parameters

    Parameter

    Type

    Mandatory

    Description

    os_type

    String

    No

    • Specifies the OS type.
    • Value range:

      Windows

      Linux

      macOS

      Android

      iOS

    • The default value is Windows.
  • Example request
    POST https://{Endpoint}/v5/{project_id}/p2c-vpn-gateways/vpn-servers/{vpn_server_id}/client-config/export
    
    {
      "os_type": "Windows"
    }

Response

  • Response parameters

    Returned status code 200: successful query

    Table 3 Parameters in the response body

    Parameter

    Type

    Description

    client_config

    string

    Specifies client configuration.

  • Example response
    {
        "client_config": "client\ndev tun\nproto tcp\nremote 215.xx.xx.99 443\nresolv-retry infinite\nnobind\npersist-key\npersist-tun\nremote-cert-tls server\ndata-ciphers AES-128-GCM\nauth SHA256\nverb 3\nauth-user-pass\n<ca>\n-----BEGIN CERTIFICATE-----*****-----END CERTIFICATE-----\n</ca>\n\n\nreneg-sec 0\n# Add a comment character (#) in front of disable-dco when OpenVPN 2.5 or earlier is used.\ndisable-dco\n"
    }

Status Codes

For details, see Status Codes.