POST /employers/{employerId}/employees

Enrol new employees for a specified employer. Employees are processed asynchronously — the response returns an upload ID that can be used to track processing status via the Uploads endpoints.

Path parameters

  • employerId string(uuid) Required

    Penfold employer UUID

application/json

Body Required

  • email string(email) Required

    Email address of the employee.

  • forename string Required

    The employee's first name.

  • surname string Required

    The employee's last name.

  • title string Required

    The employee's title, e.g. Mr., Mrs., Dr., etc.

  • dateOfBirth string(date) Required

    The employee's date of birth, in YYYY-MM-DD format.

  • addressLine1 string Required

    The first line of the employee's address.

  • postcode string Required

    The postal code of the employee's address.

  • nationalInsuranceNumber string Required

    The employee's National Insurance number.

  • employmentStartDate string(date) Required

    The date the employee started their employment, in YYYY-MM-DD format.

Responses

  • 201 application/json

    Submission accepted for processing.

    Hide response attributes Show response attributes object
    • id string Required

      Upload ID for tracking the submission. Use the Uploads endpoints to check processing status.

    • status string Required

      Initial status of the submission.

      Values are ReceivedFile or Processing.

    • createdAt string(date-time) Required

      When the submission was created (ISO 8601).

  • 400 application/json

    Request body failed validation

    Hide response attributes Show response attributes object
    • error string Required

      A descriptive error message.

    • validationErrors array[object]
      Hide validationErrors attributes Show validationErrors attributes object
      • field string Required

        The name of the field that failed validation.

      • message string Required

        A descriptive error message.

  • 401 application/json

    Missing or invalid authentication token

    Hide response attribute Show response attribute object
    • error string Required
  • 404 application/json

    Resource not found

    Hide response attribute Show response attribute object
    • error string Required
  • 500 application/json

    Internal server error

    Hide response attribute Show response attribute object
    • error string Required
POST /employers/{employerId}/employees
curl \
 --request POST 'https://partner-api.getpenfold.com/v1/employers/{employerId}/employees' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '[{"email":"john.doe@example.com","forename":"John","surname":"Doe","title":"Mr.","dateOfBirth":"1990-01-01","addressLine1":"123 Main Street","postcode":"AB12 3CD","nationalInsuranceNumber":"AA123456C","employmentStartDate":"2023-01-01"}]'
Request examples
[
  {
    "email": "john.doe@example.com",
    "forename": "John",
    "surname": "Doe",
    "title": "Mr.",
    "dateOfBirth": "1990-01-01",
    "addressLine1": "123 Main Street",
    "postcode": "AB12 3CD",
    "nationalInsuranceNumber": "AA123456C",
    "employmentStartDate": "2023-01-01"
  }
]
Response examples (201)
{
  "id": "u1234-abcd-5678-efgh",
  "status": "ReceivedFile",
  "createdAt": "2023-03-01T12:00:00Z"
}
Response examples (400)
{
  "error": "validation failed",
  "validationErrors": [
    {
      "field": "companyNumber",
      "message": "companyNumber is required"
    },
    {
      "field": "primaryContactEmail",
      "message": "must be a valid email address"
    }
  ]
}
Response examples (401)
{
  "error": "unauthorized"
}
Response examples (404)
{
  "error": "not found"
}
Response examples (500)
{
  "error": "internal server error"
}