cURL
curl --request POST \ --url https://api.example.com/api/signup \ --header 'Content-Type: application/json' \ --data ' { "username": "<string>", "password": "<string>", "email": "<string>", "name": "<string>" } '
{ "message": "<string>", "user": { "id": 123, "username": "<string>", "email": "<string>", "name": "<string>", "created_at": "<string>", "updated_at": "<string>", "max_files": 123, "max_storage": 123 } }
Create a new user account
400 Bad Request
{ "error": "Key: 'User.Username' Error:Field validation for 'Username' failed on the 'required' tag" }
500 Internal Server Error - Password Hashing Failed
{ "error": "Failed to hash password" }
500 Internal Server Error - User Creation Failed
{ "error": "Failed to create user: UNIQUE constraint failed: users.username" }
curl -X POST https://api.defdrive.com/api/signup \ -H "Content-Type: application/json" \ -d '{ "username": "johndoe", "password": "securePassword123", "email": "[email protected]", "name": "John Doe" }'
{ "message": "User created successfully", "user": { "id": 1, "created_at": "2024-03-15T10:30:00Z", "updated_at": "2024-03-15T10:30:00Z", "deleted_at": null, "name": "John Doe", "email": "[email protected]", "username": "johndoe", "password": "", "max_files": 100, "max_storage": 1073741824 } }