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

# Upload Resource

> Uploads data to the partner resource table after validating it against the specified schema definition. When upsert is enabled, new data is merged with existing data (preserving existing fields not included in the request). Null values will explicitly delete the field (required fields cannot be deleted and will return a validation error).



## OpenAPI

````yaml POST /api/resources/{schemaDefinitionNameOrId}
openapi: 3.0.0
info:
  title: Reach API
  version: 1.0.0
  description: API documentation for Reach platform
servers:
  - url: https://api.embedreach.com
    description: Production server
security: []
paths:
  /api/resources/{schemaDefinitionNameOrId}:
    post:
      tags:
        - Partner Resources
      summary: Upload Resource
      description: >-
        Uploads data to the partner resource table after validating it against
        the specified schema definition. When upsert is enabled, new data is
        merged with existing data (preserving existing fields not included in
        the request). Null values will explicitly delete the field (required
        fields cannot be deleted and will return a validation error).
      parameters:
        - name: reach-tenant-id
          in: header
          required: false
          schema:
            type: string
            description: >-
              If using a platform scoped JWT, you can pass in a header to
              impersonate a specific tenant to impersonate the request as.
        - schema:
            type: string
            description: The name or id of the schema definition to upload the resource to
          required: true
          description: The name or id of the schema definition to upload the resource to
          name: schemaDefinitionNameOrId
          in: path
        - schema:
            type: string
            enum:
              - upsert
              - reject
            default: upsert
            description: >-
              What to do if the resource already exists. upsert will merge new
              data with existing data (PATCH-like behavior), preserving existing
              fields not included in the request. Null values will delete
              fields. reject will throw an error if the resource already exists
          required: false
          description: >-
            What to do if the resource already exists. upsert will merge new
            data with existing data (PATCH-like behavior), preserving existing
            fields not included in the request. Null values will delete fields.
            reject will throw an error if the resource already exists
          name: onconflict
          in: query
        - schema:
            type: boolean
            nullable: true
            default: false
            description: >-
              Whether to allow extra fields that are not defined in the schema.
              If true, extra fields will be accepted but not saved. If false,
              requests with extra fields will be rejected.
          required: false
          description: >-
            Whether to allow extra fields that are not defined in the schema. If
            true, extra fields will be accepted but not saved. If false,
            requests with extra fields will be rejected.
          name: ignoreUnknownFields
          in: query
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  additionalProperties:
                    nullable: true
              required:
                - data
      responses:
        '200':
          description: Status 200 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      testMismatch:
                        type: boolean
                        description: >-
                          This is a deliberate schema mismatch to test ESLint
                          validation
                      nonExistentProperty:
                        type: number
                    required:
                      - testMismatch
                      - nonExistentProperty
                required:
                  - success
        '400':
          description: Bad Request - Validation or request error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
                  message:
                    type: string
                    description: Error message describing what went wrong
                  errors:
                    type: array
                    items:
                      type: string
                    description: Optional array of specific validation errors
                required:
                  - message

````