---
url: https://flat.io/developers/docs/import.md
description: Easy import any MusicXML or MIDI file available the Internet
---

# Import API

Use our Import API to quickly allow people to edit and import your web content (MusicXML and MIDI) with Flat. Simply add a link to Flat following to specification below.

Want to do it with a script or server-side, create multiple files, or export files? You can do it with our [REST API](../api/).

## Specification

Endpoint:

```text
GET https://flat.io/score/import-url
```

Parameters:

| Name | Description | Required / Default values |
|:-----|:------------|:--------|
| `url` | The full URL of the **MusicXML** or **MIDI** file to import. The file must be publicly accessible and served with [CORS](#cors) | Required |
| `title` | The title of the file you are importing | Optional, default: `New music score` |
| `app` | If you have an [app id](https://flat.io/developers/apps), you can provide it here. Your App name and logo will be displayed on the landing page, and a dedicated collection with your app name will be created in the user account. | Optional |

## Example

```html
<a href="https://flat.io/score/import-url?url=https%3A%2F%2Fflat.io%2Fexamples%2Fhello-world.xml&title=Hello%20World">
  <img src="https://flat.io/img/assets/edit-with-flat-white.svg" alt="Edit with Flat">
</a>
```

You can find more graphic assets on [our assets page](/import/assets), feel free to [contact us](mailto:developers@flat.io) if don't find the resources that you need.

## CORS

The file is downloaded by the user's browser, so you will need to add correct [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) when replying to the request:

```http
Access-Control-Allow-Origin: *
```

Or:

```http
Access-Control-Allow-Origin: $ORIGIN
```

Where `$ORIGIN` is the `Origin` header of the request, i.e. `flat.io` or `[domain].flat.io` for private websites).
