SlashCopy Icon

๐Ÿ“š API Documentation

Complete reference for SlashCopy API endpoints

๐Ÿ”‘ Authentication Endpoints

POST /api/auth/register Public

Register a new user account.

{
  "username": "string",
  "password": "string",
  "email": "string",
  "firstName": "string",
  "lastName": "string"
}
POST /api/auth/login Public

Authenticate user and receive JWT token.

{
  "username": "string",
  "password": "string"
}
GET /api/auth/validate Auth Required

Validate JWT token.

GET /api/auth/health Public

Health check endpoint.

๐Ÿงน URL Cleaning Endpoints

POST /api/url/clean Auth Required

Clean a URL by removing tracking parameters.

{
  "url": "string"
}

Response:

{
  "cleanedUrl": "string",
  "contentVerified": boolean,
  "verificationStatus": "string",
  "similarityPercentage": number
}
GET /api/url/clean?url=... Auth Required

Clean a URL (GET request).

GET /api/url/logs Auth Required

Retrieve all request logs for the authenticated user.

GET /api/url/logs/recent Auth Required

Retrieve recent request logs for the authenticated user (based on retention setting).

โš™๏ธ Settings Endpoints

GET /api/settings Auth Required

Get all user settings.

POST /api/settings Auth Required

Update a specific user setting.

{
  "key": "string",
  "value": "string"
}
DELETE /api/settings/{key} Auth Required

Delete a specific user setting.

POST /api/settings/log-retention Auth Required

Update log retention setting (slider position 1-10).

{
  "retentionHours": number
}
GET /api/settings/log-retention-options Auth Required

Get log retention slider options and current value.

DELETE /api/settings/user-history Auth Required

Delete all request history for the current user.

๐Ÿ“ธ Header Capture Endpoint

POST /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)