In order to see what operator you want to use, you can use it as normal and read it’s name in the information window.
In this case I used the one to set the origin to the center of mass:
import bpy
def origin_to_center():
# deselect all of the objects
bpy.ops.object.select_all(action='DESELECT')
# loop all scene objects
for obj in bpy.context.scene.objects:
# get the meshes
if obj.type=="MESH":
print(obj)
# select / reset origin / deselect
obj.select = True
bpy.ops.object.origin_set(type='ORIGIN_CENTER_OF_MASS')
obj.select = False
origin_to_center()