REST API Reference
Integrate Prime Auth into your application using our HTTP API endpoints.
Authentication
All API requests require your application's Secret Key for authentication.
Header/Body: { "secretKey": "YOUR_SECRET_KEY" }
Pro Tip: Use our SDKs
Manually managing HTTP requests can be complex. We recommend using our official SDKs which handle authentication, HWID generation, and error handling automatically.
Include your secret key in the request body for every API call. Never expose your secret key in client-side code.
Create User
POSTManually create a new user with custom credentials.
Endpoint
POST https://yourapp.vercel.app/api/v1/[appId]/user/createRequest Body
{
"username": "john_doe",
"password": "securePassword123",
"days": 30,
"secretKey": "YOUR_SECRET_KEY"
}Response (Success)
{
"success": true,
"message": "User created successfully",
"username": "john_doe",
"expiryDate": "2025-02-15T12:00:00.000Z"
}Example (cURL)
curl -X POST https://yourapp.vercel.app/api/v1/YOUR_APP_ID/user/create \
-H "Content-Type: application/json" \
-d '{
"username": "john_doe",
"password": "securePassword123",
"days": 30,
"secretKey": "YOUR_SECRET_KEY"
}'Example (SDK - Node.js)
const PrimeAuth = require('./prime-auth');
const client = new PrimeAuth('YOUR_APP_ID', 'YOUR_SECRET_KEY');
try {
const user = await client.createUser('john_doe', 'password123', '2025-12-31T23:59:59Z');
console.log('User created:', user.data.username);
} catch (err) {
console.error('Failed:', err.message);
}Example (Python)
import requests
url = "https://yourapp.vercel.app/api/v1/YOUR_APP_ID/user/create"
payload = {
"username": "john_doe",
"password": "securePassword123",
"days": 30,
"secretKey": "YOUR_SECRET_KEY"
}
response = requests.post(url, json=payload)
data = response.json()
if data["success"]:
print(f"User created: {data['username']}")
print(f"Expires: {data['expiryDate']}")
else:
print(f"Error: {data['error']}")Error Handling
Common Error Codes:
400- Missing required fields401- Invalid secret key403- User banned, HWID mismatch, or subscription expired404- User or license not found500- Internal server error
Always check the success field in the response. If false, an error field will contain the details.