> ## 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 an evidence record by external ID



## OpenAPI

````yaml /openapi/evidence.json put /evidence/external/{externalId}
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/external/{externalId}:
    put:
      tags:
        - Evidence
      summary: Create or update an evidence record by external ID
      operationId: evidence.upsertByExternalId
      parameters:
        - name: externalId
          in: path
          required: true
          schema:
            allOf:
              - type: string
                description: External ID
              - type: string
                minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contentType:
                  allOf:
                    - enum:
                        - image/jpeg
                        - image/png
                        - image/webp
                        - application/pdf
                        - application/xml
                        - text/xml
                      type: string
                      description: Content Type
                    - not: {}
                category:
                  enum:
                    - invoice
                    - receipt
                    - bank_statement
                    - proof_of_payment
                    - contract
                    - shipping
                    - other
                  type: string
                  description: Category
                expiresAt:
                  type: string
                  format: date
                  description: Expires At
                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: {}
                filename:
                  not: {}
                size:
                  not: {}
                storagePath:
                  not: {}
              required:
                - scope
                - type
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                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
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".

````