pass agentId to createToken