๐ Authentication Endpoints
/api/auth/register
Public
Register a new user account.
{
"username": "string",
"password": "string",
"email": "string",
"firstName": "string",
"lastName": "string"
}
/api/auth/login
Public
Authenticate user and receive JWT token.
{
"username": "string",
"password": "string"
}
/api/auth/validate
Auth Required
Validate JWT token.
/api/auth/health
Public
Health check endpoint.
๐งน URL Cleaning Endpoints
/api/url/clean
Auth Required
Clean a URL by removing tracking parameters.
{
"url": "string"
}
Response:
{
"cleanedUrl": "string",
"contentVerified": boolean,
"verificationStatus": "string",
"similarityPercentage": number
}
/api/url/clean?url=...
Auth Required
Clean a URL (GET request).
/api/url/logs
Auth Required
Retrieve all request logs for the authenticated user.
/api/url/logs/recent
Auth Required
Retrieve recent request logs for the authenticated user (based on retention setting).
โ๏ธ Settings Endpoints
/api/settings
Auth Required
Get all user settings.
/api/settings
Auth Required
Update a specific user setting.
{
"key": "string",
"value": "string"
}
/api/settings/{key}
Auth Required
Delete a specific user setting.
/api/settings/log-retention
Auth Required
Update log retention setting (slider position 1-10).
{
"retentionHours": number
}
/api/settings/log-retention-options
Auth Required
Get log retention slider options and current value.
/api/settings/user-history
Auth Required
Delete all request history for the current user.
๐ธ Header Capture Endpoint
/api/headers/capture
Public
Capture browser headers for bot mitigation.
๐ Example Usage
1. Register & Login
# Register
curl -X POST https://slashcopy.com/api/auth/register \
-H "Content-Type: application/json" \
-d '{"username":"user","password":"pass","email":"[email protected]","firstName":"John","lastName":"Doe"}'
# Login (save the token)
curl -X POST https://slashcopy.com/api/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"user","password":"pass"}'
2. Clean a URL
curl -X POST https://slashcopy.com/api/url/clean \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url":"https://amazon.com/product?tracking=123&ref=abc"}'
3. Get Settings
curl -X GET https://slashcopy.com/api/settings \
-H "Authorization: Bearer YOUR_TOKEN"
4. Update Log Retention
curl -X POST https://slashcopy.com/api/settings/log-retention \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"retentionHours":6}'
โ๏ธ Available Settings
log_retention_hours: How long to keep user request logs.
Range: 1 (1h), 2 (2h), 3 (4h), 4 (8h), 5 (12h), 6 (24h), 7 (48h), 8 (72h), 9 (1 week), 10 (Infinite)
Default: 6 (24 hours)
max_logs_limit: Maximum number of logs to retrieve for recent requests.
Range: 10 - 10000
Default: 1000
connect_timeout: Max time (ms) to establish connection.
Range: 1000 - 15000
Default: 5000
read_timeout: Max time (ms) to read data from connection.
Range: 3000 - 30000
Default: 10000
similarity_threshold: Min % similarity for content verification.
Range: 70 - 99
Default: 95
max_content_length: Max bytes of content to fetch for comparison.
Range: 102400 (100KB) - 1048576 (1MB)
Default: 262144 (256KB)