convert post agent to json