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

# Create an upsert

> An upsert is an operation that allows you to create or update items in a single operation. You don't have to worry about whether the item already exists or not.

The `metadata` field stores additional context about your items that won't be used for search but enable filtering capabilities.

The `tenant` field is used to identify the organisation to which the items belong. It is required if you've selected `multi` from the project settings.



## OpenAPI

````yaml https://vectorify.ai/api.json post /upserts
openapi: 3.1.0
info:
  title: Vectorify
  version: 1.0.0
servers:
  - url: https://api.vectorify.ai/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Query
  - name: Chats
  - name: Upserts
  - name: Items
  - name: Collections
paths:
  /upserts:
    post:
      tags:
        - Upserts
      summary: Create an upsert
      description: >-
        An upsert is an operation that allows you to create or update items in a
        single operation. You don't have to worry about whether the item already
        exists or not.


        The `metadata` field stores additional context about your items that
        won't be used for search but enable filtering capabilities.


        The `tenant` field is used to identify the organisation to which the
        items belong. It is required if you've selected `multi` from the project
        settings.
      operationId: upserts.store
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/App.Http.Requests.Api.Upsert'
      responses:
        '201':
          description: '`UpsertStore`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/UpsertStore'
                required:
                  - data
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    App.Http.Requests.Api.Upsert:
      type: object
      properties:
        collection:
          type: object
          properties:
            slug:
              type: string
              example: invoices
            metadata:
              type:
                - array
                - 'null'
              example:
                customer_name:
                  type: string
                status:
                  type: enum
                  options:
                    - draft
                    - sent
                    - paid
              items:
                type: string
              maxItems: 10
          required:
            - slug
        items:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                example: '123'
                maxLength: 50
              data:
                type: array
                example:
                  customer_name: John Doe
                  status: draft
                  amount: '100'
                  currency: USD
                  due_date: '2023-10-01'
                items:
                  type: string
              metadata:
                type:
                  - array
                  - 'null'
                example:
                  customer_name: John Doe
                  status: draft
                items:
                  type: string
                maxItems: 10
              tenant:
                type:
                  - integer
                  - 'null'
                example: 987
              url:
                type:
                  - string
                  - 'null'
            required:
              - id
              - data
          maxItems: 90
      required:
        - items
      title: App.Http.Requests.Api.Upsert
    UpsertStore:
      type: object
      properties:
        result:
          type: string
          enum:
            - Queued
        created_at:
          type: string
      required:
        - result
        - created_at
      title: UpsertStore
  responses:
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Api-Key

````