# Uploader Submission Callback

The Osmos Uploader provides a **Callback** to the host page when the Osmos Uploader window closes. The callback is made to the function mapped to the `completionHandler` key. This key is optional. If a handler function is assigned, it will provide:

1. `originalFileUrl`: URL of original uploaded file. The file will be available at this for the data retention duration configured on your Osmos account, after which the URL will return 404. In order to to avoid name collisions, the filename will be appended with GUID values.
2. `reachedTransformStep`: Boolean indicating if the user successfully reached the transformation step
3. `successfullySubmittedData`: Boolean if the user successfully submitted data and completed the upload experience
4. `numRecordsSubmitted`: Number of records submitted
5. `skippedRowNumbers`: Array of row numbers that were skipped, starting at data row number 0, and not including the header row in the count.
6. `jobId`: The UUID which corresponds to this specific Osmos Uploader run.

The Callback is triggered by one of two ways:

1\. When the user selects the submit button

2\. When the user closers the modal (Callback will be triggered with zero rows submitted)

{% hint style="info" %}
For more information on Optional configuration features like `completionHandler`, see [Optional Settings](/developer-docs/optional-uploader-settings.md).
{% endhint %}

Here’s an example of a code snippet for a `completionHandler` callback

```javascript
Osmos.configure({
  userID: window.curUserID,
  completionHandler: async (params)=> {
    console.log(params)
  },
  schema: {
    fields: [
      {
        name: 'field1',
        displayName: 'Field 1'
      },
      ...
    ],
  },
  ...
}
```

```
interface CompletionHandlerArgs {
  originalFileUrl: string,
  reachedTransformStep: boolean,
  successfullySubmittedData: boolean,
  numRecordsSubmitted: number,
  skippedRowNumbers: Array,
  jobId: string
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.osmos.io/developer-docs/uploader-submission-callback.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
