Create a task on a account via function

Create a task on a account via function

I'm trying to create a function for accounts that creates a task based on certain conditions and processes (that's why it's not possible to just use a workflow). Everything seems to be working fine, with the exception of the task creation. Does anyone knows what am I doing wrong?

On arguments, there is:
      id  > Accounts - Id
      owner > Accounts - Account Owner
      company > Accounts - Account Name
      

  1. // Create Task
  2. taskmp = Map();
  3. taskmp.put("Subject","First Contact");
  4. taskmp.put("Owner",owner);
  5. taskmp.put("Priority","High");
  6. taskmp.put("Status","Not Started");
  7. taskmp.put("Due_Date",today.toDate());
  8. taskmp.put("Details","Testing Details");
  9. taskmp.put("Account",company);
  10. taskmp.put("What_Id",id));
  11. taskmp.put("$se_module","Accounts");
  12. task = zoho.crm.createRecord("Tasks",taskmp);
  13. info taskmp;
  14. info task;