Skip to main content
API tokens provide long-lived authentication for scripts and integrations.

Generate Token

Create a new API token.

Request

curl -X POST https://api.fucksornot.com/api/auth/tokens/generate \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "Upload Script"}'

Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "token": "fon_live_abc123def456ghi789...",
  "name": "Upload Script",
  "expiresAt": "2026-01-24T00:00:00Z"
}
The token value is only shown once. Store it securely as it cannot be retrieved later.

List Tokens

Get all API tokens for your account.

Request

curl https://api.fucksornot.com/api/auth/tokens \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response

{
  "tokens": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Upload Script",
      "createdAt": "2025-01-24T00:00:00Z",
      "lastUsedAt": "2025-01-24T12:00:00Z",
      "expiresAt": "2026-01-24T00:00:00Z"
    }
  ]
}
The token value is not included in the list response for security.

Revoke Token

Delete a token to revoke its access.

Request

curl -X DELETE https://api.fucksornot.com/api/auth/tokens/TOKEN_ID \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response

{
  "success": true
}

Using API Tokens

Use API tokens with the /api/v1/upload endpoint:
curl -X POST https://api.fucksornot.com/api/v1/upload \
  -H "Authorization: Bearer fon_live_abc123def456..." \
  -F "upload_type=image" \
  -F "description=My upload" \
  -F "[email protected]"

Best Practices

Name tokens based on their purpose (e.g., “GitHub Action”, “Backup Script”)
Generate new tokens periodically and revoke old ones
Create separate tokens for different integrations so you can revoke individually
Use environment variables or secret management tools