See maapi_attach(). I.e. you attach to the transaction in your init() callback:
static int init_trans(struct confd_trans_ctx *tctx)
OK(maapi_attach(msock, my__ns, tctx));
Note that there is no need to commit, e.g. using maapi_apply_trans() after your maapi_create() since you attached to a transaction that will be committed after your hook.