# File upload

{% hint style="warning" %}
File Upload is different from the [Import and Export](https://docs.secoda.co/resource-and-metadata-management/import-and-export-data) feature which is meant to edit metadata on existing resources, or bring in new dictionary terms.
{% endhint %}

There are three steps to uploading a file as a custom integration in Secoda.

1. Create an Integration
2. Prepare your files
3. Upload the resources

### 1. Create an Integration

Navigate over to the Integrations page and click the **Connect Integration** button. Scroll to the bottom to find the **Custom Integrations** option, and select **File Upload**.

You'll then be able to name your integration, and add any associated teams. By default, the integration will be named Untitled, and associate with the General team.

You can adjust the preferences of your integration in the [Settings](https://docs.secoda.co/integrations/integration-settings).

#### Using an API Request

Use the Secoda [Integrations API endpoint](https://api.secoda.co/api/schema/redoc/#tag/Integrations/paths/~1integration~1integrations/post) to create an integration. Code snippet below.

```python
import requests

headers = dict(
    Authorization="Bearer <your-api-token>"
)
integration_type = "custom"

response = requests.post(
    "https://api.secoda.co/integration/integrations/",
    json=dict(type=integration_type, name="My Custom Integration", credentials={}),
    headers=headers
).json()
print("Integration ID", response.get("id"))
```

### 2. Prepare your files

Learn more about the expected format for the CSV or JSONL file.

{% content-ref url="custom-integration/create-your-csv" %}
[create-your-csv](https://docs.secoda.co/integrations/custom-integrations-and-marketplace/custom-integration/create-your-csv)
{% endcontent-ref %}

{% content-ref url="custom-integration/create-your-jsonl-file" %}
[create-your-jsonl-file](https://docs.secoda.co/integrations/custom-integrations-and-marketplace/custom-integration/create-your-jsonl-file)
{% endcontent-ref %}

### 3. Upload your resources

Under the Import tab, you will see the option to select and upload a CSV or JSONL file. Each upload is considered a sync.

#### Using an API Request

The endpoint for uploading a CSV is [here](https://api.secoda.co/api/schema/redoc/#tag/Integrations/paths/~1integration~1integrations~1%7Bintegration_id%7D~1import_metadata/post). For a JSONL file, you can upload both a `resources.jsonl` and `lineage.jsonl` file in the same request, to the endpoint [here](https://api.secoda.co/api/schema/redoc/#tag/Integrations/paths/~1integration~1integrations~1%7Bintegration_id%7D~1import_jsonl_metadata/post).

Each request is considered a sync.

{% hint style="info" %}
For some best practices in maintaining your resources for File Upload custom integrations, see [here](https://docs.secoda.co/integrations/custom-integrations-and-marketplace/custom-integration/maintain-your-resources).
{% endhint %}
