\defineregister[MyIndex]

\starttext

% ConTeXt way
A\expanded{\setregisterentry[MyIndex]
    [keys:1=A Level 1,
     entries:1=A Level 1,
     keys:2=A Level 2,
     entries:2=A Level 2]}

% Lua way
\startluacode
-- command without colon OK
context("B")
context.setregisterentry({ "MyIndex" },
    { keys="B", entries="B"})
-- command with colon NOK
-- context("C")
-- context.setregisterentry({ "MyIndex" },
--    { keys:1="C Level 1", entries:1="C Level 2"})
\stopluacode

\placeregister[MyIndex][criterium=all]

\stoptext
