Skip to main content

Public Transfer Token

Allows or restricts free transfer of a token between holders. The call is asynchronous: it queues a PublicTransferToken transaction (type 8) and answers with its id. is_public on the token changes only when the transaction reaches 3 (Done); poll it with Get Token Transaction By ID.

A request for the value the token already has is refused (10027), and so is a request while an earlier change of this flag is still running (10028). The flag cannot tell the two apart on its own, because it only moves once a change settles.

Required permission: token:public-transfer

Request​

POST /v2/admin/tokens/{token_id}/public-transfer

Parameters​

NameTypeInDescription
token_idstringpathRequired. Token id.

Headers​

NameDescription
AuthorizationRequired. Bearer <access_token>
Content-TypeRequired. application/json

Body​

FieldTypeRequiredDescription
is_publicbooleanNotrue lets holders transfer the token freely, false restricts transfers. Omitted, it reads as false.

Example​

curl --request POST \
--url '{{baseUrl}}/v2/admin/tokens/67d8774e903bfcbe7eb5d93e/public-transfer' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{ "is_public": true }'

Response​

{
"transaction_id": "6a8b5e13f9129816a6cc7a12"
}

Response Fields​

FieldTypeDescription
transaction_idstringThe PublicTransferToken transaction. Poll it with Get Token Transaction By ID.

Errors​

StatusCodeDescription
40010015The body cannot be read (for example is_public is not a boolean)
40010016token_id is not a valid id
40010001Token not found (token domain 5)
40310005The caller's node does not cover the token's node (node domain 2)
40910027is_public already holds the requested value; nothing will happen (token domain 5)
40910028A change to this flag is already in progress; wait for its transaction to settle (token domain 5)

A failure after acceptance ends the transaction in status 4 (Error) with the reason in its error field. See Errors for the error format and common codes.