API Reference
Staff

Bulk create or update user information

post post /api/bulk add edit staff creates or updates staff information using the user ids in your system (external id) this endpoint is used for multiple staff request body parameters body parameters customer id string required string required the unique marco identifier for your company bulk staff data array\[object] required array\[object] required an array of objects containing each staff's information bulk staff data customer system id string required string required the staff's unique identifier in your company's system example 50 bulk staff data customer system id type string required string required the name of your system example ps bulk staff data name string string required required the staff's full name bulk staff data system email string string required required the staff's email, used to log into marco bulk staff data country string string required required the staff's country, formatted as an iso alpha 2 code example jp note if you are changing the staff's country , you must fill in old country and new country effective date bulk staff data job title string required string required the staff's job title example hr manager bulk staff data job start date string string required required the staff's job start date, formatted as yyyy mm dd example 2020 01 31 bulk staff data staff type string string required required the staff's service type valid values system, payroll, hro, eor bulk staff data is manager boolean optional boolean optional whether the staff is a manager bulk staff data is employee boolean optional boolean optional whether the staff is an employee bulk staff data is intern boolean optional boolean optional whether the staff is an intern cannot be true if any of the previous boolean values are true bulk staff data birthdate string string optional optional the staff's date of birth, formatted as yyyy mm dd bulk staff data gender string string optional optional the staff's gender valid values female, male bulk staff data highest education string string optional optional the staff's highest education bulk staff data nationality string string optional optional the staff's nationality, formatted as the country's iso alpha 2 code bulk staff data personal email string string optional optional the staff's personal email bulk staff data phone string string optional optional the staff's phone number bulk staff data phone country string string optional optional the country code for the staff's phone number, formatted as the country's iso alpha 2 code bulk staff data emergency name string string optional optional the name of the staff's emergency contact bulk staff data emergency email string string optional optional the email belonging to the staff's emergency contact bulk staff data emergency phone string string optional optional the phone number belonging to the staff's emergency contact bulk staff data emergency phone country string string optional optional the country code for the staff's emergency contact's phone number, formatted as the country's iso alpha 2 code bulk staff data emergency relationship string string optional optional the staff's relationship to the emergency contact example husband bulk staff data passport number string string optional optional the staff's passport number bulk staff data passport issue date string string optional optional the staff's passport issue date , formatted as yyyy mm dd bulk staff data passport issuing country string string optional optional the staff's passport issuing country, stored as an iso alpha 2 code bulk staff data passport expiry date string string optional optional the staff's passport expiry date , formatted as yyyy mm dd bulk staff data reporting officer string string optional optional the staff's reporting manager bulk staff data ec type string string optional optional the staff's employment contract type valid values fixed term, indefinite bulk staff data ec entity id string string optional optional the unique identifier for the business entity that holds the employment relationship with the staff bulk staff data ec entity system id type string string optional optional the system that stores the ec entity id valid values marco, customer use "marco" if the id is stored in marco; otherwise use "customer" bulk staff data ec start date string string optional optional the start date for the staff's employment contract, formatted as yyyy mm dd this may differ from the job start date if multiple contracts have been signed in succession bulk staff data ec end date string string optional optional the end date for the staff's employment contract, formatted as yyyy mm dd bulk staff data probation end date string string optional optional the staff's probation end date, formatted as yyyy mm dd bulk staff data last working day string string optional optional the staff's last working day , formatted as yyyy mm dd bulk staff data offboarding reason string string optional optional the staff's offboarding reason valid values involuntary, voluntary bulk staff data location string string optional optional the staff's work location bulk staff data work email string string optional optional the staff's work email bulk staff data customer data type array\[object] array\[object] optional optional additional data specified by your company these data fields need to be specified in marco as a company data type before it can be sent via the endpoint example \[{"name" "department","value" "technology"},{"name" "rank","value" "p2"}] customer data type name string string optional optional custom data field name customer data type value string string optional optional the staff's value for the custom field bulk staff data old country string string optional optional the staff's previous country of residence, formatted as an iso alpha 2 code required only if you are updating the staff's country bulk staff data new country effective date string string optional optional effective date of the staff's relocation , formatted as yyyy mm dd required only if you are updating the staff's country example requests curl x post 'https //api marcopayroll com/api\ benkock8/api/bulk add edit staff' \\ h 'content type application/json' \\ h 'authorization $auth token' \\ d '{ "customer id" "2", "bulk staff data" \[ { "customer system id" "55", "name" "tuantuan", "system email" "tuantuan\@mail com", "country" "sg", "job title" "technical writer", "job start date" "2022 09 08", "staff type" "system", "is employee" "false", "is manager" "false", "is intern" "false", "birthdate" "", "gender" "", "highest education" "", "nationality" "", "personal email" "", "phone" "", "phone country" "", "emergency name" "", "emergency email" "", "emergency phone" "", "emergency phone country" "", "emergency relationship" "", "passport issue date" "", "passport expiry date" "", "passport issuing country" "", "passport number" "", "reporting officer" "", "ec type" "", "ec end date" "", "probation end date" "", "last working day" "", "offboarding reason" "", "location" "", "work email" "", "customer data type" \[ { "name" "department", "value" "finance" }, { "name" "rank", "value" "p1" } ] }, { "customer system id" "56", "name" "yuanyuan", "system email" "yuanyuan\@mail com", "country" "sg", "job title" "finance manager", "job start date" "2020 07 23", "staff type" "system", "is employee" "false", "is manager" "false", "is intern" "false", "birthdate" null, "gender" "", "highest education" "", "nationality" "", "personal email" "", "phone" "", "phone country" "", "emergency email" "", "emergency name" "", "emergency phone" "", "emergency phone country" "", "emergency relationship" "", "passport issue date" "", "passport expiry date" "", "passport issuing country" "", "passport number" "", "reporting officer" "", "ec type" "", "ec end date" "", "probation end date" "", "last working day" "", "offboarding reason" "", "location" "", "work email" "", "customer data type" \[ { "name" "department", "value" "customer manager" }, { "name" "rank", "value" "p2" } ] } ] }' import requests url = "https //api marcopayroll com/api/benkock8/api/bulk add edit staff" payload={ "customer id" "2", "bulk staff data" \[ { "customer system id" "55", "name" "tuantuan", "system email" "tuantuan\@mail com", "country" "sg", "job title" "technical writer", "job start date" "2022 09 08", "staff type" "system", "is employee" "false", "is manager" "false", "is intern" "false", "birthdate" "", "gender" "", "highest education" "", "nationality" "", "personal email" "", "phone" "", "phone country" "", "emergency name" "", "emergency email" "", "emergency phone" "", "emergency phone country" "", "emergency relationship" "", "passport issue date" "", "passport expiry date" "", "passport issuing country" "", "passport number" "", "reporting officer" "", "ec type" "", "ec end date" "", "probation end date" "", "last working day" "", "offboarding reason" "", "location" "", "work email" "", "customer data type" \[ { "name" "department", "value" "finance" }, { "name" "rank", "value" "p1" } ] }, { "customer system id" "56", "name" "yuanyuan", "system email" "yuanyuan\@mail com", "country" "sg", "job title" "finance manager", "job start date" "2020 07 23", "staff type" "system", "is employee" "false", "is manager" "false", "is intern" "false", "birthdate" null, "gender" "", "highest education" "", "nationality" "", "personal email" "", "phone" "", "phone country" "", "emergency email" "", "emergency name" "", "emergency phone" "", "emergency phone country" "", "emergency relationship" "", "passport issue date" "", "passport expiry date" "", "passport issuing country" "", "passport number" "", "reporting officer" "", "ec type" "", "ec end date" "", "probation end date" "", "last working day" "", "offboarding reason" "", "location" "", "work email" "", "customer data type" \[ { "name" "department", "value" "customer manager" }, { "name" "rank", "value" "p2" } ] } ] } response = requests post(url, headers=headers, data=payload) print(response text){ "result" \[ { "user" { "name" "tuantuan", "role" "staff", "system email" "tuantuan\@mail com", "id" 1500, "country" "sg", "status" "regular", "offboarding reason" "", "address" null, "birthdate" "", "gender" "", "highest education" "", "nationality" "", "personal email" "", "phone" "", "emergency name" "", "emergency email" "", "emergency phone" "", "emergency relationship" "", "passport number" "", "passpost issue date" "", "passport issuing country" "", "passport expiry date" "", "reporting officer" null, "job title" "technical writer", "location" "", "staff type" "system", "work email" "", "ec entity" "", "ec type" "", "ec vendor" "", "job start date" "2022 09 08", "probation end date" null, "ec start date" null, "ec end date" null, "last working day" null, "host country" "", "host staff type" "", "host ec entity" "", "host ec vendor" "", "host ec type" "", "host ec start date" "", "host ec end date" "", "host job start date" "", "host last working day" "", "job scope" "", "customer system id" "55", "passport issue date" null, "passport expirt date" null }, "message" "update successfully", "id" 1307 }, { "user" { "name" "yuanyuan", "role" "staff", "system email" "yuanyuan\@mail com", "id" 1501, "country" "sg", "status" "regular", "offboarding reason" "", "address" null, "birthdate" "", "gender" "", "highest education" "", "nationality" "", "personal email" "", "phone" "", "emergency name" "", "emergency email" "", "emergency phone" "", "emergency relationship" "", "passport number" "", "passpost issue date" "", "passport issuing country" "", "passport expiry date" "", "reporting officer" null, "job title" "finance manager", "location" "", "staff type" "system", "work email" "", "ec entity" "", "ec type" "", "ec vendor" "", "job start date" "2020 07 23", "probation end date" null, "ec start date" null, "ec end date" null, "last working day" null, "host country" "", "host staff type" "", "host ec entity" "", "host ec vendor" "", "host ec type" "", "host ec start date" "", "host ec end date" "", "host job start date" "", "host last working day" "", "job scope" "", "customer system id" "56", "passport issue date" null, "passport expirt date" null }, "message" "update successfully", "id" 1307 } ] } response result array\[object] array\[object] an array of objects containing the staff's information and the result's metadata result the user object docid 3yuppflogbxfcc92beayp object object the staff's information result message string string the endpoint response status valid values add successfully, update successfully, permission denied result id integer integer the caller's unique marco identifier