What are the valid types for the type parameter in bpy.context.scene.node_tree.nodes.new(type)? I'm trying to use python to create nodes in the compositor.  Right now I want to create an ID Mask node, but there will eventually be others.

If I create an ID Mask node via the UI and ask the python console what is C.scene.node_tree.nodes.active.type it tells me 'ID_MASK', but if I C.scene.node_tree.nodes.new('ID_MASK') I get an error

Traceback (most recent call last):
  File "&lt;blender_console&gt;", line 1, in &lt;module&gt;
RuntimeError: Error: Node type ID_MASK undefined


How do I learn the proper values for the type parameter for node_tree.nodes.new(type) ?
The correct type for this would be: 'CompositorNodeIDMask'.

Too create a new ID Mask node the line would be :  C.scene.node_tree.nodes.new('CompositorNodeIDMask')

If this is confusing, at least they have a pattern so you have 'CompositorNode'or'ShaderNode'or'TextureNode' plus the node type like 'ShaderNode'+'ObjectInfo'.

For the full list of node types see these links: shader nodes, compositor nodes and texture nodes