Test cryptographic authentication

POST /auth/test-auth

Test endpoint to verify that a user's cryptographic authentication is working correctly. This endpoint validates the user's signature and public key.

application/json

Body Required

  • data object Required

    The actual request data to be processed

  • signature string Required

    ed25519 signature of the data, signed with user's private key

  • publicKey string Required

    User's derived public key for signature verification

  • timestamp integer Required

    Unix timestamp when the request was created (milliseconds)

  • nonce string Required

    Unique nonce to prevent replay attacks

Responses

  • 200 application/json

    Authentication test successful

    Hide response attributes Show response attributes object
    • success boolean
    • message string
    • userId string(uuid)

      ID of the authenticated user

    • publicKey string

      The public key used for authentication

  • 401 application/json

    Authentication failed

    Hide response attributes Show response attributes object
    • success boolean
    • error string

      Error message

    • errorCode string

      Machine-readable error code

    • details object

      Additional error details

    • timestamp string(date-time)

      When the error occurred

  • 429

    Rate limit exceeded

  • 500

    Internal server error

POST /auth/test-auth
curl \
 --request POST 'https://pay-api.aiic.nz/v1/auth/test-auth' \
 --header "X-Public-Key: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"data":{},"signature":"base64-encoded-signature","publicKey":"base64-encoded-public-key","timestamp":1703123456789,"nonce":"abc123-def456-ghi789"}'
Request examples
{
  "data": {},
  "signature": "base64-encoded-signature",
  "publicKey": "base64-encoded-public-key",
  "timestamp": 1703123456789,
  "nonce": "abc123-def456-ghi789"
}
Response examples (200)
{
  "success": true,
  "message": "Authentication successful",
  "userId": "string",
  "publicKey": "string"
}
Response examples (401)
{
  "success": false,
  "error": "Invalid request parameters",
  "errorCode": "INVALID_PARAMETERS",
  "details": {},
  "timestamp": "2025-05-04T09:42:00Z"
}