Skip to main content

Intent endpoint

To prevent exposing your access key, Authentication Cloud provides one-time tokens that are tied to a specific user and a specific intent. You can use this endpoint to request an intent token. When requesting an intent token, you need to specify the user for whom the token is issued and the purpose (intent) of the transaction that will be carried out. Use enroll for registering new users, and approve to sign a transaction for existing users.

HTTP request

POST https://{instance}.mauth.nevis.cloud/api/v1/intent

Parameters

 ParameterTypeRequired/OptionalDescription
usernamestringrequired if userId is not providedRepresents the user that is the subject of the registration or approval operation.
userIdUUIDrequired if username is not providedRepresents the user that is the subject of the registration or approval operation.
operationenumrequiredUse enroll to register a new user, and approve for authenticating transactions such as a login or payment approval.
channelsarrayoptionalSpecify the list of channels to restrict the token to one or more specific intent. Channels can be app, push or sms. By default, it adds all possible channels.

Example HTTP request

cURL code sample for requesting an intent token
curl "https://$instance.mauth.nevis.cloud/api/v1/intent" \
-XPOST \
-H "Authorization: Bearer $access_key" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d "{ \"username\":\"$username\",
\"operation\":\"enroll\" }"

HTTP response

FieldTypeDescription
tokenstringAn intent token that has the user and the purpose encoded. It is a one-time token to complete the transaction with the Authentication Cloud API.

Example HTTP response

200 OK

{
"token":"eyJhb...ZgP_8NBw"
}