Viewable Workspace List¶
GET /api/v1/wksp_share/granted_ws_list
Overview¶
Lists the authorized workspaces viewable by the current workspace, grouped by granting site.
Prerequisites and Usage Steps¶
Use an OpenAPI Key that has permissions such as routine.defaultAccess allowing reads on the target workspace. The current workspace is taken from the Key in the request header; do not pass workspaceUUID at this endpoint to switch workspaces.
Returns active authorization records explicitly granted to the current workspace, not a site-wide or same-organization workspace list. The authorization status must be valid active; cross-site mirror records whose synchronization failed and that have no resource summary at all are excluded, while records with an old summary may still be returned. For multiple namespaces, the same authorization record must contain all types; different authorizations are not combined into one to satisfy the requirement.
First obtain content[].regionCode, then use each data[].workspaceUUID to construct cross-workspace query targets. type/indexes/conditions and the actual query permissions must still be observed; appearing in the list does not guarantee that the current calling Key has query permission for every data type, that the source workspace is unlocked, or that the query downstream is available. The same-site lock status indication and the cross-site unknown null must be distinguished.
Grouped by source site, with each group paginated independently; the same pageIndex/pageSize applies to all groups. Each group's pageInfo is in content[].pageInfo; there is no top-level pageInfo. Continue querying each site whose total has not been fully read; it is recommended to use regionCode to pin one group and avoid missing pages. Ordinary records for sites without valid configuration may be ignored; external-organization cross-site records may still be displayed when they have their own site profile; an empty result is [].
Request Headers¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI authentication credential for the workspace. Example: <DF-API-KEY>How to obtain or fill in: Obtain an OpenAPI Key with this operation permission from API Key management in the target workspace. |
Query Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| namespace | commaArray | Optional comma-separated; items are trimmed and empty items are removed. For multiple types, a single valid authorization must contain all types at the same time; authorization * satisfies all. An unknown type does not equal an available authorization and usually has no match.Allows null: False Example: logging,tracingHow to obtain or fill in: Take the data types to query, such as logging/metric/tracing/rum/lineage/incidents, based on the granted type. |
|
| regionCode | string | Optional granting site code; the service treats a plain code and the same code with the custom: prefix as compatible, and subsequent queries still use the returned value.Allows null: False Example: site_exampleHow to obtain or fill in: Obtain it from the site list or from content[].regionCode of this API. |
|
| filterWsUUIDs | commaArray | Optional; filters only these source workspaces. The current implementation splits on commas and does not automatically trim each item, so callers should avoid spaces; this is not the list of recipient workspaces. Allows null: False Example: wksp_source_exampleHow to obtain or fill in: Take the granting party's workspaceUUID; separate multiple items with English commas. |
|
| search | string | Optional; performs a contains search on the granting party's workspaceName/workspaceUUID; it does not search target names.Allows null: False Example: productionHow to obtain or fill in: Take a keyword from the source workspace name or UUID. |
|
| pageIndex | integer | Optional; defaults to 1, minimum 1. The same page number applies to each site group; this is not site-wide unified pagination. Allows null: False $minValue: 1 Example: 1How to obtain or fill in: Start from 1 and read pagination separately for each site group. |
|
| pageSize | integer | Optional; defaults to 100, maximum 100. The total number of returned records may be greater than pageSize.Allows null: False $minValue: 1 $maxValue: 100 Example: 100How to obtain or fill in: Desired number of records per page for each site, 1..100. |
Additional Parameter Notes¶
This API is the recommended API for query_data to obtain the target workspace UUID and query.targetRegion.
content[j].regionCodeindicates the site to which the granted workspaces in the group belong and can be used directly asquery.targetRegion;data[k].regionCodewithin the group has the same meaning.- Find the target workspace in
content[j].databyworkspaceUUID, then use theregionCodeof the same group. Do not treattoRegionCodeas the target site; it indicates the recipient, that is, the site where the workspace to which the current API Key belongs is located. - You can filter granted data types with
namespace, for example, passnamespace=loggingwhen querying logs. - The API paginates each
regionCodegroup independently, andpageInfo.countis only the number of records on the current page. On the first call, you can omitregionCodeto discover target sites; afterward, explicitly passregionCodefor each target site and paginate independently starting frompageIndex=1. Stop when the site'spageInfo.totalCountis reached, or whenpageIndex * pageSize >= totalCountis satisfied; deduplicate by authorizationuuidand(regionCode, workspaceUUID)as recommended.
For details on how to organize requests, see: OpenAPI Cross-Site Data Query.
1. Return Parameter Description:
| Parameter | Description |
|---|---|
| regionCode | Granting site |
| regionName | Granting site name |
| workspaceName | Granting workspace name |
| workspaceUUID | Granting workspace UUID |
| toRegionCode | Recipient workspace site |
| toRegionName | Recipient workspace site name |
| toWorkspaceName | Recipient workspace name |
| toWorkspaceUUID | Recipient workspace UUID |
| type | Workspace authorization type: network, object, dialtest, billing, logging, tracing, metric, rum, keyevent, custom_object, security, profiling; * indicates authorization for all types |
| indexes | Authorized log index names; * indicates all |
Note: The returned content is an array grouped by granting site; each element's data contains the viewable workspace information for the current page of that site.
2. Example Description:
The recipient can view data authorized by the granting party.
In the example below, Workspace XX grants Workspace YY permission to view the testing log index, meaning Workspace YY can view the testing log index data of Workspace XX.
{
"createAt": 1749542060,
"creator": "acnt_c956fd23a9c2427b96ee372c88ea9b60",
"creatorInfo": {
},
"delayDeleteAt": -1,
"deleteAt": -1,
"id": 442,
"indexes": [
"testing"
],
"regionCode": "daily",
"regionName": "开发环境(daily)",
"status": 0,
"toRegionCode": "testing",
"toRegionName": "测试环境(testing)",
"toWorkspaceName": "YY",
"toWorkspaceUUID": "wksp_4b57c7bab38e4a2d9630f675dc20015d",
"type": [
"logging"
],
"updateAt": -1,
"updator": "",
"updatorInfo": {
},
"uuid": "grant_02b04aec78c74f869151e3e8c3e54dae",
"workspaceName": "XX",
"workspaceUUID": "wksp_6e310e0c1cbd45b4a27a19bda0fd7582"
}
Request Example¶
curl --get 'https://openapi.guance.com/api/v1/wksp_share/granted_ws_list' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-urlencode namespace=logging \
--data-urlencode pageIndex=1 \
--data-urlencode pageSize=100
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content | array<object> |
Grouped by granting site; [] when there is no match. |
| content[].regionCode | string | Source site code for the group; can be used as query_data query.targetRegion. |
| content[].regionName | string | Display name of the site for the group. |
| content[].data | array<object> |
Authorization records on the current page for the group; may be empty. |
| content[].data[].id | integer | Numeric ID of the authorization record. |
| content[].data[].uuid | string | grant_ authorization record UUID, not the source workspace UUID. |
| content[].data[].workspaceUUID | string | Granting party/data source workspace UUID; use this field for cross-workspace query targets. |
| content[].data[].workspaceName | string | Granting party workspace name. |
| content[].data[].toWorkspaceUUID | string | Recipient workspace UUID; for this API, usually the current workspace. |
| content[].data[].toWorkspaceName | string | Recipient workspace name. |
| content[].data[].regionCode | string | Granting site code; may include the custom: prefix. |
| content[].data[].toRegionCode | string | Recipient site; historical empty values for the same site may be normalized to the current site. |
| content[].data[].regionName | string | Granting site display name in the current language; falls back to site information or code when missing. |
| content[].data[].toRegionName | string | Recipient site display name. |
| content[].data[].type | array<string> or string or null |
Data types allowed by this record. Currently usually an array; historical values may be a comma-separated string/null; determine the actual type first. * indicates all authorization types, without ignoring other constraints. |
| content[].data[].type[] | string | Single type code. |
| content[].data[].indexes | array<string> or null |
Authorized scope of log indexes, possibly *; do not treat it as a generic resource list for all data types. Historical values may be null; determine the type first. |
| content[].data[].indexes[] | string | Single index name or *. |
| content[].data[].conditions | object or null | Authorized data filter conditions, stored by data type; they must not be deleted on your own and then used as the basis for query authorization. Historical values may be null and are not normalized by this formatter. |
content[].data[].conditions.<data-type> |
JSON | Full filter rules stored for that type; the structure follows the authorization configuration and may be a condition array/object. |
| content[].data[].siteRelationType | string | same_site/same_org_cross_site/external_org_cross_site; historical values are derived from the site. |
| content[].data[].grantMode | string | same_site or cross_site, derived from the site relationship. |
| content[].data[].grantStatus | string | The current valid authorization is active; pending/revoked, etc. are excluded by the validity filter. |
| content[].data[].syncStatus | string | Synchronization status of the cross-site resource summary, such as empty/success/failed. A failed record with a historical summary may still be returned. |
| content[].data[].lastSyncAt | integer or null | Last synchronization Unix seconds; null if not synchronized. |
| content[].data[].sourceBaseUrl | string | Historical field for the granting party's service root URL; may be empty. Client cross-workspace queries still go through an authorized public endpoint. |
| content[].data[].targetBaseUrl | string | Recipient service URL; may be empty. |
| content[].data[].delayDeleteAt | integer | Planned deletion Unix seconds; -1 if not planned. This does not replace the current valid authorization and validation at query time. |
| content[].data[].sourceWorkspaceAccess | object | Source workspace lock status object; always an object. When it can be confirmed on the same site, the internal fields have values; for cross-site/unconfirmable cases, the internal isLocked/lockMode are null. |
| content[].data[].sourceWorkspaceAccess.isLocked | integer or null | 0 unlocked / 1 locked; null if unknown. |
| content[].data[].sourceWorkspaceAccess.lockMode | string or null | none/writeLocked/readWriteLocked; null if unknown. The actual query is subject to the actual authorization/lock check. |
| content[].data[].status | integer | 0 for valid records. |
| content[].data[].creator | string | Creator identity. |
| content[].data[].updator | string | Updater identity. |
| content[].data[].createAt | integer | Creation Unix seconds. |
| content[].data[].updateAt | integer | Update Unix seconds; -1 if not updated. |
| content[].data[].deleteAt | integer | Deletion Unix seconds; -1 if not deleted. |
| content[].data[].extra | object | Extended information for cross-site authorization. tempAuthCode/tempAuthCodeHash are recursively removed, and the top-level authorizationCode is not returned. Other historical keys may exist depending on the record. |
| content[].data[].extra.recordRole | string | authority for the original authorization record or mirror for a mirrored record; may be omitted for ordinary same-site records. |
| content[].data[].extra.grantStatus | string | Extended status, consistent with the top-level output status; may be omitted. |
| content[].data[].extra.syncStatus | string | Extended synchronization status; may be omitted. |
| content[].data[].extra.lastSyncAt | integer | Last synchronization Unix seconds; may be omitted. |
| content[].data[].extra.lastSyncError | JSON | Most recent synchronization failure information; may be omitted; this is not the current HTTP failure. |
| content[].data[].extra.lastSyncErrorAt | integer | Most recent synchronization failure Unix seconds; may be omitted. |
| content[].data[].extra.tempAuthCodeExpireAt | integer | Historical temporary authorization expiration Unix seconds; may be omitted; the corresponding key is not returned. |
| content[].data[].extra.resourceSummary | object | Source resource summary for the cross-site mirror; may be omitted. The available catalog depends on the synchronization status. |
content[].data[].extra.resourceSummary.<data-type> |
object | Summary stored by category such as logging/rum/tracing/metric/lineage/incidents. |
content[].data[].extra.resourceSummary.<data-type>.workspaceUUIDs |
array<string> |
Array of source workspace UUIDs involved for that type; may be omitted. |
content[].data[].extra.resourceSummary.<data-type>.workspaceUUIDs[] |
string | Single source workspace UUID. |
content[].data[].extra.resourceSummary.<data-type>.indexInfos |
array<object> |
Log index summary (the historical indexes key may also be used); each item's fields depend on the synchronization version. |
content[].data[].extra.resourceSummary.<data-type>.indexInfos[].name |
string | Index name. |
content[].data[].extra.resourceSummary.<data-type>.indexInfos[].uuid |
string | Index UUID, if present. |
content[].data[].extra.resourceSummary.<data-type>.rumCfgInfos |
array<object> |
RUM application summary, if present. |
content[].data[].extra.resourceSummary.<data-type>.<other-fields> |
JSON | Other publicly stored fields of the source summary for that type; these are not writable parameters of this API. |
| content[].data[].extra.sourceSite | object | Cross-site source/target site profile; may be omitted. |
| content[].data[].extra.sourceSite.regionCode | string | Site code. |
| content[].data[].extra.sourceSite.siteCode | string | Site identifier alias. |
| content[].data[].extra.sourceSite.issuer | string | Issuer identifier. |
| content[].data[].extra.sourceSite.baseUrl | string | Site service root URL. |
| content[].data[].extra.sourceSite.jwksUri | string | Public signature verification key directory URL. |
| content[].data[].extra.sourceSite.kid | string | Signing public key ID. |
| content[].data[].extra.sourceSite.name | string | Display name; may be empty. |
| content[].data[].extra.sourceSite.publicKeys | array | Array of public signature verification materials, if included in the record; these are not private keys. |
| content[].data[].extra.sourceSite.publicKeys[] | object | One set of public signature verification material. |
| content[].data[].extra.sourceSite.publicKeys[].kid | string | Public key ID. |
| content[].data[].extra.sourceSite.publicKeys[].publicKey | string | Public signature verification public key content; not a private key. |
| content[].data[].extra.targetSite | object | Cross-site source/target site profile; may be omitted. |
| content[].data[].extra.targetSite.regionCode | string | Site code. |
| content[].data[].extra.targetSite.siteCode | string | Site identifier alias. |
| content[].data[].extra.targetSite.issuer | string | Issuer identifier. |
| content[].data[].extra.targetSite.baseUrl | string | Site service root URL. |
| content[].data[].extra.targetSite.jwksUri | string | Public signature verification key directory URL. |
| content[].data[].extra.targetSite.kid | string | Signing public key ID. |
| content[].data[].extra.targetSite.name | string | Display name; may be empty. |
| content[].data[].extra.targetSite.publicKeys | array | Array of public signature verification materials, if included in the record; these are not private keys. |
| content[].data[].extra.targetSite.publicKeys[] | object | One set of public signature verification material. |
| content[].data[].extra.targetSite.publicKeys[].kid | string | Public key ID. |
| content[].data[].extra.targetSite.publicKeys[].publicKey | string | Public signature verification public key content; not a private key. |
| content[].data[].extra.resourceSummary.updatedAt | number | Summary update time, provided by the source synchronization data; may be omitted. |
| content[].data[].extra.resourceSummary.sourceGrantUUID | string | Source site authorization record UUID; may be omitted. |
| content[].data[].extra.resourceSummary.logging.indexes | array | Log index summary retained by the current cross-site mirror; elements may be index names or objects returned by the source. |
| content[].data[].extra.resourceSummary.logging.indexes[] | string or object | Single log index name or summary object; fixed object fields are not guaranteed. |
| content[].data[].extra.resourceSummary.rum.applications | array | RUM application summary retained by the current cross-site mirror. |
| content[].data[].extra.resourceSummary.rum.applications[] | string or object | Single application identifier or source summary object; parse according to the actual synchronization version. |
| content[].pageInfo.pageIndex | integer | Current page number for the group. |
| content[].pageInfo.pageSize | integer | Number of records per page for the group. |
| content[].pageInfo.count | integer | Number of records on the current page for the group. |
| content[].pageInfo.totalCount | integer | Total number of valid authorizations for the group. |
| content[].declaration | object | Common declaration for the current calling workspace; not inserted into each record in data. |
{
"code": 200,
"content": [
{
"regionCode": "site_example",
"regionName": "示例站点",
"data": [
{
"id": 10,
"uuid": "grant_example",
"workspaceUUID": "wksp_source_example",
"workspaceName": "production",
"toWorkspaceUUID": "wksp_example",
"toWorkspaceName": "示例空间",
"regionCode": "site_example",
"toRegionCode": "site_example",
"regionName": "示例站点",
"toRegionName": "示例站点",
"type": [
"logging",
"tracing"
],
"indexes": [
"default"
],
"conditions": {},
"siteRelationType": "same_site",
"grantMode": "same_site",
"grantStatus": "active",
"syncStatus": "",
"lastSyncAt": null,
"sourceBaseUrl": "",
"targetBaseUrl": "",
"delayDeleteAt": -1,
"sourceWorkspaceAccess": {
"isLocked": 0,
"lockMode": "none"
},
"status": 0,
"creator": "acnt_example",
"updator": "",
"createAt": 1785427200,
"updateAt": -1,
"deleteAt": -1,
"extra": {}
}
],
"pageInfo": {
"pageIndex": 1,
"pageSize": 100,
"count": 1,
"totalCount": 1
},
"declaration": {}
}
],
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Responses¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed |
Using an undeclared Query parameter or a parameter violating the rules | Parameter parsing failed | Check the Query parameter table and examples. |
| 500 | ft.InternalServerError |
Failure to read workspace/site/authorization configuration, the database, or cache, or to format the response | Internal error | Retain the traceId and query conditions. If retries continue to fail, ask the administrator to check the configuration; do not infer that a site has no data from an empty result. |