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

# Create a vector store file

> Upload a document with multipart field `file` (optional JSON string field `attributes`), or send JSON `{ "file_id", "attributes" }` to attach an existing document. Provide exactly one of `file` or `file_id`. Files may be up to 512 MB.



## OpenAPI

````yaml /api-reference/vector-stores.json post /v1/vector_stores/{vector_store_id}/files
openapi: 3.1.0
info:
  title: SynapsAI Vector Stores API
  version: 1.0.0
servers:
  - url: https://api.synapsai.cloud
    description: Production server
security: []
paths:
  /v1/vector_stores/{vector_store_id}/files:
    post:
      summary: Create a vector store file
      description: >-
        Upload a document with multipart field `file` (optional JSON string
        field `attributes`), or send JSON `{ "file_id", "attributes" }` to
        attach an existing document. Provide exactly one of `file` or `file_id`.
        Files may be up to 512 MB.
      operationId: createVectorStoreFile
      parameters:
        - name: vector_store_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                attributes:
                  type: string
                  description: JSON object of file attributes.
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVectorStoreFileRequest'
      responses:
        '200':
          description: Vector store file
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VectorStoreFile'
        '404':
          description: Vector store not found
components:
  schemas:
    CreateVectorStoreFileRequest:
      type: object
      required:
        - file_id
      properties:
        file_id:
          type: string
        attributes:
          type: object
          additionalProperties: true
          nullable: true
    VectorStoreFile:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - vector_store.file
        created_at:
          type: integer
        vector_store_id:
          type: string
        status:
          type: string
          enum:
            - in_progress
            - completed
            - failed
            - cancelled
        usage_bytes:
          type: integer
        attributes:
          type: object
          additionalProperties: true
          nullable: true
        chunking_strategy:
          type: object
          additionalProperties: true
        last_error:
          type: object
          nullable: true
          properties:
            code:
              type: string
            message:
              type: string
      required:
        - id
        - object
        - vector_store_id
        - status

````

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