Help Center/ VPC Endpoint/ API Reference/ API/ VPC Endpoint Services/ Accepting or Rejecting a VPC Endpoint
Updated on 2025-05-15 GMT+08:00

Accepting or Rejecting a VPC Endpoint

Function

This API is used to accept or reject a VPC endpoint for a VPC endpoint service.

Calling Method

For details, see Calling APIs.

URI

POST /v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}/connections/action

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

vpc_endpoint_service_id

Yes

String

Specifies the ID of the VPC endpoint service.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. It can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token.

Content-Type

No

String

Specifies the MIME type of the request body. Default value application/json is recommended. For APIs used to upload objects or images, the MIME type varies depending on the flow type.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

action

Yes

String

Specifies whether to accept or reject a VPC endpoint for a VPC endpoint service.

  • receive: Accept the VPC endpoint.

  • reject: Reject the VPC endpoint.

endpoints

Yes

Array of strings

Specifies VPC endpoint IDs.

Each request accepts or rejects only one VPC endpoint.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

connections

Array of ConnectionEndpoints objects

Specifies the connection list.

Table 5 ConnectionEndpoints

Parameter

Type

Description

id

String

Specifies the unique ID of the VPC endpoint.

marker_id

Integer

Specifies the packet ID of the VPC endpoint.

created_at

String

Specifies when the VPC endpoint was created.

The UTC time format YYYY-MM-DDTHH:MM:SSZ is used.

updated_at

String

Specifies when the VPC endpoint was updated.

The UTC time format YYYY-MM-DDTHH:MM:SSZ is used.

domain_id

String

Domain ID of a user.

error

Array of QueryError objects

Specifies the error message.

This field is returned when the VPC endpoint is abnormal, that is, the value of status is failed.

status

String

Specifies the status of the VPC endpoint.

  • pendingAcceptance: The VPC endpoint is to be accepted.

  • creating: The VPC endpoint is being created.

  • accepted: The VPC endpoint has been accepted.

  • rejected: The VPC endpoint has been rejected.

  • failed: The VPC endpoint failed to be created.

  • deleting: The VPC endpoint is being deleted.

description

String

Specifies the description of a VPC endpoint connection.

Table 6 QueryError

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error message.

Example Requests

Accepting a connection from a VPC endpoint

POST https://{endpoint}/v1/{project_id}/vpc-endpoint-services/4189d3c2-8882-4871-a3c2- d380272eed88/connections/action

{
  "endpoints" : [ "705290f3-0d00-41f2-aedc-71f09844e879" ],
  "action" : "receive"
}

Example Responses

Status code: 200

The server has successfully processed the request.

{
  "connections" : [ {
    "id" : "4189d3c2-8882-4871-a3c2-d380272eed83",
    "status" : "accepted",
    "marker_id" : 422321321312321321,
    "domain_id" : "6e9dfd51d1124e8d8498dce894923a0d",
    "created_at" : "2022-04-14T09:35:47Z",
    "updated_at" : "2022-04-14T09:36:47Z"
  } ]
}

Status Codes

Status Code

Description

200

The server has successfully processed the request.

Error Codes

See Error Codes.