Skip to main content
GET
/
integration
/
auth
/
validate
Validate Authentication
curl --request GET \
  --url https://app.cardclan.io/api/integration/auth/validate \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "message": "Bearer token authentication successful",
  "user_id": "60f7b2b5b8f4a20015a4f5a3"
}
Validates the provided Bearer token and returns user information. This endpoint is useful for testing your authentication setup and verifying that your integration key is working correctly.

Use Cases

  • Health Check: Verify your integration key is valid and active
  • User Identification: Get the user ID associated with your integration key
  • Connection Testing: Test your API setup before making other requests
  • Debugging: Troubleshoot authentication issues

Response Details

A successful response confirms that:
  • Your Bearer token is valid and properly formatted
  • The integration key exists in our system
  • The associated user account is active
  • You can proceed to make other API requests
The user_id in the response can be used for:
  • Creating integration configurations
  • Tracking API usage
  • Debugging and support requests

Common Issues

Cause: Missing or malformed Authorization headerSolution: Include Authorization: Bearer YOUR_INTEGRATION_KEY in your request headers
# ✅ Correct format
curl -H "Authorization: Bearer 550e8400-e29b-41d4-a716-446655440000"

# ❌ Common mistakes
curl -H "Authorization: YOUR_INTEGRATION_KEY"  # Missing "Bearer "
curl -H "Bearer YOUR_INTEGRATION_KEY"         # Missing "Authorization:"
Cause: Authorization header is present but the token value after “Bearer ” is emptySolution: Ensure your integration key is properly set in your environment or configuration
// Check your environment variable is set
console.log(process.env.CARDCLAN_API_KEY); // Should not be undefined

const headers = {
  'Authorization': `Bearer ${process.env.CARDCLAN_API_KEY}`
};
Cause: The integration key is not valid or doesn’t exist in our systemSolution:
  • Verify you’re using the correct integration key
  • Check if the key was regenerated and update your configuration
  • Generate a new key if necessary using the Create Key endpoint

Response Example

{
  "success": true,
  "message": "Bearer token authentication successful",
  "user_id": "60f7b2b5b8f4a20015a4f5a3"
}

Testing Your Setup

Use this endpoint to test your authentication setup:
curl -X GET "https://api.cardclan.com/api/integration/auth/validate" \
  -H "Authorization: Bearer YOUR_INTEGRATION_KEY"

Authorizations

Authorization
string
header
required

Enter your CardClan integration key

Response

Authentication successful

success
boolean
Example:

true

message
string
Example:

"Bearer token authentication successful"

user_id
string
Example:

"60f7b2b5b8f4a20015a4f5a3"