---
category: [Administration & Integrations, Administration & Integrations/Workday API, Platform and Product Extensions, Platform and Product Extensions/Integration]
nav: wcp_docs
parent_url: /wcp_docs/
title: >- 
  Reference: Sample Batch Protocol Requests
layout: subsection
---

## Creating a Prospect

The process of creating a prospect is a series of calls that create the prospect and its subresources such as names, experiences, addresses, education, attachments. The REST API calls should be in a single transaction in which everything succeeds or rolls back when any of the calls might fail.

Sample request:

`POST https://{tenantHostname}/batch/v1/{tenant}`

```
{
    "batch": [
        {
            "name": "create-prospect",
            "method": "POST",
            "relativeUri": "recruiting/v3/prospects/",
            "body": {
                "candidate": {
                    "name": {
                        "firstName": "Jane",
                        "lastName": "Prospect",
                        "country": {
                            "id": "bc33aa3152ec42d4995f4791a106ed09"
                        }
                    },
                    "email": "JaneProspect@acme.com",
                    "phone": {
                        "countryPhoneCode": {
                            "id": "db8d3ca6446c11de98360015c5e6daf6"
                        },
                        "phoneNumber": "1200361755",
                        "deviceType": {
                            "id": "f51701ef48570198880272fd9728ab03"
                        }
                    }                    
                }
            }
        },
        {
            "name": "create-prospect-experience",
            "method": "POST",
            "relativeUri": "recruiting/v3/prospects/{create-prospect:$.id}/experiences",
            "body": {
                "companyName": "Acme Corporation",
                "title": "{create-prospect:$.descriptor|Default Title}",
                "startYear": "2024-01-01"
            }
        },
        {
            "name": "create-prospect-skills",
            "method": "POST",
            "relativeUri": "recruiting/v3/prospects/{create-prospect:$.id}/skills",
            "body": {
                "name": "Administration"
            },
            "continueOnFailure": true
        }
    ]
}
```

Sample response:

```
{
  "total": 3,
  "data": [
    {
      "name": "create-prospect",
      "body": {
        "id": "89c65f66c91190000b9b9b883ec70000",
        "descriptor": "Jane Prospect",
        "contactConsent": false,
        "candidate": {
          "id": "89c65f66c91190000b9b9c21c2ef0000",
          "descriptor": "Jane Prospect",
          "email": "JaneProspect@acme.com",
          "name": {
            "id": "89c65f66c91110000b9bcb5fa6a90000",
            "descriptor": "Jane Prospect",
            "lastName": "Prospect",
            "country": {
              "id": "bc33aa3152ec42d4995f4791a106ed09",
              "descriptor": "United States of America",
              "ISO_3166-1_Alpha-3_Code": "USA"
            },
            "firstName": "Jane"
          },
          "phone": {
            "id": "89c65f66c91110000b9ba422109b0000",
            "descriptor": "Jane Prospect - +11200361755",
            "deviceType": {
              "descriptor": "TA_Mobile",
              "id": "f51701ef48570198880272fd9728ab03"
            },
            "phoneNumber": "1200361755",
            "countryPhoneCode": {
              "descriptor": "United States of America (+1)",
              "id": "db8d3ca6446c11de98360015c5e6daf6"
            }
          }
        }
      },
      "status": 201
    },
    {
      "name": "create-prospect-experience",
      "body": {
        "id": "89c65f66c91190000b9bdf184fb60000",
        "currentlyWorkHere": false,
        "startYear": "2024-01-01",
        "title": "Jane Prospect",
        "companyName": "Acme Corporation"
      },
      "status": 201
    },
    {
      "name": "create-prospect-skills",
      "body": {
        "id": "89c65f66c91190000b9be34a50840000",
        "name": "Administration"
      },
      "status": 201
    }
  ]
}
```

## <a id="section_1"></a>Changing a Location in a Change Job Event

The Change Job event requires this series of calls:

-   Initiate the Change Job event.
-   Update the appropriate subresources such as business title, job classification, job profile, location, position, and others.
-   Submit the Change Job event.


The REST API calls should be in a single transaction in which everything succeeds or rolls back when any of the calls might fail.

Sample request:

`POST https://{tenantHostname}/batch/v1/{tenant}`

```
{
  "batch": [
    {
      "name": "startChangeJobEvent",
      "method": "POST",
      "relativeUri": "staffing/v6/workers/Employee_ID=25655/jobChanges",
      "body": {
        "date": "2024-01-31",
        "reason": {
          "id": "9a7f47f0d2d14825a2016c76af30b939"
        }
      }
    },
    {
      "name": "startDetails",
      "method": "PATCH",
      "relativeUri": "staffing/v6/jobChanges/{startChangeJobEvent:$.id}/startDetails/{startChangeJobEvent:$.id}",
      "body": {
        "reason": {
          "descriptor": "Data Change > Data Change > Change Location",
          "id": "9a7f47f0d2d14825a2016c76af30b939"
        },
        "date": "2024-01-31"
      }
    },
    {
      "name": "changeLocation",
      "method": "PATCH",
      "relativeUri": "staffing/v6/jobChanges/{startChangeJobEvent:$.id}/location/{startChangeJobEvent:$.id}",
      "body": {
        "location": {
          "descriptor": "New York",
          "id": "d951e85593ad4daf88dc1bfabf069732"
        },
        "workShift": {
          "descriptor": "Evening (United States of America)",
          "id": "8693e7fbd7b54c9a85029c89d3022fbe"
        },
        "scheduledHours": "40",
        "workSpace": {
          "descriptor": "1155 Building",
          "id": "7e2d4a8aa313404f8a133c53e4fff7f8"
        }
      }
    },
    {
      "name": "submitChangeJobEvent",
      "method": "POST",
      "relativeUri": "staffing/v6/jobChanges/{startChangeJobEvent:$.id}/submit",
      "body": {
      }
    }
  ]
}
```

Sample response:

```
{
  "total": 4,
  "data": [
    {
      "name": "startChangeJobEvent",
      "body": {
        "id": "c0d63231391510001836f17fbdde0000",
        "descriptor": "Data Change: Dillon Ryan",
        "job": {
          "descriptor": "P-06566 Accountant - Dillon Ryan",
          "id": "7594bcb88bd410e98b8e17b4eace03f6"
        },
        "location": {
          "descriptor": "San Francisco",
          "id": "d13a7c46a06443c4a33c09afbdf72c73"
        },
        "date": "2024-01-31",
        "reason": {
          "descriptor": "Data Change > Data Change > Change Location",
          "id": "9a7f47f0d2d14825a2016c76af30b939"
        },
        "supervisoryOrganization": {
          "descriptor": "PM2 HRCORE WATS (Do not use)",
          "id": "1cb55e73c1531035e9e83f6c8e9d01d3"
        }
      },
      "status": 201
    },
    {
      "name": "startDetails",
      "body": {
        "id": "c0d63231391510001836f17fbdde0000",
        "descriptor": "Data Change: Dillon Ryan",
        "date": "2024-01-31",
        "supervisoryOrganization": {
          "descriptor": "PM2 HRCORE WATS (Do not use)",
          "id": "1cb55e73c1531035e9e83f6c8e9d01d3"
        },
        "reason": {
          "descriptor": "Data Change > Data Change > Change Location",
          "id": "9a7f47f0d2d14825a2016c76af30b939"
        },
        "location": {
          "descriptor": "San Francisco",
          "id": "d13a7c46a06443c4a33c09afbdf72c73"
        },
        "job": {
          "descriptor": "P-06566 Accountant - Dillon Ryan",
          "id": "7594bcb88bd410e98b8e17b4eace03f6"
        },
        "worker": {
          "descriptor": "Dillon Ryan",
          "id": "7594bcb88bd410e98b8e171963e103f1"
        }
      },
      "status": 200
    },
    {
      "name": "changeLocation",
      "body": {
        "scheduledHours": "40",
        "location": {
          "descriptor": "New York",
          "id": "d951e85593ad4daf88dc1bfabf069732"
        },
        "workShift": {
          "descriptor": "Evening (United States of America)",
          "id": "8693e7fbd7b54c9a85029c89d3022fbe"
        },
        "workSpace": {
          "descriptor": "1155 Building",
          "id": "7e2d4a8aa313404f8a133c53e4fff7f8"
        }
      },
      "status": 200
    },
    {
      "name": "submitChangeJobEvent",
      "body": {
        "id": "c0d63231391510001836f17fbdde0000",
        "descriptor": "Data Change: Dillon Ryan",
        "status": {
          "descriptor": "In Progress",
          "id": "e2d08afc53614c37b32b31270bb8bee3"
        },
        "businessProcessParameters": {
          "overallBusinessProcess": {
            "descriptor": "Data Change: Dillon Ryan",
            "id": "c0d63231391510001836f17fbdde0000"
          },
          "overallStatus": "In Progress",
          "for": {
            "descriptor": "PM2 HRCORE WATS (Do not use)",
            "id": "1cb55e73c1531035e9e83f6c8e9d01d3"
          },
          "transactionStatus": {
            "descriptor": "In Progress",
            "id": "e2d08afc53614c37b32b31270bb8bee3"
          }
        }
      },
      "status": 201
    }
  ]
}
```

