> ## 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 a file record and get presigned upload URL



## OpenAPI

````yaml /openapi/custom-reference-data.json post /custom-reference-data/sources/{sourceId}/files
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:
  /custom-reference-data/sources/{sourceId}/files:
    post:
      tags:
        - Custom Reference Data
      summary: Create a file record and get presigned upload URL
      operationId: customReferenceData.createFile
      parameters:
        - name: sourceId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  minLength: 1
                  maxLength: 255
                contentType:
                  type: string
                  minLength: 1
                size:
                  type: integer
                  minimum: -9007199254740991
                  maximum: 9007199254740991
                  exclusiveMinimum: 0
                sheetName:
                  type: string
                  minLength: 1
              required:
                - filename
                - contentType
                - size
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  file:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      sourceId:
                        type: string
                        format: uuid
                      filename:
                        type: string
                      contentType:
                        type: string
                      size:
                        anyOf:
                          - type: number
                          - type: 'null'
                      status:
                        enum:
                          - pending_upload
                          - uploaded
                          - processing
                          - synced
                          - error
                        type: string
                      sheetName:
                        anyOf:
                          - type: string
                          - type: 'null'
                      rowCount:
                        anyOf:
                          - type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          - type: 'null'
                      errorMessage:
                        anyOf:
                          - type: string
                          - type: 'null'
                      snapshotAt:
                        anyOf:
                          - type: string
                            format: date-time
                          - type: 'null'
                      analysisStatus:
                        anyOf:
                          - enum:
                              - pending
                              - analyzing
                              - analyzed
                              - approved
                              - error
                            type: string
                          - type: 'null'
                      analysisResult:
                        anyOf:
                          - type: object
                            properties:
                              headerRow:
                                type: integer
                                minimum: 0
                                maximum: 9007199254740991
                              dataStartRow:
                                type: integer
                                minimum: 0
                                maximum: 9007199254740991
                              dataEndRow:
                                anyOf:
                                  - type: integer
                                    minimum: 0
                                    maximum: 9007199254740991
                                  - type: 'null'
                              skipRows:
                                type: array
                                items:
                                  type: integer
                                  minimum: 0
                                  maximum: 9007199254740991
                              columns:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    originalName:
                                      type: string
                                    key:
                                      type: string
                                    label:
                                      type: string
                                    type:
                                      enum:
                                        - string
                                        - number
                                        - date
                                        - boolean
                                      type: string
                                    description:
                                      type: string
                                    ignored:
                                      type: boolean
                                      default: false
                                    transform:
                                      anyOf:
                                        - type: string
                                        - type: 'null'
                                  required:
                                    - originalName
                                    - key
                                    - label
                                    - type
                                    - description
                              sampleRows:
                                type: array
                                items:
                                  type: object
                                  propertyNames:
                                    type: string
                                  additionalProperties: {}
                              confidence:
                                type: number
                                minimum: 0
                                maximum: 1
                              estimatedRowCount:
                                type: integer
                                minimum: 0
                                maximum: 9007199254740991
                            required:
                              - headerRow
                              - dataStartRow
                              - dataEndRow
                              - skipRows
                              - columns
                              - sampleRows
                              - confidence
                              - estimatedRowCount
                          - type: 'null'
                      availableSheets:
                        anyOf:
                          - type: array
                            items:
                              type: string
                          - type: 'null'
                      conversationHistory:
                        anyOf:
                          - type: array
                            items:
                              type: object
                              properties:
                                role:
                                  enum:
                                    - user
                                    - assistant
                                  type: string
                                content:
                                  type: string
                              required:
                                - role
                                - content
                          - type: 'null'
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - id
                      - sourceId
                      - filename
                      - contentType
                      - size
                      - status
                      - sheetName
                      - rowCount
                      - errorMessage
                      - snapshotAt
                      - analysisStatus
                      - analysisResult
                      - availableSheets
                      - conversationHistory
                      - createdAt
                      - updatedAt
                  uploadUrl:
                    type: string
                required:
                  - file
                  - uploadUrl
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".

````