Skip to content

Generate a Cross-Site Grant meta



POST /api/v1/workspace_data/cross_site_grant/meta/create

Overview

Generates a pending record and a transferable signed grant package on the data grantor side.

Prerequisites and Usage Steps

Use an API Key with the dataRightsManage.workspaceConfigManage permission; the workspace is determined by the Key. The grantor is the workspace that provides the data, and the grantee is the target workspace that queries the data; the two must be different workspaces. For the Deployment Plan, first follow the Deployment Plan cross-site grant usage instructions to complete the version, local site identity, certificate, and allowed cross-site relationship configuration. The private key is kept on the server by the administrator and is not placed in the request or the grant package.

Call this API on the grantor site, and explicitly specify the target UUID, data types, and log indexes. A default or empty type and indexes may be expanded to grant everything, so explicitly specify the minimum required scope. HTTP 200 returns a JSON object and a suggested fileName; it is not a file download. After checking success, save content.meta separately as a JSON file and deliver it securely to the grantee to import following Import meta. The public keys, JWS, and timestamps in the examples are illustrative only and cannot be reused directly.

Generation only saves a pending record on the source side. It does not proactively access the target site, and it does not mean the grant has taken effect. Expiration defaults to 1800 seconds and can be overridden by site configuration; use expireAt as the authoritative value. If a pending or active record already exists for the same source/target, the request may be rejected, and a new package is not generated automatically just because the scope changed or the package expired; first verify against the grant record list, revoke/delete the old record according to the grant workflow, and then generate again. After a failure or timeout, check the record first instead of blindly retrying the create operation. Subsequent scope modifications and revocations still use grant record management.

Request Headers

Parameter Name 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 the required permission from the API Key management of the target workspace.

Body Request Parameters

Parameter Name Type Required Description
type[*] string A single data category; including * means all. Available categories also include object/custom_object/keyevent/security/network/profiling, etc., subject to the query capabilities of the target.
Example: logging
How to obtain or fill in: Select from the required data categories and avoid misusing the wildcard.
indexes[*] string A single log index name. Normalization converts it to a string and trims leading and trailing spaces.
Example: default
How to obtain or fill in: Obtain the name from the log index list.
conditions.metric array Optional condition array; leaving it empty or setting [] means no additional conditions are added for this category, which is not the same as prohibiting the category.
Example: [{"name": "host", "op": "in", "logic": "and", "value": ["host-example"]}]
How to obtain or fill in: Configure based on existing metric data fields and tags.
conditions.metric[*] object Each item must be an object; do not substitute a string or null.
Example: {"name": "host", "op": "in", "logic": "and", "value": ["host-example"]}
How to obtain or fill in: Enter one field condition per item.
conditions.metric[*].name string The field name to match, not a display alias. Creation validation does not fully verify that the field exists, so validate the scope with controlled data.
Example: host
How to obtain or fill in: Obtain from the actual field/tag name on the grantor side.
conditions.metric[*].op string Only in (include) and not in (exclude) are supported; symbols such as = are not supported.
Example: in
How to obtain or fill in: Choose in or not in.
conditions.metric[*].logic string Mixing different logics within the same category returns 406; unknown logic is not fully rejected, so clients should only use and/or and must not rely on lenient branches.
Example: and
How to obtain or fill in: Use and or or consistently within the same data category.
conditions.metric[*].value array Must be an array; elements should use values that match the real field, and a comma-separated string must not be used instead of an array.
Example: ["host-example"]
How to obtain or fill in: Enter the actual allowed/excluded values of the field.
conditions.metric[*].value[*] Actual field value A single value to match; its type and case should be consistent with the data.
Example: host-example
How to obtain or fill in: Obtain from the actual value of the corresponding field.
conditions.tracing array Optional condition array; leaving it empty or setting [] means no additional conditions are added for this category, which is not the same as prohibiting the category.
Example: [{"name": "host", "op": "in", "logic": "and", "value": ["host-example"]}]
How to obtain or fill in: Configure based on existing tracing data fields and tags.
conditions.tracing[*] object Each item must be an object; do not substitute a string or null.
Example: {"name": "host", "op": "in", "logic": "and", "value": ["host-example"]}
How to obtain or fill in: Enter one field condition per item.
conditions.tracing[*].name string The field name to match, not a display alias. Creation validation does not fully verify that the field exists, so validate the scope with controlled data.
Example: host
How to obtain or fill in: Obtain from the actual field/tag name on the grantor side.
conditions.tracing[*].op string Only in (include) and not in (exclude) are supported; symbols such as = are not supported.
Example: in
How to obtain or fill in: Choose in or not in.
conditions.tracing[*].logic string Mixing different logics within the same category returns 406; unknown logic is not fully rejected, so clients should only use and/or and must not rely on lenient branches.
Example: and
How to obtain or fill in: Use and or or consistently within the same data category.
conditions.tracing[*].value array Must be an array; elements should use values that match the real field, and a comma-separated string must not be used instead of an array.
Example: ["host-example"]
How to obtain or fill in: Enter the actual allowed/excluded values of the field.
conditions.tracing[*].value[*] Actual field value A single value to match; its type and case should be consistent with the data.
Example: host-example
How to obtain or fill in: Obtain from the actual value of the corresponding field.
conditions.rum array Optional condition array; leaving it empty or setting [] means no additional conditions are added for this category, which is not the same as prohibiting the category.
Example: [{"name": "host", "op": "in", "logic": "and", "value": ["host-example"]}]
How to obtain or fill in: Configure based on existing rum data fields and tags.
conditions.rum[*] object Each item must be an object; do not substitute a string or null.
Example: {"name": "host", "op": "in", "logic": "and", "value": ["host-example"]}
How to obtain or fill in: Enter one field condition per item.
conditions.rum[*].name string The field name to match, not a display alias. Creation validation does not fully verify that the field exists, so validate the scope with controlled data.
Example: host
How to obtain or fill in: Obtain from the actual field/tag name on the grantor side.
conditions.rum[*].op string Only in (include) and not in (exclude) are supported; symbols such as = are not supported.
Example: in
How to obtain or fill in: Choose in or not in.
conditions.rum[*].logic string Mixing different logics within the same category returns 406; unknown logic is not fully rejected, so clients should only use and/or and must not rely on lenient branches.
Example: and
How to obtain or fill in: Use and or or consistently within the same data category.
conditions.rum[*].value array Must be an array; elements should use values that match the real field, and a comma-separated string must not be used instead of an array.
Example: ["host-example"]
How to obtain or fill in: Enter the actual allowed/excluded values of the field.
conditions.rum[*].value[*] Actual field value A single value to match; its type and case should be consistent with the data.
Example: host-example
How to obtain or fill in: Obtain from the actual value of the corresponding field.
conditions.lineage array Optional condition array; leaving it empty or setting [] means no additional conditions are added for this category, which is not the same as prohibiting the category.
Example: [{"name": "host", "op": "in", "logic": "and", "value": ["host-example"]}]
How to obtain or fill in: Configure based on existing lineage data fields and tags.
conditions.lineage[*] object Each item must be an object; do not substitute a string or null.
Example: {"name": "host", "op": "in", "logic": "and", "value": ["host-example"]}
How to obtain or fill in: Enter one field condition per item.
conditions.lineage[*].name string The field name to match, not a display alias. Creation validation does not fully verify that the field exists, so validate the scope with controlled data.
Example: host
How to obtain or fill in: Obtain from the actual field/tag name on the grantor side.
conditions.lineage[*].op string Only in (include) and not in (exclude) are supported; symbols such as = are not supported.
Example: in
How to obtain or fill in: Choose in or not in.
conditions.lineage[*].logic string Mixing different logics within the same category returns 406; unknown logic is not fully rejected, so clients should only use and/or and must not rely on lenient branches.
Example: and
How to obtain or fill in: Use and or or consistently within the same data category.
conditions.lineage[*].value array Must be an array; elements should use values that match the real field, and a comma-separated string must not be used instead of an array.
Example: ["host-example"]
How to obtain or fill in: Enter the actual allowed/excluded values of the field.
conditions.lineage[*].value[*] Actual field value A single value to match; its type and case should be consistent with the data.
Example: host-example
How to obtain or fill in: Obtain from the actual value of the corresponding field.
targetWorkspaceUUID string Conditionally required; use at least one of this field and workspaceUUID. When both are submitted, this field takes precedence. It must be non-empty, contain no leading or trailing spaces, use the wksp_ prefix, contain no Chinese characters, and must not equal the grantor's current workspace; this call does not contact the target to verify that it actually exists.
Allows null: False
Allows empty string: False
Example: wksp_target
How to obtain or fill in: The grantee obtains the uuid from the target workspace information and provides it; using this field is recommended.
workspaceUUID string Has the same meaning as the target workspace and has lower priority than targetWorkspaceUUID; it does not specify the source workspace of this API.
Allows null: False
Allows empty string: False
Example: wksp_target
How to obtain or fill in: Compatibility field for legacy clients; new calls should only fill in targetWorkspaceUUID.
type array Optional array; omitted/null/empty array are all normalized to ["*"], meaning all categories, which is not zero grants! Array elements are converted to strings; the category enumeration is not fully validated currently, so use categories actually supported by the target.
Allows null: True
Example: ["logging", "metric"]
How to obtain or fill in: Explicitly select the data categories to grant; for example, logging for logs, metric for metrics, tracing for traces, rum for RUM, and lineage for lineage.
indexes array Optional array; omitted/empty array is normalized to ["*"]; retained only when type includes logging or *, otherwise cleared to []. * means all log indexes, so use it with caution.
Allows null: False
Example: ["default"]
How to obtain or fill in: Obtain from the name in the grantor's log index list, not the index UUID.
conditions json Optional JSON object; omitted/{} means no additional filtering. metric/tracing/rum/lineage are configured separately, and other categories do not use these four sub-conditions. The nested shape is not fully validated, so you must ensure each item is an object yourself.
Allows null: False
Example: {"metric": [{"name": "host", "op": "in", "logic": "and", "value": ["host-example"]}]}
How to obtain or fill in: Construct based on the grantor's real fields and allowed values, and use only the four condition types confirmed on this page.

Additional Parameter Notes

The grantor generates the cross-site grant meta file. The frontend or caller must first complete the CrossSiteGrantCfg public/private key initialization on the grantor site.

For details, see: Deployment Plan cross-site grant usage instructions

  • Use Cases: After the user selects "cross-site grant", call this API in the grantor workspace to generate the meta, and then deliver the complete meta to the grantee for import.
  • Deployment Plan services must be upgraded to at least the 2026-06-03 release before they support the new cross-site grant method.
  • This API only creates a pending record on the grantor side and returns the meta; it does not proactively access the grantee site.
  • The generated business grant record is still viewed via /wksp_share/list, its grant scope is modified via /wksp_share/<uuid>/modify, and it is deleted or revoked via /wksp_share/delete.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/workspace_data/cross_site_grant/meta/create' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"targetWorkspaceUUID":"wksp_target","type":["logging"],"indexes":["default"],"conditions":{}}'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content.grantUUID string UUID of the pending grant record on the source side.
content.status string pending when this API succeeds; activation requires subsequent import on the target side.
content.expireAt integer Package expiration time, in Unix seconds.
content.fileName string Suggested file name to save, in the format cross-site-grant-{target workspace UUID}-{expireAt}.json; the file content should contain only content.meta.
content.meta object The grant package that must be delivered in full.
content.declaration object or null Workspace public declaration for a non-empty business object; may be null or an empty object when not configured; not attached for empty business objects.
content.meta.version string Protocol version generated; currently 2026-05-27, keep the original value.
content.meta.metaUUID string Identifier of this grant package, used in subsequent exchanges.
content.meta.createdAt integer Generation time, in Unix seconds.
content.meta.expireAt integer Grant package expiration time, in Unix seconds; it must be imported before this time.
content.meta.sourceWorkspace object Information about the data grantor workspace.
content.meta.sourceWorkspace.workspaceUUID string UUID of the grantor workspace, determined by the source API Key.
content.meta.sourceWorkspace.workspaceName string Snapshot of the source workspace name, which may be empty.
content.meta.targetWorkspaceUUID string UUID of the grantee workspace; must equal the workspace of the Key used for import.
content.meta.sourceSite object Identity and access address of the grantor site, provided by the server; do not fill in or replace the brand/domain yourself.
content.meta.sourceSite.siteCode string Site code of the grantor.
content.meta.sourceSite.regionCode string Region code of the grantor, passed through as the original value in the package.
content.meta.sourceSite.name string Site display name.
content.meta.sourceSite.issuer string Signing identity of the grantor.
content.meta.sourceSite.baseUrl string Base URL of the grantor API that the importing server actively requests; it must be provided by a trusted grantor and be reachable.
content.meta.sourceSite.jwksUri string Address of the grantor's public key material.
content.meta.sourceSite.kid string Identifier of the currently active signing Key.
content.meta.sourceSite.publicKeys array<object> Set of public keys filtered by the server; does not include private keys.
content.meta.sourceSite.publicKeys[*] object A single piece of public key material.
content.meta.sourceSite.publicKeys[*].kid string Identifier of the corresponding public key.
content.meta.sourceSite.publicKeys[*].publicKey string PEM public key body, not a private key or API Key.
content.meta.grantScope object Normalized grant scope.
content.meta.grantScope.type array<string> Array of data categories.
content.meta.grantScope.type[*] string A single category or *.
content.meta.grantScope.indexes array<string> Array of log index names; may be [] for non-log grants.
content.meta.grantScope.indexes[*] string Index name or *.
content.meta.grantScope.conditions object The four types of filter conditions; the structure is the same as the conditions in the create request and must be preserved in full.
content.meta.auth object Temporary authentication information for this operation, which should be delivered securely to the grantee.
content.meta.auth.tempAuthCode string 32-character lowercase hexadecimal temporary code used for a single exchange; deliver it in full after generation. It is not a long-term API Key.
content.meta.auth.tempAuthCodeExpireAt integer Expiration time of the temporary code, in Unix seconds; both this and the package expiration must be satisfied.
content.meta.security object Signature algorithm and Key material.
content.meta.security.signAlg string Currently RS256.
content.meta.security.kid string Identifier of the Key that generated the signature.
content.meta.signature string Complete JWS signature; the placeholder values in the examples cannot be used for import.
content.meta.grantScope.conditions.metric array Optional condition array; leaving it empty or setting [] means no additional conditions are added for this category, which is not the same as prohibiting the category.
content.meta.grantScope.conditions.metric[*] object Each item must be an object; do not substitute a string or null.
content.meta.grantScope.conditions.metric[*].name string The field name to match, not a display alias. Creation validation does not fully verify that the field exists, so validate the scope with controlled data.
content.meta.grantScope.conditions.metric[*].op string Only in (include) and not in (exclude) are supported; symbols such as = are not supported.
content.meta.grantScope.conditions.metric[*].logic string Mixing different logics within the same category returns 406; unknown logic is not fully rejected, so clients should only use and/or and must not rely on lenient branches.
content.meta.grantScope.conditions.metric[*].value array Must be an array; elements should use values that match the real field, and a comma-separated string must not be used instead of an array.
content.meta.grantScope.conditions.metric[*].value[*] Actual field value A single value to match; its type and case should be consistent with the data.
content.meta.grantScope.conditions.tracing array Optional condition array; leaving it empty or setting [] means no additional conditions are added for this category, which is not the same as prohibiting the category.
content.meta.grantScope.conditions.tracing[*] object Each item must be an object; do not substitute a string or null.
content.meta.grantScope.conditions.tracing[*].name string The field name to match, not a display alias. Creation validation does not fully verify that the field exists, so validate the scope with controlled data.
content.meta.grantScope.conditions.tracing[*].op string Only in (include) and not in (exclude) are supported; symbols such as = are not supported.
content.meta.grantScope.conditions.tracing[*].logic string Mixing different logics within the same category returns 406; unknown logic is not fully rejected, so clients should only use and/or and must not rely on lenient branches.
content.meta.grantScope.conditions.tracing[*].value array Must be an array; elements should use values that match the real field, and a comma-separated string must not be used instead of an array.
content.meta.grantScope.conditions.tracing[*].value[*] Actual field value A single value to match; its type and case should be consistent with the data.
content.meta.grantScope.conditions.rum array Optional condition array; leaving it empty or setting [] means no additional conditions are added for this category, which is not the same as prohibiting the category.
content.meta.grantScope.conditions.rum[*] object Each item must be an object; do not substitute a string or null.
content.meta.grantScope.conditions.rum[*].name string The field name to match, not a display alias. Creation validation does not fully verify that the field exists, so validate the scope with controlled data.
content.meta.grantScope.conditions.rum[*].op string Only in (include) and not in (exclude) are supported; symbols such as = are not supported.
content.meta.grantScope.conditions.rum[*].logic string Mixing different logics within the same category returns 406; unknown logic is not fully rejected, so clients should only use and/or and must not rely on lenient branches.
content.meta.grantScope.conditions.rum[*].value array Must be an array; elements should use values that match the real field, and a comma-separated string must not be used instead of an array.
content.meta.grantScope.conditions.rum[*].value[*] Actual field value A single value to match; its type and case should be consistent with the data.
content.meta.grantScope.conditions.lineage array Optional condition array; leaving it empty or setting [] means no additional conditions are added for this category, which is not the same as prohibiting the category.
content.meta.grantScope.conditions.lineage[*] object Each item must be an object; do not substitute a string or null.
content.meta.grantScope.conditions.lineage[*].name string The field name to match, not a display alias. Creation validation does not fully verify that the field exists, so validate the scope with controlled data.
content.meta.grantScope.conditions.lineage[*].op string Only in (include) and not in (exclude) are supported; symbols such as = are not supported.
content.meta.grantScope.conditions.lineage[*].logic string Mixing different logics within the same category returns 406; unknown logic is not fully rejected, so clients should only use and/or and must not rely on lenient branches.
content.meta.grantScope.conditions.lineage[*].value array Must be an array; elements should use values that match the real field, and a comma-separated string must not be used instead of an array.
content.meta.grantScope.conditions.lineage[*].value[*] Actual field value A single value to match; its type and case should be consistent with the data.
{
  "code": 200,
  "content": {
    "grantUUID": "grant_example",
    "status": "pending",
    "expireAt": 1785429000,
    "fileName": "cross-site-grant-wksp_target-1785429000.json",
    "meta": {
      "version": "2026-05-27",
      "metaUUID": "meta_example",
      "createdAt": 1785427200,
      "expireAt": 1785429000,
      "sourceWorkspace": {
        "workspaceUUID": "wksp_source",
        "workspaceName": "授权方空间"
      },
      "targetWorkspaceUUID": "wksp_target",
      "sourceSite": {
        "siteCode": "source-region",
        "regionCode": "source-region",
        "name": "Guance 示例站点",
        "issuer": "https://source-site.example",
        "baseUrl": "https://source-site.example",
        "jwksUri": "https://source-site.example/api/v1/workspace_data/.well-known/cross-site-jwks.json",
        "kid": "key-example",
        "publicKeys": [
          {
            "kid": "key-example",
            "publicKey": "<服务端生成的PEM公钥>"
          }
        ]
      },
      "grantScope": {
        "type": [
          "logging"
        ],
        "indexes": [
          "default"
        ],
        "conditions": {}
      },
      "auth": {
        "tempAuthCode": "0123456789abcdef0123456789abcdef",
        "tempAuthCodeExpireAt": 1785429000
      },
      "security": {
        "signAlg": "RS256",
        "kid": "key-example"
      },
      "signature": "<真实授权方响应的JWS,示例不能导入>"
    },
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Response

For authentication, rate limiting, and common request errors, see Common Error Definitions.

conditions itself is already constrained to an object by the public JSON type validation; internal validation still defends against non-objects, but for normal clients this error is first classified as parameter 406. The shape of nested lists/individual items is not fully validated and may cause 500; it is not claimed that all invalid conditions will produce a dedicated 406.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed A request field is missing, or a field value violates the declared validation constraints Parameter parsing failed Verify the parameter location, field name, type, and value.
400 ft.RequestJsonFormatError The request JSON syntax is invalid Request JSON format error Fix the JSON according to content.reason, line, and column.
400 ft.JsonFormatError The top level of the request JSON is not an object Some json file format errors Submit a JSON object according to the request example.
406 ft.CrossSiteGrantSiteIdentityMissing The current site identity configuration is incomplete The local site identity configuration for cross-site grant is incomplete. Check the global frontApiServerUrlPrefixFormat, or the CrossSiteGrantCfg custom issuer/baseUrl/jwksUri and certificate keyId configuration The administrator checks the local site identity and address according to the deployment guide.
406 ft.CrossSiteGrantCertificateInvalid The current site's valid signing certificate is not initialized or is incomplete The cross-site grant certificate is not initialized or is incomplete. Run the cross-site grant certificate initialization script first The administrator initializes/repairs the active certificate; do not upload private keys to this API.
406 ft.CrossSiteGrantBeAccessedDisabled Both the same-organization and external-organization be-accessed switches are disabled on this site Cross-site grant is not enabled. Enable the same-organization or external-organization grantee configuration The administrator enables the corresponding be-accessed capability according to the actual relationship.
406 ft.CrossSiteGrantTargetWorkspaceInvalid The valid target UUID is missing or its format does not meet the requirements The grantee workspace UUID is invalid. Check and re-enter it Obtain the actual wksp_ UUID from the grantee; do not enter a name, Chinese characters, or leading/trailing spaces.
406 ft.WKSPIllegalAuthorization The target UUID equals the current grantor workspace Data grant requires specifying a workspace ID other than the current one. Please re-enter it Use a different target workspace.
406 ft.WKSPRepeatAuthorization A pending, active, or compatible valid grant record already exists for the same source/target The workspace has already been granted. Do not grant repeatedly! Check the grant records first, then complete/revoke the old grant; do not generate in a loop.
406 ft.WorkspaceGrantConditionOperatorInvalid The op of one of the four condition types is not in/not in The operator of the {} condition in the grant scope supports only in or not in Modify according to the condition description.
406 ft.WorkspaceGrantConditionValueMustBeList The condition value is not an array The value field of the {} condition in the grant scope must be a list Change it to an array.
406 ft.WorkspaceGrantConditionLogicMixed Conditions in the same category mix different logics The {} conditions in the grant scope do not support mixing different logical operators Use a consistent logic for that category.
500 ft.InternalServerError Incorrect nested shape of conditions, or an exception in signature generation, storage, or response assembly Internal error First verify the condition structure and the source grant records, then handle according to traceId; an error does not mean no pending record exists.

Feedback

Is this page helpful?