Skip to main content

Create User Access Wallet API

Overview​

The Create User Access Wallet API is required for allowing users to be added into tenant groups in the Fabric core. You can set up such users using a JWT from their login.


Endpoint​

POST /tnt/:tid/user/access_wallet

Authentication​

This API requires a Tenant admin token in the request header:

Authorization: Bearer <token>

Path Parameters​

NameTypeRequiredDescription
tidstringYesTenant ID

Required Headers​

HeaderValue
Content-Typeapplication/json
Acceptapplication/json
AuthorizationBearer <token>

Request Body​

FieldRequiredDescription
jwtYesOAuth JWT

Example Request​

{
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Curl Example​

curl -X POST "https://<fabric-authority-url>/tnt/<tenantId>/user/access_wallet" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}'

Response​

Success Response (HTTP 200)​

Returned when the user access wallet is created successfully.

Fields​

FieldDescription
user_addrUser's wallet address (derived from the JWT)
created_wallet_addrNewly created user access wallet address
faucet.statusFunding status (success, already-funded, or failed)
faucet.errorError message if funding failed
faucet.claimedAmount claimed from the faucet (if any)
faucet.amount_transferredAmount transferred from the faucet
faucet.user_balanceUser wallet balance after funding

Example Success Response​

{
"user_addr": "0xabc123...",
"created_wallet_addr": "0xdef456...",
"faucet": {
"status": "success",
"error": "",
"claimed": 1,
"amount_transferred": 10,
"user_balance": 50
}
}

Error Responses​

Returned when the request is invalid or the admin is not authorized.

Bad Request (400)

{
"message": "invalid request body",
"error": "json parsing error"
}
{
"message": "invalid tenant_id",
"error": "cannot parse tenant id"
}

Unauthorized (401)

{
"message": "tenant admin, content admin, or admin auth required"
}

Common Error Messages​

MessageMeaning
invalid request bodyJSON is malformed or missing required fields
tenant admin, content admin, or admin auth requiredCaller is not authorized for this action
user address not foundCould not resolve user wallet address
error creating walletWallet creation failed
failedFaucet funding failed