I have written one trigger which fires on account create and update,but there is one API which creates/update account and if creation/updation is through that API i don't need to fire trigger. Please suggest how can i achieve this.
One option is to have a field (Say
origin type picklist) on respective object(in your case it is Account).
This field would have several values like
created through code OR
created through API OR
created manually .
And in your trigger you would check for this field. So if the origin of the record is through API you won't perform the operations in the trigger.