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

# Migrate Documents

Use this API to migrate a document to a new document ID within an organization. Returns a `migrationId` that can be used to poll the migration status.

# Endpoint

`POST https://api.velt.dev/v2/organizations/documents/migrate`

# Headers

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**organizationId** `string` *required*

Organization ID

**documentId** `string` *required*

ID of the document to migrate

**newDocumentId** `string` *required*

New document ID to migrate the document to

## **Example Requests**

#### Migrate a document to a new document ID

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documentId": "yourDocumentId",
    "newDocumentId": "yourNewDocumentId"
  }
}
```

# Response

#### Success Response

Use the returned `migrationId` to poll progress with the [Migrate Documents Status](https://velt.dev/docs/api-reference/rest-apis/v2/documents/migrate-documents-status.md) endpoint.

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Document migration started successfully.",
    "data": {
      "migrationId": "yourMigrationId"
    }
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

```js theme={null}
{
  "result": {
    "status": "success",
    "message": "Document migration started successfully.",
    "data": {
      "migrationId": "yourMigrationId"
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.