> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meibel.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.



## OpenAPI

````yaml /api-v2.json post /documents/move
openapi: 3.1.0
info:
  title: Meibel AI API
  summary: Meibel Gateway Service
  description: >-
    Our API allows you to interact with our services. Read the
    [docs](https://docs.meibel.ai) to learn how to use it.
  version: 0.6.4
servers:
  - url: https://api.meibel.ai/v2
    description: Meibel API (v2)
  - url: https://api.dev.meibel.ai/v2
    description: Meibel Dev API (v2)
  - url: http://localhost:8000/v2
    description: Local Development
security: []
tags:
  - name: Datasources
    description: v2 datasource management
  - name: Data Elements
    description: v2 data element CRUD and search
  - name: File Upload
    description: Upload files to a datasource and track upload progress
  - name: Ingest
    description: Trigger and monitor datasource ingestion
  - name: Datasource Downloads
    description: Export all datasource content as a zip archive
  - name: Table Descriptions
    description: v2 table and column descriptions
  - name: Metadata Model Catalog
    description: v2 metadata model catalog
  - name: Confidence Scoring
    description: v2 confidence scoring jobs and summaries
  - name: Documents
    description: Parse and transform documents into structured data
  - name: Agents
    description: Agent definition management
  - name: Sessions
    description: Agent session (execution) management and chat
  - name: Execution Policies
    description: Data access and tool usage constraints scoped to agent sessions
  - name: Artifact Schemas
    description: Agent artifact schema management
paths:
  /documents/move:
    post:
      tags:
        - Documents
      summary: Move documents into a datasource (async)
      description: >-
        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.
      operationId: moveDocuments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MoveDocumentsRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MoveDocumentsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
      x-codeSamples:
        - lang: Python
          label: Python
          source: |-
            from meibel import MeibelClient

            client = MeibelClient(api_key="your-api-key")

            # Create request body
            body = MoveDocumentsRequest(name="Example")

            result = client.documents.move(body=body)
            print(result)
        - lang: TypeScript
          label: TypeScript
          source: |-
            import { MeibelClient } from 'meibel';

            const client = new MeibelClient({ apiKey: 'your-api-key' });

            // Create request body
            const body = { name: 'Example' };

            const result = await client.documents.move(body);
            console.log(result);
        - lang: Go
          label: Go
          source: |-
            import v2 "github.com/meibel-ai/meibel-go/v2"

            client := v2.NewClient(v2.WithAPIKey("your-api-key"))
            ctx := context.Background()

            // Create request body
            body := v2.MoveDocumentsRequest{
                Name: "Example",
            }

            result, err := client.Documents.Move(ctx, body)
            if err != nil {
                log.Fatal(err)
            }
            fmt.Println(result)
components:
  schemas:
    MoveDocumentsRequest:
      properties:
        documents:
          items:
            type: string
          type: array
          title: Documents
          description: >-
            Job IDs of the documents to move (e.g. the job_id returned by
            parseDocument)
        datasource_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Datasource Id
          description: >-
            Existing datasource to move documents into. Mutually exclusive with
            new_datasource_name.
        new_datasource_name:
          anyOf:
            - type: string
            - type: 'null'
          title: New Datasource Name
          description: >-
            Name for a new datasource created to hold the documents. Mutually
            exclusive with datasource_id.
        metadata_config:
          anyOf:
            - $ref: '#/components/schemas/MetadataConfigRequest'
            - type: 'null'
          description: >-
            Optional metadata extraction config applied to a newly created
            datasource. Ignored when datasource_id is set.
      type: object
      required:
        - documents
      title: MoveDocumentsRequest
      description: >-
        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.
    MoveDocumentsResponse:
      properties:
        datasource_id:
          type: string
          title: Datasource Id
          description: ID of the datasource the documents are being moved into
        workflow_id:
          type: string
          title: Workflow Id
          description: ID of the move workflow - poll for completion
        documents_count:
          type: integer
          title: Documents Count
          description: Number of documents submitted for move
      type: object
      required:
        - datasource_id
        - workflow_id
        - documents_count
      title: MoveDocumentsResponse
      description: Result of starting an asynchronous document move workflow.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MetadataConfigRequest:
      properties:
        type:
          type: string
          enum:
            - catalog
            - custom
          title: Type
          description: >-
            Use 'catalog' to select a pre-built extraction model (set model_id);
            use 'custom' to define your own fields (set fields)
        model_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Id
          description: >-
            Pre-built model ID from the metadata model catalog — required when
            type is 'catalog'
        fields:
          anyOf:
            - items:
                $ref: '#/components/schemas/MetadataField'
              type: array
            - type: 'null'
          title: Fields
          description: Custom field definitions to extract — required when type is 'custom'
      type: object
      required:
        - type
      title: MetadataConfigRequest
      description: Configure automatic metadata extraction from documents on ingest.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    MetadataField:
      properties:
        name:
          type: string
          title: Name
          description: Field name (snake_case)
        type:
          type: string
          enum:
            - string
            - integer
            - float
            - boolean
            - datetime
            - uuid
            - geo
            - list[string]
          title: Type
          description: Data type of the field
        description:
          type: string
          title: Description
          description: What this field captures
        index:
          type: boolean
          title: Index
          description: Whether this field is indexed for filtering
          default: true
      type: object
      required:
        - name
        - type
        - description
      title: MetadataField
      description: A single field extracted from documents during ingest.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Meibel-API-Key

````