Creating a custom method and validate through hooks

Here when the new user registers through api, the admin should check whether organization field is present or not. If the organization field is not present or null value , and if admin try to save it should throw validation error. i have created the hook for user, what should I write in the custom method in python file…plz small help or guide would be very much helpful…Thank you…