Files and Media

Send documents, audio and video, so that Answers and Search can read them.

Some of your content is not in html or description: a PDF report, a slide deck, a podcast, a recorded webinar. Send these files in the attachments field of the product record. Miso keeps a copy of each file, gets its text, and indexes the text with the rest of the record. Answers can then answer from the file and cite the record.

You can read the text that Miso got from each file. Read the record back, and the text is in attachments[].html. See See the text that Miso indexed.

You send Miso gets the text by Searchable
PDF, Word (.docx), PowerPoint (.pptx), HTML, Markdown Text extraction, with the structure of headings, lists and tables Yes
A scanned PDF, or an image, with need_ocr: true Text recognition (OCR) on each page Yes
Audio or video (audio/*, video/*), as a file or as a link. YouTube and Vimeo links: coming soon. A transcript of the speech Yes
A spreadsheet or a CSV file (.csv, .tsv, .xlsx) Miso reads it as a table, after the Miso team sets up the dataset. See Tables that Answers can query. Yes, as a table, after setup

Send a file

Send audio and video as a link. For every recording, put an https link to the file in url, and do not put the file in the request. The request stays small, a file can be up to 5 GB, and Miso does not download an unchanged file again. See Send a link to the file. Documents cannot be sent as a link. Send them in content, as below.

Add an attachments array to the record. Each item is one file. For a document, encode the file in base64:

CONTENT=$(base64 < housing-2026.pdf | tr -d '\n')

curl -X POST "https://api.askmiso.com/v1/products" \
  -H "X-Api-Key: YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<EOF
{
  "data": [
    {
      "product_id": "report-2026-housing",
      "title": "Housing Market Report 2026",
      "url": "https://example.com/reports/housing-2026",
      "published_at": "2026-06-12T09:00:00Z",
      "description": "Our yearly report on prices, rents and new building.",
      "attachments": [
        {
          "filename": "housing-2026.pdf",
          "content_type": "application/pdf",
          "content": "$CONTENT"
        }
      ]
    }
  ]
}
EOF
import base64
import requests

with open("housing-2026.pdf", "rb") as f:
    content = base64.b64encode(f.read()).decode()

record = {
    "product_id": "report-2026-housing",
    "title": "Housing Market Report 2026",
    "url": "https://example.com/reports/housing-2026",
    "published_at": "2026-06-12T09:00:00Z",
    "description": "Our yearly report on prices, rents and new building.",
    "attachments": [
        {
            "filename": "housing-2026.pdf",
            "content_type": "application/pdf",
            "content": content,
        }
    ],
}

response = requests.post(
    "https://api.askmiso.com/v1/products",
    headers={"X-Api-Key": "YOUR_SECRET_KEY"},
    json={"data": [record]},
    timeout=120,
)
response.raise_for_status()
print(response.json())
import { readFile } from "node:fs/promises";

const content = (await readFile("housing-2026.pdf")).toString("base64");

const record = {
  product_id: "report-2026-housing",
  title: "Housing Market Report 2026",
  url: "https://example.com/reports/housing-2026",
  published_at: "2026-06-12T09:00:00Z",
  description: "Our yearly report on prices, rents and new building.",
  attachments: [
    {
      filename: "housing-2026.pdf",
      content_type: "application/pdf",
      content,
    },
  ],
};

const response = await fetch("https://api.askmiso.com/v1/products", {
  method: "POST",
  headers: {
    "X-Api-Key": "YOUR_SECRET_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ data: [record] }),
});
if (!response.ok) {
  throw new Error(`Upload failed: ${response.status} ${await response.text()}`);
}
console.log(await response.json());
<?php
$content = base64_encode(file_get_contents('housing-2026.pdf'));

$record = [
    'product_id'   => 'report-2026-housing',
    'title'        => 'Housing Market Report 2026',
    'url'          => 'https://example.com/reports/housing-2026',
    'published_at' => '2026-06-12T09:00:00Z',
    'description'  => 'Our yearly report on prices, rents and new building.',
    'attachments'  => [
        [
            'filename'     => 'housing-2026.pdf',
            'content_type' => 'application/pdf',
            'content'      => $content,
        ],
    ],
];

$ch = curl_init('https://api.askmiso.com/v1/products');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => ['X-Api-Key: YOUR_SECRET_KEY', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode(['data' => [$record]]),
    CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status >= 400) {
    throw new RuntimeException("Upload failed: $status $response");
}
echo $response;
Field Required What it is
filename Yes The name of the file, with its extension, for example report.pdf. Miso uses the extension to select how it reads the file.
content_type Yes The MIME type, in lowercase, for example application/pdf or video/mp4.
content content or url The file, encoded as content_encoding says. Use it for documents.
url content or url For audio and video only: an https link to the file. Use it for every recording. See Send a link to the file.
content_encoding No base64 (the default), gzip or deflate (the compressed file, then base64), or utf-8 (plain text as it is).
need_ocr No true reads the pages as images, with text recognition. Use it for a scanned PDF or an image. The default is false.
title No A title for the file.
cover_image No The URL of an image for the file.

A record can have more than one attachment. One request can be up to 50 MB, with all records and all attachments included. Base64 makes a file about one third larger. To send a larger file, send it in a request of its own, or compress it with gzip.

Documents

Miso gets the text of a document and keeps its structure. The headings, lists and tables of the file stay headings, lists and tables in the indexed text:

A page of a PDF report next to the text that Miso indexes for it. The headings, the list and the table of the page are kept.

To see this text for your own file, read the record back. See See the text that Miso indexed.

Miso reads these documents:

Format Extension content_type
PDF .pdf application/pdf
Word .docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
PowerPoint .pptx application/vnd.openxmlformats-officedocument.presentationml.presentation
HTML .html text/html
Markdown .md text/markdown
  • Scanned documents. A PDF of scanned pages has no text to extract. Send it with need_ocr: true, and Miso reads each page as an image.
  • Images. Send an image, for example image/png or image/jpeg, only with need_ocr: true. Without it, Miso does not read the image.
  • Older formats. Miso does not read .doc and .ppt. Save them as .docx and .pptx before you send them.
  • Spreadsheets. Miso keeps .csv, .tsv, .xls, .xlsx and .xlsm files as you sent them. Their content is not indexed as text, so it is not in search results. To make the data searchable, put it in the text of the record, or in custom attributes. Answers can also query some spreadsheets as tables. See Tables that Answers can query.

Audio and video

Send a recording as a link to the file, with a content_type that starts with audio/ or video/, for example audio/mpeg or video/mp4. Miso downloads the file, makes a transcript of the speech, and indexes it as the text of the attachment.

A 24-minute video next to the transcript that Miso indexes for it. Each turn of the two speakers is a paragraph with a label such as Speaker 1.

To read the transcript of your own recording, read the record back. See See the text that Miso indexed.

  • Speakers. When more than one person speaks, each turn is its own paragraph, with a label such as "Speaker 1:". In a recording longer than 30 minutes, the turns are separate paragraphs, without the labels.
  • The words. The transcript has the words as they were spoken. Miso does not summarize or rewrite them.
  • Length. Miso transcribes up to the first 6 hours of a recording.
  • The same file again. Miso transcribes a file one time. If you send the same file again, for example in a new upload of the record, Miso uses the transcript that it already made.

This is the recommended way to send audio and video. In place of content, send the url of the file. Miso downloads the file, keeps a copy, and makes the transcript.

curl -X POST "https://api.askmiso.com/v1/products" \
  -H "X-Api-Key: YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "data": [
      {
        "product_id": "webinar-2026-05",
        "title": "May 2026 webinar: the housing market",
        "url": "https://example.com/webinars/2026-05",
        "attachments": [
          {
            "filename": "webinar-2026-05.mp4",
            "content_type": "video/mp4",
            "url": "https://media.example.com/webinars/webinar-2026-05.mp4"
          }
        ]
      }
    ]
  }'
import requests

record = {
    "product_id": "webinar-2026-05",
    "title": "May 2026 webinar: the housing market",
    "url": "https://example.com/webinars/2026-05",
    "attachments": [
        {
            "filename": "webinar-2026-05.mp4",
            "content_type": "video/mp4",
            "url": "https://media.example.com/webinars/webinar-2026-05.mp4",
        }
    ],
}

response = requests.post(
    "https://api.askmiso.com/v1/products",
    headers={"X-Api-Key": "YOUR_SECRET_KEY"},
    json={"data": [record]},
    timeout=60,
)
if response.status_code == 422:
    print("Refused:", response.json())  # for example, the file was not found
response.raise_for_status()
const record = {
  product_id: "webinar-2026-05",
  title: "May 2026 webinar: the housing market",
  url: "https://example.com/webinars/2026-05",
  attachments: [
    {
      filename: "webinar-2026-05.mp4",
      content_type: "video/mp4",
      url: "https://media.example.com/webinars/webinar-2026-05.mp4",
    },
  ],
};

const response = await fetch("https://api.askmiso.com/v1/products", {
  method: "POST",
  headers: {
    "X-Api-Key": "YOUR_SECRET_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ data: [record] }),
});
if (!response.ok) {
  // 422: a link broke a rule, for example the file was not found
  throw new Error(`Upload failed: ${response.status} ${await response.text()}`);
}
<?php
$record = [
    'product_id'  => 'webinar-2026-05',
    'title'       => 'May 2026 webinar: the housing market',
    'url'         => 'https://example.com/webinars/2026-05',
    'attachments' => [
        [
            'filename'     => 'webinar-2026-05.mp4',
            'content_type' => 'video/mp4',
            'url'          => 'https://media.example.com/webinars/webinar-2026-05.mp4',
        ],
    ],
];

$ch = curl_init('https://api.askmiso.com/v1/products');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => ['X-Api-Key: YOUR_SECRET_KEY', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode(['data' => [$record]]),
    CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status === 422) {
    // a link broke a rule, for example the file was not found
    throw new RuntimeException("Refused: $response");
}

Each attachment needs content or url. If it has both, Miso uses content and does not download the URL. A link works only for audio and video.

YouTube and Vimeo links: coming soon. Today the link must go to the audio or video file itself. A link to a YouTube or Vimeo page returns an HTML page, so Miso refuses it with 422 ("…which is not a video or audio type"). Support for YouTube and Vimeo links is coming soon.

The link must agree with these rules:

Rule Limit
Scheme and port https, on port 443
Host A public host. No user name or password in the URL.
Length of the URL 2,048 characters or less
Redirects 3 or less
The file It exists, and the server sends an audio or a video content type
Size of the file 5 GB or less
Transcript The first 6 hours of the recording

Miso checks each link when you send the request, also with dry_run=1. The check reads the headers of the file and does not download it. If a link breaks a rule, the API refuses the whole request with 422, as it does for a schema error, and no record in that request is uploaded. The response says why, for example:

  • "The file was not found: the server responded with HTTP status 404."
  • "The server responded with the content type 'text/html', which is not a video or audio type."
  • "The host resolves to an address that is not public."

The message does not show the query string of your URL. Miso checks up to 20 links in one request. It checks the other links when it downloads the files.

After Miso accepts the record, it downloads the file and indexes the transcript. For example, a 10-minute video of 146 MB was searchable about 30 seconds after the upload. When you upload the record again and the file did not change, Miso does not download it again.

Miso sends the user agent Miso/1.0.0 (Linux) for the check and for the download. If your media server has a firewall or a rule for bots, allow this user agent.

Send the recording in the request

If you cannot give a link, you can send a short recording in content, as a document. The request is then 50 MB or less, with the base64 encoding included. An hour of video is usually too large.

{
  "filename": "episode-42.mp3",
  "content_type": "audio/mpeg",
  "content": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjYwLjE2LjEwMAAAAAAA…"
}

Tables that Answers can query

Available on request. Miso turns this on for each dataset. Contact your Miso representative before you send a dataset.

Answers can read a table as data. It can answer questions such as "Which five suppliers had the largest share last month?" with counts, totals, averages, rankings, filters and comparisons. Miso runs a read-only query on the table, and the answer gives the figures from the result.

A CSV file of supplier contracts next to a question in Answers. Miso writes a read-only SQL query for the question, runs it on the table, and answers with the figures from the result. The answer cites the dataset as source 1.

To send a table, upload a record with "type": "dataset", and attach the files:

{
  "product_id": "dataset-suppliers",
  "type": "dataset",
  "title": "Supplier contracts",
  "description": "One row for each contract, with supplier, value and end date.",
  "attachments": [
    {
      "filename": "contracts.csv",
      "content_type": "text/csv",
      "content": "c3VwcGxpZXIsdmFsdWUsZW5kX2RhdGUK…"
    }
  ]
}
Topic What to know
Files Use .csv (comma-separated), .tsv (tab-separated) or .xlsx. Miso selects the file by its extension. Miso does not query .xls and .xlsm files.
Tables Each CSV or TSV file is one table. Each sheet of a workbook that is not empty is one table. The first row must be the header row.
Names The title of the attachment names the table. Without a title, the file name names it. Keep the column names clear, because the questions are matched to them.
Setup For each dataset, Miso adds a short description of the table and of what its columns and codes mean. A dataset without this setup is stored, but Answers does not query it.
Citations The answer cites the dataset as one source, with its name. It does not cite single rows.
Updates Upload the record again with the same product_id and file name to replace the table. Answers uses the new data within several minutes. Delete the record to remove its tables.

If the table cannot answer a question, Answers answers from your other content.

See the text that Miso indexed

Read the record back with GET /v1/products/{product_id}. Each attachment in the response has the text that Miso got from the file, in html. This is the same text that Search and Answers use. The response does not include the file itself.

curl "https://api.askmiso.com/v1/products/report-2026-housing" \
  -H "X-Api-Key: YOUR_SECRET_KEY"
import requests

response = requests.get(
    "https://api.askmiso.com/v1/products/report-2026-housing",
    headers={"X-Api-Key": "YOUR_SECRET_KEY"},
    timeout=30,
)
response.raise_for_status()

for attachment in response.json()["data"].get("attachments", []):
    print(attachment["filename"])
    print(attachment.get("html", "(no text)"))
const response = await fetch(
  "https://api.askmiso.com/v1/products/report-2026-housing",
  { headers: { "X-Api-Key": "YOUR_SECRET_KEY" } },
);
if (!response.ok) {
  throw new Error(`Read failed: ${response.status}`);
}

const { data } = await response.json();
for (const attachment of data.attachments ?? []) {
  console.log(attachment.filename);
  console.log(attachment.html ?? "(no text)");
}
<?php
$ch = curl_init('https://api.askmiso.com/v1/products/report-2026-housing');
curl_setopt_array($ch, [
    CURLOPT_HTTPHEADER     => ['X-Api-Key: YOUR_SECRET_KEY'],
    CURLOPT_RETURNTRANSFER => true,
]);
$record = json_decode(curl_exec($ch), true)['data'];
curl_close($ch);

foreach ($record['attachments'] ?? [] as $attachment) {
    echo $attachment['filename'], "\n";
    echo $attachment['html'] ?? '(no text)', "\n";
}
{
  "message": "success",
  "data": {
    "product_id": "report-2026-housing",
    "title": "Housing Market Report 2026",
    "attachments": [
      {
        "filename": "housing-2026.pdf",
        "content_type": "application/pdf",
        "html": "# Prices and rents\n\nPrices rose for the third year in a row. Rents grew faster than prices.\n\n## Key findings\n\n- Prices rose 3.1%.\n…"
      }
    ]
  }
}

For each attachment, the record keeps the filename, the content_type, your optional fields (title, cover_image, need_ocr), and html. Miso also keeps a copy of the file. The text is there as soon as you can read the record.

What you see in html What it means
Markdown with headings, lists and tables The text of a document
Paragraphs with "Speaker 1:", "Speaker 2:" The transcript of a recording
No html Miso did not get text from the file. Examples: a spreadsheet, an image without need_ocr, or a damaged file. The record is still uploaded and indexed.

Do a check of html after your first upload of each type of file. If the text is missing or wrong, for example a scanned PDF without need_ocr, correct the attachment and upload the record again.

Updates

An upload replaces the whole record. Send the attachments again with each upload of the record. If you leave them out, the new record has no attachments.

Miso does not read a file again when it is the same file. An upload that sends the same attachments again is therefore fast.