Updated on 2026-01-20 GMT+08:00

Setting a Shared Connection

Function

This API is used to add a shared connection.

Authorization Information

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

  • If you are using role/policy-based authorization, see the required permissions in Permissions Policies and Supported Actions.
  • 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

    das:connection:createShareConnections

    Write

    Connection

    das:TargetOrgPath

    das:TargetOrgId

    das:TargetAccountId

    -

    -

URI

POST /v3/{project_id}/connections/share

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters, including only letters and digits.

Default Value

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

shared_conn_id

Yes

String

Definition

ID of a shared connection established between a database account and the database. The database user ID is created using the API in Creating an Instance Connection.

Constraints

N/A

Range

The value is a UUID containing 36 characters. Only letters, digits, and hyphens (-) are allowed.

Default Value

N/A

expired_time

No

String

Definition

Expiration time

Constraints

Format: yyyy-MM-ddTHH:mm:ss.SSSZ

Range

N/A

Default Value

N/A

users

Yes

Array of ShareConnUserInfo objects

Definition

User

Constraints

Multiple values need to be separated by commas (,).

Range

N/A

Default Value

N/A

Table 3 ShareConnUserInfo

Parameter

Mandatory

Type

Description

user_id

Yes

String

Definition

User ID

Constraints

N/A

Range

N/A

Default Value

N/A

user_name

Yes

String

Definition

Username

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

None

Example Requests

Setting a shared link

POST https://{{endpoint}}/v3/{{project_id}}/connections/share 
{ 
  "shared_conn_id": "ee64e597-4f25-486f-bba1-0c850b3b59d6", 
  "users": [ 
    { 
      "user_id": "0852a89ae180d5401f5ac00271a4a02e", 
      "user_name": "username" 
    } 
  ], 
  "expired_time": "2023-05-03T10:30:00.200Z" 
}

Example Responses

None

Status Codes

Status Code

Description

200

Successful response

400

Bad request

500

Internal server error

Error Codes

See Error Codes.