Create or update user information
\<font color="#3b9f0f">post\</font> /api/add edit staff creates or updates staff information using the user id in your system (external id) this endpoint is used for a single staff only request \<font color="#00a2e9">body parameters\</font> customer id \<font color="#a7b4c3">integer required\</font> the unique marco identifier for your company customer system id \<font color="#a7b4c3">string required\</font> the staff's unique identifier in your company's system example 50 customer system id type \<font color="#a7b4c3">string required\</font> the name of your system example ps name \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">required\</font> the staff's full name system email \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">required\</font> the staff's email, used to log into marco country \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">required\</font> the staff's country of residence, formatted as an iso alpha 2 code https //www iban com/country codes example jp note if you are changing the staff's country , you must fill in old country and new country effective date job title \<font color="#a7b4c3">string required\</font> the staff's job title example hr manager job start date \<font color="#a7b4c3">string\</font> \<font color="#a7b4c3"> required\</font> the staff's job start date , formatted as yyyy mm dd example 2020/01/31 staff type \<font color="#a7b4c3">string\</font> \<font color="#a7b4c3"> required\</font> the staff's service type valid values system, payroll, hro, eor is manager \<font color="#a7b4c3">boolean optional\</font> whether the staff is a manager default false is employee \<font color="#a7b4c3">boolean optional\</font> whether the staff is an employee default true is intern \<font color="#a7b4c3">boolean optional\</font> whether the staff is an intern cannot be true if any of the previous boolean values are true birthdate \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's date of birth , formatted as yyyy mm dd gender \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's gender valid values female, male highest education \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's highest education nationality \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's nationality, formatted as the country's iso alpha 2 code https //www iban com/country codes personal email \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's personal email phone \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's phone number phone country \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the country code for the staff's phone number, formatted as the country's iso alpha 2 code https //www iban com/country codes emergency name \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the name of the staff's emergency contact emergency email \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the email belonging to the staff's emergency contact emergency phone \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the phone number belonging to the staff's emergency contact emergency phone country \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the country code for the staff's emergency contact's phone number, formatted as the country's iso alpha 2 code https //www iban com/country codes emergency relationship \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's relationship to the emergency contact passport number \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's passport number passport issue date \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's passport issue date , formatted as yyyy mm dd passport issuing country \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's passport issuing country, formatted as an iso alpha 2 code https //www iban com/country codes passport expiry date \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's passport expiry date , formatted as yyyy mm dd reporting officer \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's reporting manager ec type \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's employment contract type valid values fixed term, indefinite ec entity id \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the unique identifier for the business entity that holds the employment relationship with the staff ec entity system id type \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the system that stores the ec entity id valid values marco, customer use "marco" if the id is stored in marco; otherwise use "customer" ec start date \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> 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 ec end date \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the end date for the staff's employment contract , formatted as yyyy mm dd probation end date \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's probation end date , formatted as yyyy mm dd last working day \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's last working day , formatted as yyyy mm dd offboarding reason \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's offboarding reason valid values involuntary, voluntary location \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's work location work email \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's work email customer data type \<font color="#a7b4c3">array\[object] \</font> \<font color="#a7b4c3">optional\</font> additional data specified by your company these data fields need to be configured 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 \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> custom data field name customer data type value \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's value for the custom field old country \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> the staff's previous country of residence, formatted as an iso alpha 2 code https //www iban com/country codes required only if you are updating the staff's country new country effective date \<font color="#a7b4c3">string \</font> \<font color="#a7b4c3">optional\</font> 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/add edit staff' \\ h 'content type application/json' \\ h 'authorization $auth token' \\ d '{ "customer id" 2, "customer system id" "50", "customer system id type" "ps" "name" "li lei", "system email" "lilei\@mail com", "country" "cn", "job title" "product manager", "job start date" "2020 01 31", "staff type" "payroll", "is manager" true, "is employee" true, "is intern" false, "birthdate" "1980 01 04", "gender" "male", "highest education" "university", "nationality" "cn", “personal email” "ll\@mail com", “phone” "17623453456", “phone country” "cn", “emergency name” "han meimei", “emergency email” "hmm\@mail com", "emergency phone" "18876546789", "emergency phone country" "cn", "emergency relationship" "mother", "passport number" "eg8213789", "passport issue date" "2020 01 03", "passport issuing country" "cn", "passport expiry date" "2024 01 02", "reporting officer" "tuan tuan", "ec type" "fixed term", "ec entity id" "", "ec entity system id type" "", "ec start date" "2020 01 31", "ec end date" "2025 07 01", "probation end date" "2020 07 01", "last working day" "", "offboarding reason" "", "location" "beijing", "work email" "lilei\@mail com", "customer data type" \[ { "name" "department", "value" "technology" }, { "name" "rank", "value" "p2" } ] "old country" "", "new country effective date" "" }'import requests url = "https //api marcopayroll com/api/benkock8/api/add edit staff" payload={ "customer id" 2, "customer system id" "50", "customer system id type" "ps" "name" "li lei", "system email" "lilei\@mail com", "country" "cn", "job title" "product manager", "job start date" "2020 01 31", "staff type" "payroll", "is manager" true, "is employee" true, "is intern" false, "birthdate" "1980 01 04", "gender" "male", "highest education" "university", "nationality" "cn", “personal email” "ll\@mail com", “phone” "17623453456", “phone country” "cn", “emergency name” "han meimei", “emergency email” "hmm\@mail com", "emergency phone" "18876546789", "emergency phone country" "cn", "emergency relationship" "mother", "passport number" "eg8213789", "passport issue date" "2020 01 03", "passport issuing country" "cn", "passport expiry date" "2024 01 02", "reporting officer" "tuan tuan", "ec type" "fixed term", "ec entity id" "", "ec entity system id type" "", "ec start date" "2020 01 31", "ec end date" "2025 07 01", "probation end date" "2020 07 01", "last working day" "", "offboarding reason" "", "location" "beijing", "work email" "lilei\@mail com", "customer data type" \[ { "name" "department", "value" "technology" }, { "name" "rank", "value" "p2" } ] "old country" "", "new country effective date" "" } headers = { "accept" "application/json", "authorization" "your auth token" } response = requests post(url, headers=headers, data=payload) print(response text){ "user" { "name" "li lei", "role" "staff", "system email" "lilei\@mail com", "id" 1348, "country" "cn", "status" "regular", "offboarding reason" "", "birthdate" "", "gender" "male", "highest education" "university", "nationality" "cn", "personal email" "ll\@mail com", "phone" "8617623453456", "emergency name" "han meimei", "emergency email" "hmm\@mail com", "emergency phone" "8618876546789", "emergency relationship" "mother", "passport number" "eg8213789", "passpost issue date" "", "passport issuing country" "", "passport expiry date" "", "reporting officer" "tuan tuan", "job title" "product manager", "location" "beijing", "staff type" "payroll", "work email" "lilei\@mail com", "ec entity" "", "ec type" "fixed term", "ec vendor" "", "job start date" "2020 01 31", "probation end date" "2020 07 01", "ec start date" "2020 01 31", "ec end date" "2025 07 01", "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" "", "job scope" "", "customer system id" "50", }, "message" "update successfully", "id" 1307 } response {user} docid 3yuppflogbxfcc92beayp \<font color="#a7b4c3">object\</font> the staff's information message \<font color="#a7b4c3">string\</font> the endpoint response status valid values add successfully, update successfully, permission denied id \<font color="#a7b4c3">integer\</font> the caller's unique marco identifier