Skip to content

Attach Files to Sourcing Event Examples

The following examples provide JSON data which may be used with the jobs endpoints as described in Usage. These examples are specific to the attach files to sourcing event API, to be used with the /jobs/attach-files-to-sourcing-event endpoint which is fully described in the OpenAPI Specification.

A Basic Request

The below example shows the basic usage attaching files to a Sourcing Event.

The sourcing_event field represents the unique identifier (UUID) of an existing Sourcing Event which will be the subject of the file attachments specified in this request. This identifier may be found within the Sourcing Optimizer application. You will need to provide the correct identifier for your Sourcing Event, otherwise the request will not be created and the job will return an error.

{
  "sourcing_event": "00000000-0000-0000-0000-000000000000",
  "created_by": "john.doe@email.com",
  "files": [
    "file1.txt",
    "file2.pdf"
  ]
}

Once the job has been created, the detail field will be populated with an upload_url for each file specified in the initial request. You can use the upload_url to send the files via HTTP PUT.

{
  "id": "00000000-0000-0000-0000-000000000000",
  "type": "ATTACH_FILES_TO_SOURCING_EVENT",
  "status": "RUNNING",
  "created": "2025-06-06T00:00:00.000001Z",
  "detail": {
      "files": [
          {
              "file_name": "file1.txt",
              "upload_url": "https://test.com/00000000-0000-0000-0000-000000000000/file1.txt?...snip..."
          },
          {
              "file_name": "file2.pdf",
              "upload_url": "https://test.com/00000000-0000-0000-0000-000000000000/file2.pdf?...snip..."
          },
      ]
  }
}

Note on Job status

The attach files to Sourcing Event API is asynchronous by its nature. When the job has started, the status will be marked as RUNNING, and will have it's detail field updated with an upload_url, one for each of the files provided in the initial job submission.

Jobs that have not completed a successful file upload will be moved to a FAILED status after a period of time.

Note on upload_url

The upload_url populated in the job detail field is a pre-authenticated URL which has a timeout of 60 seconds. Any attempt to utilise the upload_url outside of the 60 second validity will result in a HTTP 403 with an error message of "Request has expired".