Create data publication¶
Publish all tables or specified tables in the source database to the target workspace. Successful creation only means that the publication has been established, but does not mean that the target workspace has accepted the subscription.
POST $CLOUDSIGMA_API_BASE/data-share/publishes
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. Prepare the personal access token, source workspace ID, source database ID, and target workspace ID that have access rights to the source workspace.
Request body¶
curl -X POST "$CLOUDSIGMA_API_BASE/data-share/publishes" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary @- <<JSON
{
"name": "sales-share",
"source_database_id": "${SOURCE_DATABASE_ID}",
"table_scope": {
"mode": "selected",
"object_ids": ["${TABLE_ID}"]
},
"target_workspace_ids": ["${TARGET_WORKSPACE_ID}"],
"remark": "共享销售数据"
}
JSON
The source list supports uint64 table IDs, but only numeric table IDs in the int64 range are recognized when creating a publication. Values exceeding this range will be processed according to the table name, and the wrong table may be selected.
table_scope can be omitted or filled in with null. When selecting all, the table ID list is ignored.
When selecting selected, fill in a non-empty table list. Omitting the list or filling in null or [] will be treated as the entire table. This interface does not have a fixed cap on the 1000 entry. Don’t use different source targeting methods at the same time.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Publication name. It must be nonempty, contain at most 200 characters, and contain no spaces, tabs, backticks, single quotes, or double quotes. |
|
string |
No |
Source database ID, supplied as a string containing a positive integer. |
|
object or null |
No |
Table scope configuration. See the current limitations below for the behavior when omitted or null. |
|
string |
Yes |
Scope: |
|
array or null |
No |
Physical table IDs used for selected scope. Empty values may be treated as all tables; see the current limitations. |
|
string |
No |
Association ID. |
|
string |
No |
Display information. |
|
string |
No |
Compatible object types. The value is empty string, |
|
string |
No |
Compatible object paths. |
|
array or null |
No |
List of compatible table names. |
|
array of string |
Yes |
At least one unique target workspace ID. It cannot contain the current workspace ID, and each value cannot have leading or trailing blanks. |
|
string |
No |
Remarks. |
|
array of string |
No |
List of table IDs used by |
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"id": "101",
"name": "sales-share",
"obj_display_name": "sales",
"obj_display_path": "catalog/sales",
"targets": [
{
"workspace_id": "ws-002",
"workspace_name": "分析工作区"
}
],
"permission": "readonly",
"remark": "共享销售数据",
"created_by": "user-001",
"created_at": "2026-08-18T10:00:00Z",
"updated_at": "2026-08-18T10:00:00Z",
"source_database_id": "1001",
"mo_database_name": "sales",
"table_scope": {
"mode": "selected",
"object_ids": [
"2001"
]
}
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
success code. |
|
string |
Response information. |
|
object |
The data returned by this operation. |
|
string |
Release ID. |
|
string |
Release name. |
|
string |
Source object name for display. |
|
string |
Source object path for display. |
|
array of object |
Target workspace list. |
|
string |
Target workspace ID. |
|
string |
Target workspace name. |
|
string |
Fixed to |
|
string |
Post notes. |
|
string |
Creator ID. |
|
string |
Creation time. |
|
string |
Last updated. |
|
string |
Source database ID. |
|
string |
Source database name in OmniFabric. |
|
object |
Published table range. |
|
string |
Table range mode. The values are |
|
array of string or null |
List of table IDs within publication scope. The entire table range may be null, and this cannot be used to determine that the table has not been published. |
Error response¶
Publishing requires data publishing permissions and access to source data. Publishing involves database, cross-workspace invitation and ownership registration, and some changes may have been completed after failure.
HTTP 409 may require manual repair, and HTTP 503 may indicate that a dependency is unavailable. Keep the request and tracking identifiers, query the publishing results first, and then decide whether to try again.
{
"code": "ErrDuplicatePublish",
"msg": "发布已存在",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
error code. |
|
string |
Error description. |
|
null |
Empty on error. |
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
403 |
|
The current identity or active role does not have permission for this operation. |
Use an authorized identity or contact an administrator to grant access. |
404 |
|
The target object or required reference was not found. |
Verify the object identifier, workspace, and current status. |
409 |
|
Conflict in resource state, request payload, or concurrent modification. |
Re-read the current state and version, then handle according to the latest result. |
500 |
|
Internal processing failed; write operations may have been partially applied. |
Retain request and trace details, and verify the current state before retrying. |
503 |
|
A business, runtime, or authorization dependency is temporarily unavailable. |
After the dependency recovers, check existing results first instead of blindly repeating writes. |