Accept data subscription

Accept a data subscription and specify the subscription database name in the target workspace.

HTTP
POST $CLOUDSIGMA_API_BASE/data-share/subscriptions/{id}/subscribe

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First query the data subscription list and confirm the subscription to be accepted. Prepare the personal access token, target workspace ID, subscription ID, and local subscription name that can access the target workspace.

Confirm that the current identity has the data_subscription.create permission of the target workspace. If you also need to query tables in the subscription, prepare credentials with SELECT permissions on the target table.

Request body

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/data-share/subscriptions/$SUBSCRIPTION_ID/subscribe" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "sub_name": "sales_subscription"
  }'

The subscription database is built under the default shared Catalog, and other locations cannot be specified.

Path parameters

Field

Type

Required

Description

id

integer

Yes

Subscription ID greater than 0.

Request body

Field

Type

Required

Description

sub_name

string

Yes

Target subscription database name, 1 to 200 characters, no spaces, tabs, or quotes allowed.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": "201",
    "pub_name": "sales-share",
    "source_database_id": "101",
    "mo_database_name": "sales",
    "table_scope": {
      "mode": "selected",
      "object_ids": [
        "1001"
      ]
    },
    "target_database_id": "301",
    "obj_display_name": "sales",
    "obj_display_path": "catalog/sales",
    "source_workspace_id": "ws-001",
    "source_workspace_name": "数据工作区",
    "publisher": "user-001",
    "published_at": "2026-08-18T10:00:00Z",
    "status": "subscribed",
    "sub_name": "sales_subscription",
    "subscribed_by": "user-002",
    "created_at": "2026-08-18T10:00:00Z"
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data

object

response data.

data.id

string

Subscription ID.

data.pub_name

string

Source release name.

data.source_database_id

string

Source database ID.

data.mo_database_name

string

Source database name.

data.table_scope

object

Publish a shared table range.

data.target_database_id

string

The ID of the subscription database in the target workspace. Return after successful acceptance.

data.obj_display_name

string

The display name of the source database.

data.obj_display_path

string

The display path of the source database.

data.source_workspace_id

string

Source workspace ID.

data.source_workspace_name

string

Source workspace name. Returned if there is a value.

data.publisher

string

Publisher.

data.published_at

string

Release time.

data.status

string

Current subscription status: unsubscribed, subscribing or subscribed.

data.sub_name

string

The name of the subscription database in the target workspace.

data.subscribed_by

string

The identity to accept the subscription.

data.created_at

string

Time to accept subscription.

data.table_scope.mode

string

Range mode: all or selected.

data.table_scope.object_ids

array of string

List of table IDs when range mode is selected.

Error response

JSON
{
  "code": "ErrAlreadySubscribed",
  "msg": "数据已订阅",
  "data": null
}

Field

Type

Description

code

string

error code.

msg

string

Error description.

data

null

Empty on error.

Last updated on