Rightwork OG Image
Browse API documentation
API docsLegacy API

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

ParameterTypeDescription
emailStringRequired. Employee email in the selected company. Matching ignores case.
payroll_external_idStringExternal payroll identifier for the employee (required)
payroll_sourceStringUse payroll_source_ukg (default) or payroll_source_paylocity.
company_nameStringExact company name. You can also send company as an alias or supply company_id instead.

Python example

Python
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:

FieldTypeDescription
createdBooleantrue if a new profile was created; false if an existing profile was updated (or unchanged)
payroll_external_idStringPayroll external identifier saved on the profile
payroll_sourceStringPayroll source saved on the profile
companyStringCompany name that was applied
emailStringEmail used to resolve the user

Example response

JSON
{
	"created":true,
	"payroll_external_id":"12345",
	"payroll_source":"payroll_source_ukg",
	"company":"AcmeCorp",
	"email":"employee@acmecorp.com"
}