---
title: "material.import"
method: POST
path: "/v1/material/import"
tags: ["material"]
---

# material.import

`POST /v1/material/import`

## Request

- Base URL: `https://api.selda.ai`
- URL: `https://api.selda.ai/v1/material/import`
- Auth: HTTP bearer

Your prospect folder → a campaign + company list, then it stops. Uploading material is not permission to send.

Dispatched to `material.import` on `POST /mcp/run`. This route is a different URL for the same call: the request is answered by the same dispatcher, with the same authentication, the same scope check, the same organisation scoping and the same refusals.

- Scope: `pipeline`
- A free sandbox key may call it, but not with every argument. `autoAdvance` carries the run on into contact lookup and drafting, which spend, so with it the same call needs a live key.
- MCP tools that wrap the same function: `selda_import_material`
- Filled in from your API key, never sent by you: `orgId`, `apiKeyId`

## Request body

- object
  - `projectId` string, required: A Convex document id in the `projects` table.
  - `files` object[], required
    - `path` string, required
    - `storageId` string, required: A Convex document id in the `_storage` table.
    - `sizeBytes` number, required
    - `mimeType` string
  - `assignments` object[]
    - `folderName` string, required
    - `domain` string, required
  - `excludedFolders` string[]
  - `campaignName` string
  - `targetRunId` string: Push INTO an existing campaign instead of creating one (#357), the campaign's run id. The other door onto the same feature: a script that already produced a second folder of prospects for the same motion should be able to add them as the campaign's next wave rather than fragmenting one effort across several campaigns. The permission rule is unchanged, the wave parks at the company-list gate and inherits nothing from an earlier wave's grant, and the run must belong to the project this API key's org owns, which `appendCandidateBatch` verifies. A Convex document id in the `campaignRuns` table.
  - `campaignBrief` string: The operator's campaign document (18.8.2026): rules, structure, tone, what may not be claimed. This is what made the API pipeline half-manual, analyses went in over the wire, but the RULES had to be pasted by hand in the app, and a campaign without them runs on house defaults. Honored exactly as the Määritä card's own-prompt mode is. On a `targetRunId` wave it is accepted only when the campaign has no brief yet; a differing one is refused out loud.
  - `fields` object: Your own data per company, for personal pages and videos: `{ "boreo.fi": { demo: "https://...", offer: "...", price: 49 } }`. The key is a company's domain or its name; the values are kept under the names you give them (a-z, 0-9, _; `demo` and any `*_url` must be https). Refused keys come back in `fieldsRefused`. Nothing is sent and nothing is invented.
  - `autoAdvance` union: Explicit grant to continue past the company list. A script CAN pass this, Autopilot is a legitimate caller, but it is never the default, and the grant is recorded on the run. Per-stage since #301: `["leads"]` grants contact lookup and stops before any message is written; `true` grants both. A script that only wants the contacts found should say so rather than granting everything, because message writing spends credits. Neither form can send. Sending stays behind `launchRun` and the approval gate.
    - boolean
    - string[]

## Response `200`

The call succeeded.

- object
  - `value` unknown, required
  - `request_id` string, required: Echoed in the `X-Request-Id` header.

## Other responses

- `400`: Unknown route, or arguments the validator refused.
- `401`: Missing, expired or revoked key.
- `403`: The key lacks the scope, the plan entitlement, or is a sandbox key on a live-only function.
- `429`: Rate limited. Wait for the next minute window and retry.
- `500`: The function threw. The message says what, without leaking internals.

---

[API](https://skmtc.dev/selda/apis/selda-api.md) · [All operations](https://skmtc.dev/selda/apis/selda-api/llms.txt) · [OpenAPI document](https://skmtc.dev/selda/apis/selda-api/revisions/f0b115a94c0f?raw)
