How to create a Light with the Python API in Blender 2.92
Recommended way is to use low level API calls. Create a new light data block using BlendDataLights.new(), create a new object using ObjectData.new(), link the light data block and add the object to the collection in context using CollectionObjects.link(object):
import bpy

# Create light datablock
light_data = bpy.data.lights.new(name=&quot;my-light-data&quot;, type='POINT')
light_data.energy = 100

# Create new object, pass the light data 
light_object = bpy.data.objects.new(name=&quot;my-light&quot;, object_data=light_data)

# Link object to collection in context
bpy.context.collection.objects.link(light_object)

# Change light position
light_object.location = (0, 0, 3)