POST
/
v1
/
datasources
curl -X POST "https://api.getmetal.io/v1/datasources" \
--header 'Content-Type: application/json' \
--header 'x-metal-api-key: <api-key>' \
--header 'x-metal-client-id: <client-id>' \
--data-raw '{
    "name": "my_datasource",
    "metadataFields": [
      {
        "name": "band",
        "type": "string",
        "description": "The band that the uploaded file is about.",
        "autoExtract": true
      },
      {
        "name": "author",
        "type": "string",
        "autoExtract": false
      }
    ],
    "sourcetype": "file",
    "autoExtract": true
}'
{
  "data": {
    "id": "datasourceID",
    "createdAt": "2023-08-29T10:51:04.246Z",
    "createdBy": "userId",
    "name": "my_datasource",
    "metadataFields": [
      // Extracted field, which we will detect on upload
      {
        "name": "band",
        "type": "string",
        "description": "Which heavy metal band is represented by the iconic mascot Eddie?",
        "autoExtract": true
      },
      // Normal field, which needs to be manually set on upload
      {
        "name": "author",
        "type": "string",
        "autoExtract": false
      }
    ],
    "sourcetype": "File",
    "autoExtract": true
  }
}

Auth Headers

x-metal-api-key
string
required

An API key for your org.

x-metal-client-id
string
required

A Client ID for your org.

Body

name
string
required

Name of the Datasource.

sourcetype
string
required

Type of the source. File or Text.

autoExtract
boolean
required

Flag indicating whether auto-extraction is enabled. If disabled, it will short-cirtuit to bypass extraction.

metadataFields
array

An array containing metadata fields. Each object should have name, type, description, and autoExtract properties.