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

# Create or update multiple evidence records by external ID



## OpenAPI

````yaml /openapi/evidence.json put /evidence/batch/external
openapi: 3.1.1
info:
  title: ARTU Compliance API
  version: 1.0.0
  description: 'API for compliance management. Documentation: https://docs.artu.ai'
servers:
  - url: https://api.artu.ai
security:
  - bearerAuth: []
    environmentHeader: []
paths:
  /evidence/batch/external:
    put:
      tags:
        - Evidence
      summary: Create or update multiple evidence records by external ID
      operationId: evidence.upsertManyByExternalId
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                items:
                  type: array
                  minItems: 1
                  maxItems: 250
                  items:
                    allOf:
                      - allOf:
                          - type: object
                            properties:
                              contentType:
                                enum:
                                  - image/jpeg
                                  - image/png
                                  - image/webp
                                  - application/pdf
                                  - application/xml
                                  - text/xml
                                type: string
                                description: Content Type
                              category:
                                enum:
                                  - invoice
                                  - receipt
                                  - bank_statement
                                  - proof_of_payment
                                  - contract
                                  - shipping
                                  - other
                                type: string
                                description: Category
                              expiresAt:
                                type: string
                                format: date
                                description: Expires At
                              externalId:
                                type: string
                                description: External ID
                              metadata:
                                type: object
                                propertyNames:
                                  type: string
                                additionalProperties: {}
                                description: Metadata
                              transactionIds:
                                type: array
                                items:
                                  type: string
                                  format: uuid
                                description: Transactions to link this evidence to
                              scope:
                                enum:
                                  - MX
                                  - US
                                type: string
                              type:
                                type: string
                                minLength: 1
                              fields:
                                type: object
                                propertyNames:
                                  type: string
                                additionalProperties: {}
                            required:
                              - scope
                              - type
                          - type: object
                            properties:
                              externalId:
                                type: string
                                minLength: 1
                            required:
                              - externalId
                      - type: object
                        properties:
                          contentType:
                            not: {}
                          filename:
                            not: {}
                          size:
                            not: {}
                          storagePath:
                            not: {}
                atomic:
                  type: boolean
                  default: true
              required:
                - items
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      atomic:
                        const: true
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            data:
                              allOf:
                                - type: object
                                  properties:
                                    category:
                                      enum:
                                        - invoice
                                        - receipt
                                        - bank_statement
                                        - proof_of_payment
                                        - contract
                                        - shipping
                                        - other
                                      type: string
                                      description: Category
                                    scope:
                                      enum:
                                        - MX
                                        - US
                                      type: string
                                      description: Scope
                                    type:
                                      type: string
                                      minLength: 1
                                      description: Type
                                    status:
                                      enum:
                                        - pending_upload
                                        - uploaded
                                        - pending_review
                                        - processing
                                        - verified
                                        - rejected
                                        - expired
                                        - no_file
                                      type: string
                                      description: Status
                                      default: pending_upload
                                    filename:
                                      anyOf:
                                        - type: string
                                          description: Filename
                                        - type: 'null'
                                    contentType:
                                      anyOf:
                                        - type: string
                                          description: Content Type
                                        - type: 'null'
                                    size:
                                      anyOf:
                                        - type: integer
                                          minimum: -9007199254740991
                                          maximum: 9007199254740991
                                          description: Size
                                        - type: 'null'
                                    expiresAt:
                                      anyOf:
                                        - type: string
                                          format: date
                                          description: Expires At
                                        - type: 'null'
                                    verifiedAt:
                                      anyOf:
                                        - type: string
                                          format: date-time
                                          description: Verified At
                                        - type: 'null'
                                    verifiedBy:
                                      anyOf:
                                        - type: string
                                          description: Verified By
                                        - type: 'null'
                                    rejectionReason:
                                      anyOf:
                                        - type: string
                                          description: Rejection Reason
                                        - type: 'null'
                                    reviewedAt:
                                      anyOf:
                                        - type: string
                                          format: date-time
                                          description: Reviewed At
                                        - type: 'null'
                                    reviewedBy:
                                      anyOf:
                                        - type: string
                                          description: Reviewed By
                                        - type: 'null'
                                    externalId:
                                      anyOf:
                                        - type: string
                                          description: External ID
                                        - type: 'null'
                                    fields:
                                      anyOf:
                                        - type: object
                                          propertyNames:
                                            type: string
                                          additionalProperties: {}
                                          description: Fields
                                        - type: 'null'
                                    metadata:
                                      anyOf:
                                        - type: object
                                          propertyNames:
                                            type: string
                                          additionalProperties: {}
                                          description: Metadata
                                        - type: 'null'
                                  required:
                                    - category
                                    - scope
                                    - type
                                - type: object
                                  properties:
                                    id:
                                      type: string
                                      format: uuid
                                    createdAt:
                                      type: string
                                      format: date-time
                                    updatedAt:
                                      type: string
                                      format: date-time
                                  required:
                                    - id
                                    - createdAt
                                    - updatedAt
                            action:
                              enum:
                                - created
                                - updated
                                - skipped
                              type: string
                          required:
                            - data
                            - action
                    required:
                      - atomic
                      - data
                  - type: object
                    properties:
                      atomic:
                        const: false
                      succeeded:
                        type: array
                        items:
                          type: object
                          properties:
                            index:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                            data:
                              type: object
                              properties:
                                data:
                                  allOf:
                                    - type: object
                                      properties:
                                        category:
                                          enum:
                                            - invoice
                                            - receipt
                                            - bank_statement
                                            - proof_of_payment
                                            - contract
                                            - shipping
                                            - other
                                          type: string
                                          description: Category
                                        scope:
                                          enum:
                                            - MX
                                            - US
                                          type: string
                                          description: Scope
                                        type:
                                          type: string
                                          minLength: 1
                                          description: Type
                                        status:
                                          enum:
                                            - pending_upload
                                            - uploaded
                                            - pending_review
                                            - processing
                                            - verified
                                            - rejected
                                            - expired
                                            - no_file
                                          type: string
                                          description: Status
                                          default: pending_upload
                                        filename:
                                          anyOf:
                                            - type: string
                                              description: Filename
                                            - type: 'null'
                                        contentType:
                                          anyOf:
                                            - type: string
                                              description: Content Type
                                            - type: 'null'
                                        size:
                                          anyOf:
                                            - type: integer
                                              minimum: -9007199254740991
                                              maximum: 9007199254740991
                                              description: Size
                                            - type: 'null'
                                        expiresAt:
                                          anyOf:
                                            - type: string
                                              format: date
                                              description: Expires At
                                            - type: 'null'
                                        verifiedAt:
                                          anyOf:
                                            - type: string
                                              format: date-time
                                              description: Verified At
                                            - type: 'null'
                                        verifiedBy:
                                          anyOf:
                                            - type: string
                                              description: Verified By
                                            - type: 'null'
                                        rejectionReason:
                                          anyOf:
                                            - type: string
                                              description: Rejection Reason
                                            - type: 'null'
                                        reviewedAt:
                                          anyOf:
                                            - type: string
                                              format: date-time
                                              description: Reviewed At
                                            - type: 'null'
                                        reviewedBy:
                                          anyOf:
                                            - type: string
                                              description: Reviewed By
                                            - type: 'null'
                                        externalId:
                                          anyOf:
                                            - type: string
                                              description: External ID
                                            - type: 'null'
                                        fields:
                                          anyOf:
                                            - type: object
                                              propertyNames:
                                                type: string
                                              additionalProperties: {}
                                              description: Fields
                                            - type: 'null'
                                        metadata:
                                          anyOf:
                                            - type: object
                                              propertyNames:
                                                type: string
                                              additionalProperties: {}
                                              description: Metadata
                                            - type: 'null'
                                      required:
                                        - category
                                        - scope
                                        - type
                                    - type: object
                                      properties:
                                        id:
                                          type: string
                                          format: uuid
                                        createdAt:
                                          type: string
                                          format: date-time
                                        updatedAt:
                                          type: string
                                          format: date-time
                                      required:
                                        - id
                                        - createdAt
                                        - updatedAt
                                action:
                                  enum:
                                    - created
                                    - updated
                                    - skipped
                                  type: string
                              required:
                                - data
                                - action
                          required:
                            - index
                            - data
                      failed:
                        type: array
                        items:
                          type: object
                          properties:
                            index:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                            error:
                              type: object
                              properties:
                                code:
                                  enum:
                                    - VALIDATION_ERROR
                                    - NOT_FOUND
                                    - UNAUTHORIZED
                                    - FORBIDDEN
                                    - RATE_LIMITED
                                    - CONFLICT
                                    - INTERNAL_ERROR
                                    - SERVICE_UNAVAILABLE
                                    - INVALID_OPERATION
                                    - COMPLIANCE_ERROR
                                  type: string
                                message:
                                  type: string
                              required:
                                - code
                                - message
                          required:
                            - index
                            - error
                    required:
                      - atomic
                      - succeeded
                      - failed
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key authentication. Obtain your API key from the dashboard.
    environmentHeader:
      type: apiKey
      in: header
      name: X-Environment
      description: Target environment for the request. Must be "test" or "live".

````