Manage user accounts via the REST API
curl -X GET \ -H "Authorization: Bearer lk_1234567890abcdef1234567890abcdef" \ https://api.limitly.dev/v1/users
{ "data": [ { "user_id": 123, "name": "John Doe", "email": "john@example.com", "is_disabled": false, "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z" } ], "count": 1 }
curl -X POST \ -H "Authorization: Bearer lk_1234567890abcdef1234567890abcdef" \ -H "Content-Type: application/json" \ -d '{ "name": "John Doe", "email": "john@example.com" }' \ https://api.limitly.dev/v1/users
{ "data": { "user_id": 123, "name": "John Doe", "email": "john@example.com", "is_disabled": false, "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z" } }
curl -X GET \ -H "Authorization: Bearer lk_1234567890abcdef1234567890abcdef" \ https://api.limitly.dev/v1/users/123
curl -X PUT \ -H "Authorization: Bearer lk_1234567890abcdef1234567890abcdef" \ -H "Content-Type: application/json" \ -d '{ "name": "John Smith", "email": "john.smith@example.com" }' \ https://api.limitly.dev/v1/users/123
curl -X DELETE \ -H "Authorization: Bearer lk_1234567890abcdef1234567890abcdef" \ https://api.limitly.dev/v1/users/123
{ "data": { "message": "User deleted successfully" } }
curl -X GET \ -H "Authorization: Bearer lk_1234567890abcdef1234567890abcdef" \ https://api.limitly.dev/v1/users/123/usage
{ "data": { "type": "user", "current_usage": 45, "limit": 1000, "percentage_used": 4.5, "user_name": "John Doe", "plan_name": "Basic Plan" } }
curl -X GET \ -H "Authorization: Bearer lk_1234567890abcdef1234567890abcdef" \ https://api.limitly.dev/v1/users/123/keys
{ "data": [ { "id": "key_123", "name": "Production API Key", "plan_id": "plan_789", "status": "active", "created_at": "2024-01-01T00:00:00Z" } ], "count": 1 }
curl -X GET \ -H "Authorization: Bearer lk_1234567890abcdef1234567890abcdef" \ https://api.limitly.dev/v1/users/123/requests
{ "data": { "requests": [ { "timestamp": "2024-01-01T12:00:00Z", "endpoint": "/api/users", "method": "GET", "status": "allowed", "ip_address": "192.168.1.1" } ], "count": 1 } }
# Activate a user curl -X PUT \ -H "Authorization: Bearer lk_1234567890abcdef1234567890abcdef" \ -H "Content-Type: application/json" \ -d '{ "is_disabled": false }' \ https://api.limitly.dev/v1/users/123 # Suspend a user curl -X PUT \ -H "Authorization: Bearer lk_1234567890abcdef1234567890abcdef" \ -H "Content-Type: application/json" \ -d '{ "is_disabled": true }' \ https://api.limitly.dev/v1/users/123
# Search by email curl -X GET \ -H "Authorization: Bearer lk_1234567890abcdef1234567890abcdef" \ "https://api.limitly.dev/v1/users?email=john@example.com"
{ "error": "User not found", "code": "USER_NOT_FOUND" }
{ "error": "Validation failed", "code": "VALIDATION_ERROR", "details": { "field": "email", "message": "Invalid email format" } }
{ "error": "Email already exists", "code": "DUPLICATE_EMAIL" }
curl -X GET \ -H "Authorization: Bearer lk_1234567890abcdef1234567890abcdef" \ "https://api.limitly.dev/v1/users?page=2&limit=20"
Was this page helpful?