Add payroll external ID
Set or update an employee’s payroll ID. Use a company administrator’s legacy access token.
Request
POST https://getrightwork.dev/api/store_info/upsert_user_company_profile
Send your legacy access token in the Authorization: Token <your-access-token> header. Send the body as application/json.
Body parameters
| Parameter | Type | Description |
|---|---|---|
email | String | Required. Employee email in the selected company. Matching ignores case. |
payroll_external_id | String | External payroll identifier for the employee (required) |
payroll_source | String | Use payroll_source_ukg (default) or payroll_source_paylocity. |
company_name | String | Exact company name. You can also send company as an alias or supply company_id instead. |
Python example
import requests
def upsert_user_company_profile(access_token, email, payroll_external_id,
company_name, payroll_source="payroll_source_ukg"):
response = requests.post(
"https://getrightwork.dev/api/store_info/upsert_user_company_profile",
headers={"Authorization": f"Token {access_token}"},
json={
"company_name": company_name,
"email": email,
"payroll_external_id": payroll_external_id,
"payroll_source": payroll_source,
},
timeout=30,
)
response.raise_for_status()
return response.json()
# Example usage
result = upsert_user_company_profile(
access_token="YOUR_TOKEN",
email="employee@acmecorp.com",
payroll_external_id="12345",
company_name="AcmeCorp",
payroll_source="payroll_source_ukg",
)
print(result)
Response
A successful response returns a JSON object:
| Field | Type | Description |
|---|---|---|
created | Boolean | true if a new profile was created; false if an existing profile was updated (or unchanged) |
payroll_external_id | String | Payroll external identifier saved on the profile |
payroll_source | String | Payroll source saved on the profile |
company | String | Company name that was applied |
email | String | Email used to resolve the user |
Example response
{
"created":true,
"payroll_external_id":"12345",
"payroll_source":"payroll_source_ukg",
"company":"AcmeCorp",
"email":"employee@acmecorp.com"
}