# Introduction

Welcome to the MeldAPI API.

## Getting Started

To get started with the MeldAPI API, sign up for an account at [https://us.meldapi.io/portal/register](https://app.verifynest.io/portal/register)

For more information about MeldAPI, visit our website <https://meldapi.io>

All API requests require the Authorization header to be set to:

```
Authorization: Bearer <API_TOKEN>
```

{% hint style="info" %}
&#x20;Where \<API\_TOKEN> is the token you created.
{% endhint %}

API tokens can be created and managed under your Profile when signed into the MeldAPI platform.


# Authentication Check

Confirm your API token is working

## Authentication Check

<mark style="color:blue;">`GET`</mark> `https://api.meldapi.io/api/public/v1/auth/check`

This endpoint allows you to check if your API token is working.

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Authorization | string | Bearer \<API\_TOKEN> |

{% tabs %}
{% tab title="200 Authentication successfull." %}

```
{  
  "id:": 1,
  "email": "xxxx@test.com",
  "teams": [
    {
      "id": 1,
      "name": "Team Number 1"
    }
  ]
}
```

{% endtab %}

{% tab title="401 API Token is invalid" %}

```
{
    "errors": [
        {
            "message": "E_UNAUTHORIZED_ACCESS: Unauthorized access"
        }
    ]
}
```

{% endtab %}
{% endtabs %}


# List

Retreive a list of configured connections.

## List Connections

<mark style="color:blue;">`GET`</mark> `https://api.meldapi.io/api/public/v1/connections/index`

This endpoint allows you to get free cakes.

#### Query Parameters

| Name     | Type   | Description    |
| -------- | ------ | -------------- |
| team\_id | number | Filter by team |

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Authorization | string | Bearer \<API\_TOKEN> |

{% tabs %}
{% tab title="200 " %}

```
[
    {
        "id": 5,
        "name": "Test MailChimp 1",
        "type": "mailchimp",
        "team_id": 1,
        "team": {
            "id": 1,
            "name": "Team Number 1"
        }
        "user_id": 1,
        "created_at": "2021-09-28T19:44:16.016Z",
        "updated_at": "2021-09-28T19:44:16.016Z",
        "meta": {}
    },
    {
        "id": 35,
        "name": "Test PDF Connection",
        "type": "pdf",
        "team_id": 1,
        "team": {
            "id": 2,
            "name": "Team Number 2"
        }        
        "user_id": 1,
        "created_at": "2022-08-27T20:44:35.468Z",
        "updated_at": "2022-08-27T20:44:35.468Z",
        "meta": {}
    }
```

{% endtab %}

{% tab title="401 Unauthorized access." %}

```
{
    "errors": [
        {
            "message": "E_UNAUTHORIZED_ACCESS: Unauthorized access"
        }
    ]
}
```

{% endtab %}
{% endtabs %}


# Get

Retreive a specific connection details

## Get Connection

<mark style="color:blue;">`GET`</mark> `https://api.meldapi.io/api/public/v1/connections/:id`

#### Path Parameters

| Name | Type   | Description  |
| ---- | ------ | ------------ |
|      | String | Conection ID |

{% tabs %}
{% tab title="200: OK " %}

```json
{
        "id": 5,
        "name": "Test MailChimp 1",
        "type": "mailchimp",
        "team_id": 1,
        "team": {
            "id": 1,
            "name": "Team Number 1"
        }
        "user_id": 1,
        "created_at": "2021-09-28T19:44:16.016Z",
        "updated_at": "2021-09-28T19:44:16.016Z",
        "meta": {}
}
```

{% endtab %}
{% endtabs %}


# List

Retreive a list of configured Melds.

## List Melds

<mark style="color:blue;">`GET`</mark> `https://api.meldapi.io/api/public/v1/melds`

This endpoint allows you to search the Australian company and business name register.

#### Query Parameters

| Name     | Type   | Description    |
| -------- | ------ | -------------- |
| team\_id | number | Filter by team |

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Authorization | string | Bearer \<API\_TOKEN> |

{% tabs %}
{% tab title="200 " %}

```json
[
    {
        "id": 1,
        "name": "Airtable OpenAI",
        "team": {
            "id": 2,
            "name": "Team Number 1"
        },
        "connections": {
            "src": {
                "id": 1,
                "name": "Airtable Test",
                "type": "airtable",
                "dataType": "table",
            },
            "dst": {
                "id": 2,
                "name": "Test AI",
                "type": "openai",
                "dataType": "openai",
            },
        },
        "created_at": "2022-12-15T05:57:30.187Z",
        "updated_at": "2023-01-12T02:33:41.738Z",
        "locked": false,
        "dst_deletion_policy": null
    },
    {
        "id": 2,
        "name": "Webflow",
        "team": {
            "id": 3,
            "name": "Team Number 2"
        },
        "connections": {
            "src": {
                "id": 1,
                "name": "Weblflow Test",
                "type": "webflow",
                "dataType": "collection"
            },
            "dst": {
                "id": 3,
                "name": "MailChimp",
                "type": "mailchimp",
                "dataType": "list"
            },
        },       
        "created_at": "2022-12-11T09:57:30.187Z",
        "updated_at": "2023-01-00T03:33:41.738Z",
        "locked": false,
        "dst_deletion_policy": null
    }
]
```

{% endtab %}

{% tab title="401 Unauthorized access" %}

```
{
    "errors": [
        {
            "message": "E_UNAUTHORIZED_ACCESS: Unauthorized access"
        }
    ]
}
```

{% endtab %}
{% endtabs %}


# Get

Get a specific Meld.

## Get Melds

<mark style="color:blue;">`GET`</mark> `https://api.meldapi.io/api/public/v1/melds/:id`

This endpoint allows you to search the Australian company and business name register.

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Authorization | string | Bearer \<API\_TOKEN> |

{% tabs %}
{% tab title="200 " %}

```json
{
        "id": 1,
        "name": "Airtable OpenAI",
        "team": {
            "id": 2,
            "name": "Team Number 1"
        },
        "connections": {
            "src": {
                "id": 1,
                "name": "Airtable Test",
                "type": "airtable",
                "dataType": "table",
            },
            "dst": {
                "id": 2,
                "name": "Test AI",
                "type": "openai",
                "dataType": "openai",
            },
        },
        "created_at": "2022-12-15T05:57:30.187Z",
        "updated_at": "2023-01-12T02:33:41.738Z",
        "locked": false,
        "dst_deletion_policy": null
    }
```

{% endtab %}

{% tab title="401 Unauthorized access" %}

```
{
    "errors": [
        {
            "message": "E_UNAUTHORIZED_ACCESS: Unauthorized access"
        }
    ]
}
```

{% endtab %}
{% endtabs %}


# Trigger

Trigger a sync for a specific Meld

## Trigger a sync for a configured Meld.

<mark style="color:blue;">`GET`</mark> `https://api.meldapi.io/api/public/v1/meldsyncs/add/:meld_id`

#### Path Parameters

| Name     | Type   | Description               |
| -------- | ------ | ------------------------- |
| meld\_id | Number | ID of the configured Meld |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "meld_id": "1",
    "status": "pending",
    "user_id": 1,
    "webhook_data": null,
    "webhook": false,
    "created_at": "2022-09-29T00:16:50.817Z",
    "updated_at": "2022-09-29T00:16:50.817Z",
    "id": 630
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}


# Processing

Retreive a list of melds that are currently syncing.

## List of Melds that are currently processing

<mark style="color:blue;">`GET`</mark> `https://api.meldapi.io/api/public/v1/meldsyncs/processing`

This endpoint allows you to verify and retrieve a local or international phone number's details.

#### Query Parameters

| Name     | Type   | Description    |
| -------- | ------ | -------------- |
| team\_id | String | Filter by team |

#### Headers

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| Authorization | string | Bearer \<API\_KEY> |

{% tabs %}
{% tab title="200 " %}

```
[
    {
        "id": 629,
        "meld_id": 1,
        "status": "pending",
        "created_at": "2022-09-28T22:08:13.694Z",
        "updated_at": "2022-09-28T22:08:13.694Z",
        "errors": null,
        "webhook": false,
        "meld": {
            "id": 1,
            "name": "Test ST L -> L"
        }
    }
]
```

{% endtab %}

{% tab title="401 Unauthorized access." %}

```
{
    "errors": [
        {
            "message": "E_UNAUTHORIZED_ACCESS: Unauthorized access"
        }
    ]
}
```

{% endtab %}
{% endtabs %}


# Example Payload

This is an example payload of what MeldAPI will send when a sync has completed and webhooks are enabled for that Meld.

```
{
  id: "12",
  status: "completed",
  meld: "Example Airtable -> Example Webflow",
  changes: "3",
  errors: "0",
  deleted: "0",
  published: "3",
  meldUrl: "https://us.meldapi.io/portal/melds/3",
  syncUrl: "https://us.meldapi.io/portal/dashboard/syncs?id=12"
}
```


# Getafile

This page describes how to use the MeldAPI BYO Connector to fetch files from Getafile

You'll need a Getafile account and API key to do the setup below. Register now at <https://getafile.io/auth/register>

MeldAPI's BYO Connector can fetch data from any compatible REST API.

Once you've got your Getafile API key, create a new BYO connection in MeldAPI.

<figure><img src="https://1090700813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUs4HjflDONruh9xjdwSi%2Fuploads%2FGqzLH3EpKZ2ORMyN4gHu%2Fimage.png?alt=media&amp;token=af34d9dc-7d57-4139-b6eb-c01b589206f3" alt=""><figcaption><p>How to configure the Authentication</p></figcaption></figure>

Once you've done the initial connector setup, you can start defining the schema. The resource endpoint to fetch all files for a domain:\
`GET: https://getafile.io/api/v1/teams/:team_id/file/index/:domain_id`

Where ":team\_id" is the team the domain belongs to, and ":domain\_id" is the domain the files are attached to in Getafile.

Check out the Getafile docs for more information about available endpoints: <https://developers.getafile.io/>

Once you've confirmed you can fetch the data (click "PREVIEW DATA") - a minimal setup would look like the below:<br>

<figure><img src="https://1090700813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUs4HjflDONruh9xjdwSi%2Fuploads%2FC5RWiK0gdSf50fpoDA28%2Fimage.png?alt=media&amp;token=d43f9c97-8e43-47c9-b7bb-77f344a219bc" alt=""><figcaption><p>Example basic setup for fetching domain files from Getafile</p></figcaption></figure>

You can access embedded values using the "." syntax. Array values can be accessed via the index position (0-based).

The "Image URL" field type is useful when syncing to image/file fields in Webflow / Airtable etc. We suggest using the Getafile domain URL for these purposes as seen in the above screenshot.

Inspecting the PREVIEW DATA response is the fastest way to find more fields to define in the schema.

Once you've finished defining the schema, click "UPDATE" at the bottom of the page and start using the connection in your Melds.&#x20;

Please note: As with all BYO connectors, it's read-only and can only be used as a source connection.


