Cancel a verification request

You can send a cancellation request to the Verify API to terminate the verification process, even if the user supplied the correct code.

Where needed, replace the following variables in the sample code with your own values:

KeyDescription
JWT

Used to authenticate your request. See Authentication for more information, including how to generate a JWT.

REQUEST_ID

The ID of the Verify request (this is returned in the API response when you send a verification code)

VONAGE_APPLICATION_PRIVATE_KEY_PATH

Private key path.

VONAGE_APPLICATION_ID

The Vonage Application ID.

Write the code

Add the following to cancel-request.sh:

curl -X DELETE "https://api.nexmo.com/v2/verify/$VERIFY_REQUEST_ID" \
  -H "Authorization: Bearer $JWT"\
  -H 'Content-Type: application/json'

View full source

Run your code

Save this file to your machine and run it:

sh cancel-request.sh