import os
from meibel import MeibelClient
from meibel.models import MoveDocumentsRequest, MetadataConfigRequest, MetadataField
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
request = MoveDocumentsRequest(
documents=["job_8f3c1a2b9d4e", "job_1e2d3c4b5a6f"],
new_datasource_name="Support Tickets Q1",
metadata_config=MetadataConfigRequest(
type="custom",
fields=[
MetadataField(
name="ticket_priority",
type="string",
description="Priority level of the support ticket",
index=True,
),
],
),
)
response = client.documents.move(request)
print(f"workflow_id={response.workflow_id} documents_count={response.documents_count}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const result = await client.documents.move({
documents: ["job_7f3a1b2c9e", "job_9d2e4f6a1b"],
newDatasourceName: "Support Tickets Q1",
metadataConfig: {
type: "custom",
fields: [
{
name: "ticket_priority",
type: "string",
description: "Priority level of the support ticket",
index: true,
},
{
name: "resolved_at",
type: "datetime",
description: "Timestamp when the ticket was resolved",
},
],
},
});
console.log(`Workflow ${result.workflowId} moving ${result.documentsCount} documents into ${result.datasourceId}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
resp, err := client.Documents.Move(context.Background(), v2.MoveDocumentsRequest{
Documents: []string{"job_7f3a9c21", "job_9b1e4d88"},
NewDatasourceName: v2.String("Acme Corp Contracts"),
MetadataConfig: &v2.MetadataConfigRequest{
Type: "custom",
Fields: []v2.MetadataField{
{
Name: "contract_date",
Type: "datetime",
Description: "Date the contract was signed",
Index: true,
},
},
},
})
if err != nil {
panic(err)
}
fmt.Printf("workflow_id: %s, documents_count: %d\n", resp.WorkflowID, resp.DocumentsCount)
}curl --request POST \
--url https://api.meibel.ai/v2/documents/move \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"documents": [
"<string>"
],
"datasource_id": "<string>",
"new_datasource_name": "<string>",
"metadata_config": {
"model_id": "<string>",
"fields": [
{
"name": "<string>",
"description": "<string>",
"index": true
}
]
}
}
'const options = {
method: 'POST',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
documents: ['<string>'],
datasource_id: '<string>',
new_datasource_name: '<string>',
metadata_config: {
model_id: '<string>',
fields: [{name: '<string>', description: '<string>', index: true}]
}
})
};
fetch('https://api.meibel.ai/v2/documents/move', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meibel.ai/v2/documents/move",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'documents' => [
'<string>'
],
'datasource_id' => '<string>',
'new_datasource_name' => '<string>',
'metadata_config' => [
'model_id' => '<string>',
'fields' => [
[
'name' => '<string>',
'description' => '<string>',
'index' => true
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.meibel.ai/v2/documents/move")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"documents\": [\n \"<string>\"\n ],\n \"datasource_id\": \"<string>\",\n \"new_datasource_name\": \"<string>\",\n \"metadata_config\": {\n \"model_id\": \"<string>\",\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"index\": true\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/documents/move")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"documents\": [\n \"<string>\"\n ],\n \"datasource_id\": \"<string>\",\n \"new_datasource_name\": \"<string>\",\n \"metadata_config\": {\n \"model_id\": \"<string>\",\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"index\": true\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"datasource_id": "<string>",
"workflow_id": "<string>",
"documents_count": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Move documents into a datasource (async)
Move documents (identified by their parse job IDs, e.g. the job_id returned by parseDocument) into an existing datasource or a newly created one. Returns a workflow_id to poll for completion.
import os
from meibel import MeibelClient
from meibel.models import MoveDocumentsRequest, MetadataConfigRequest, MetadataField
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
request = MoveDocumentsRequest(
documents=["job_8f3c1a2b9d4e", "job_1e2d3c4b5a6f"],
new_datasource_name="Support Tickets Q1",
metadata_config=MetadataConfigRequest(
type="custom",
fields=[
MetadataField(
name="ticket_priority",
type="string",
description="Priority level of the support ticket",
index=True,
),
],
),
)
response = client.documents.move(request)
print(f"workflow_id={response.workflow_id} documents_count={response.documents_count}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const result = await client.documents.move({
documents: ["job_7f3a1b2c9e", "job_9d2e4f6a1b"],
newDatasourceName: "Support Tickets Q1",
metadataConfig: {
type: "custom",
fields: [
{
name: "ticket_priority",
type: "string",
description: "Priority level of the support ticket",
index: true,
},
{
name: "resolved_at",
type: "datetime",
description: "Timestamp when the ticket was resolved",
},
],
},
});
console.log(`Workflow ${result.workflowId} moving ${result.documentsCount} documents into ${result.datasourceId}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
resp, err := client.Documents.Move(context.Background(), v2.MoveDocumentsRequest{
Documents: []string{"job_7f3a9c21", "job_9b1e4d88"},
NewDatasourceName: v2.String("Acme Corp Contracts"),
MetadataConfig: &v2.MetadataConfigRequest{
Type: "custom",
Fields: []v2.MetadataField{
{
Name: "contract_date",
Type: "datetime",
Description: "Date the contract was signed",
Index: true,
},
},
},
})
if err != nil {
panic(err)
}
fmt.Printf("workflow_id: %s, documents_count: %d\n", resp.WorkflowID, resp.DocumentsCount)
}curl --request POST \
--url https://api.meibel.ai/v2/documents/move \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"documents": [
"<string>"
],
"datasource_id": "<string>",
"new_datasource_name": "<string>",
"metadata_config": {
"model_id": "<string>",
"fields": [
{
"name": "<string>",
"description": "<string>",
"index": true
}
]
}
}
'const options = {
method: 'POST',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
documents: ['<string>'],
datasource_id: '<string>',
new_datasource_name: '<string>',
metadata_config: {
model_id: '<string>',
fields: [{name: '<string>', description: '<string>', index: true}]
}
})
};
fetch('https://api.meibel.ai/v2/documents/move', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meibel.ai/v2/documents/move",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'documents' => [
'<string>'
],
'datasource_id' => '<string>',
'new_datasource_name' => '<string>',
'metadata_config' => [
'model_id' => '<string>',
'fields' => [
[
'name' => '<string>',
'description' => '<string>',
'index' => true
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.meibel.ai/v2/documents/move")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"documents\": [\n \"<string>\"\n ],\n \"datasource_id\": \"<string>\",\n \"new_datasource_name\": \"<string>\",\n \"metadata_config\": {\n \"model_id\": \"<string>\",\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"index\": true\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/documents/move")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"documents\": [\n \"<string>\"\n ],\n \"datasource_id\": \"<string>\",\n \"new_datasource_name\": \"<string>\",\n \"metadata_config\": {\n \"model_id\": \"<string>\",\n \"fields\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"index\": true\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"datasource_id": "<string>",
"workflow_id": "<string>",
"documents_count": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
Move documents into a datasource.
The documents are referenced by the job IDs returned when they were parsed
(e.g. the job_id from parseDocument / client.documents.parse(...)),
not by object-storage paths.
Either target an existing datasource with datasource_id, or create a new one by supplying new_datasource_name. Customer and project context are injected from request headers, not the body.
Job IDs of the documents to move (e.g. the job_id returned by parseDocument)
Existing datasource to move documents into. Mutually exclusive with new_datasource_name.
Name for a new datasource created to hold the documents. Mutually exclusive with datasource_id.
Optional metadata extraction config applied to a newly created datasource. Ignored when datasource_id is set.
Show child attributes
Show child attributes
Response
Successful Response
Was this page helpful?