- A token profile created on the Tokenization page, with a backing key. See Create tokenization profiles.
- At least one Control Rule on the profile’s Access tab that grants your role the operation you intend to run (tokenize, detokenize, partial detokenize, or batch). See Tokenization requirements and access.
- API access enabled and a way to authenticate. See Enable API access.
Choose an interface
You can run tokenization through either of two interfaces.- REST API: the v2 endpoints under
/api/v2/token-profiles/{uuid}. This is the recommended interface and the one documented here. - Host API: the binary command set (
TOKAto tokenize,TOKGto detokenize) for host-to-HSM integrations. The Host API is distinct from the REST API and returns detokenized data in a different format. For help with the Host API, contact support@futurex.com.
REST API detokenization appears in the clear.Host API detokenization is in the hexadecimal format.
Tokenize a single value
Tokenize one message by posting it to the profile’stokenize endpoint. The request body uses message. A successful response returns a token string.
Authenticate to the CryptoHub REST API and note the UUID of the token profile you want to use. The UUID appears on the profile in the Tokenization page and is returned by
GET /api/v2/token-profiles/stubs.If the request fails,
success is false and errorCode carries a machine-readable reason such as ArgumentParseError, InvalidSelection, or NotAuthorized. A 403 indicates the caller’s role is not granted the operation by a Control Rule on the profile’s Access tab.Detokenize a single value
Reverse a token by posting it to the profile’sdetokenize endpoint. The request body uses token, not message. Include iv only when the profile uses an initialization vector that was returned at tokenization time.
Confirm that your role is granted detokenization on the profile, either as a full or a partial Control Rule. The backing key must also allow the required reverse operation.
A partial Control Rule returns the value with only a configured number of characters revealed and the rest replaced by the rule’s mask character. See Tokenization requirements and access.
Tokenize or detokenize in batches
When you have several values, use the batch endpoints to process them in one request. Batch operations require a Control Rule that allows batch on the profile. The response returns results in the same order as the request.- Batch tokenize takes
messagesand returnstokens. - Batch detokenize takes
tokensand returnsmessages.
Batch tokenize request
Batch tokenize response
Batch detokenize request
Tokenize or detokenize track data
For payment card track data, use the track endpoints. These take and return atrack string rather than a message.
- Track tokenize takes
trackand returns the tokenizedtrack. - Track detokenize takes the tokenized
trackand returns the originaltrack.
Track tokenize request
Track tokenize response
Reference
For the full request and response schema of every endpoint, see the token-profiles endpoints and the generated reference for the endpoints under/api/v2/token-profiles/ (including tokenize, detokenize, batch-tokenize, batch-detokenize, track-tokenize, and track-detokenize).
