Skip to content

Get Current Tenant Information



GET /api/v1/tenant/resolve

Overview

Resolve the tenant that the current API Key belongs to and the bound user identifier.

Before Calling and Usage Steps

This endpoint is intended for integrations that require tenant resolution. Use the current workspace API Key with permission to access the endpoint; it does not accept Query or Body. tenantId is the current workspace UUID, and userId is the accountUUID of the Key. For manual workspace Keys, it is usually an empty string. token and expiresAt are currently always empty strings; no login Token or expiry credential is issued.

Results are cached for 1800 seconds based on the current Key resource UUID, so cached results may be returned first. Do not treat this endpoint as real-time permission, deletion, or expiry validation. A successful response returns a raw JSON object without code/content/success/declaration; errors use the common error envelope.

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 enter: Obtain an OpenAPI Key with this operation permission from API Key Management in the target workspace.

Request Example

curl --get 'https://openapi.guance.com/api/v1/tenant/resolve' \
  -H 'DF-API-KEY: <DF-API-KEY>'

Response

HTTP 200, raw application/json object; there is no unified success envelope or declaration. Errors use the common error structure.

Field Type Description
tenantId string UUID of the workspace that the current Key belongs to, used as the tenant identifier.
userId string Account UUID bound to the Key; for unbound manual Keys, "".
token string Currently a fixed empty string; not a usable authentication credential.
expiresAt string Currently a fixed empty string; not a Unix time or a promise of never expiring.
{
  "tenantId": "wksp_example",
  "userId": "",
  "token": "",
  "expiresAt": ""
}

Error Responses

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

HTTP Status errorCode Trigger Condition Message or Response Description Resolution
401 ft.InvalidAPIKey Cache miss and no active record for the current Key found in the current workspace Invalid API Key Confirm that the Key has not been deleted/disabled and belongs to the current workspace. Do not use the wsak_ resource UUID as the Key in the request header.
406 ft.NotFoundWorkspace The workspace corresponding to the Key does not exist/is inactive Specified workspace not found Confirm the workspace status and Key association.
500 ft.InternalServerError Failed to read workspace/site/authorization configuration, database or cache, or 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 from an empty result that the site has no data.

Feedback

Is this page helpful?