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

# Add Documents

Use this API to add documents with metadata to an organization.

# Endpoint

`POST https://api.velt.dev/v1/organizations/documents/add`

# 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

**documents** `Document[]` *required*

Array of Document objects

**folderId** `string` *required*

Folder ID to add the documents to.

## **Example Requests**

#### 1. Create new documents

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documents": [
      {
        "documentId": "yourDocumentId",
        "documentName": "Your Document Name"
      }
    ]
  }
}
```

#### 2. Create new documents in a specific folder

```JSON theme={null}
{
  "data": {
    "organizationId": "yourOrganizationId",
    "documents": [
      {
        "documentId": "yourDocumentId",
        "documentName": "Your Document Name"
      }
    ],
    "folderId": "yourFolderId"
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Document(s) added successfully.",
    "data": {
      "yourDocumentId": {
        "success": true,
        "id": "8121657101517513",
        "message": "Added Successfully"
      }
    }
  }
}
```

#### Failure Response

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

```js theme={null}
{
  "result": {
    "status": "success",
    "message": "Document(s) added successfully.",
    "data": {
      "yourDocumentId": {
        "success": true,
        "id": "8121657101517513",
        "message": "Added Successfully"
      }
    }
  }
}
```


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