Blender Python mesh.from_pydata?
Blender includes a sample template file that uses from_pydata() which you can get in blender's text editor from Templates-&gt;Python-&gt;Addon Add Object

The key portion is -

def add_object(self, context):
    scale_x = self.scale.x
    scale_y = self.scale.y

    verts = [Vector((-1 * scale_x, 1 * scale_y, 0)),
             Vector((1 * scale_x, 1 * scale_y, 0)),
             Vector((1 * scale_x, -1 * scale_y, 0)),
             Vector((-1 * scale_x, -1 * scale_y, 0)),
            ]

    edges = []
    faces = [[0, 1, 2, 3]]

    mesh = bpy.data.meshes.new(name="New Object Mesh")
    mesh.from_pydata(verts, edges, faces)
    # useful for development when the mesh may be invalid.
    # mesh.validate(verbose=True)
    object_data_add(context, mesh, operator=self)


Of note is that the vertex list is a list of Vector() items and the face list is a list containing items that are each a list of vertex indices (eg. a list of lists), multiple faces should be entered as [[0,1,2,3],[1,2,5,6],[0,1,7,8]] - this is most likely the source of the error you see.