openapi: 3.1.0
info:
  title: Dromo
  description: >-
    Dromo's APIs provide convenient programmatic access to your uploads and
    schemas. You can use them to create powerful automated workflows.
  termsOfService: https://dromo.io/legal/terms
  contact:
    name: Dromo
    email: contact@dromo.io
  version: '1.0'
servers:
  - url: https://app.dromo.io/api/v1
security:
  - api_key: []
tags:
  - name: uploads
    description: Viewing completed imports
  - name: import-schemas
    description: Creating and viewing import schemas
  - name: headless
    description: Creating and viewing headless imports
paths:
  /schemas/:
    get:
      operationId: listImportSchemas
      summary: Get all import schemas
      tags:
        - import-schemas
      responses:
        '200':
          description: List import schemas
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ImportSchema'
    post:
      operationId: createImportSchema
      summary: Create a new import schema
      tags:
        - import-schemas
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportSchema'
      responses:
        '201':
          description: Schema Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportSchema'
  /schemas/{id}/:
    get:
      operationId: getImportSchema
      summary: Get an import schema
      tags:
        - import-schemas
      parameters:
        - name: id
          in: path
          description: Headless import ID
          required: true
          schema:
            type: string
            format: uuid
            example: 66d6300d-1414-4655-83b4-8c80fc527315
      responses:
        '200':
          description: An import schema
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportSchema'
        '404':
          description: Not found
    put:
      operationId: updateImportSchema
      summary: Update an import schema
      tags:
        - import-schemas
      parameters:
        - name: id
          in: path
          description: Headless import ID
          required: true
          schema:
            type: string
            format: uuid
            example: 66d6300d-1414-4655-83b4-8c80fc527315
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportSchema'
      responses:
        '200':
          description: The updated schema
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportSchema'
        '404':
          description: Not found
    delete:
      operationId: deleteImportSchema
      summary: Delete an import schema
      tags:
        - import-schemas
      parameters:
        - name: id
          in: path
          description: Headless import ID
          required: true
          schema:
            type: string
            format: uuid
            example: 66d6300d-1414-4655-83b4-8c80fc527315
      responses:
        '204':
          description: Import schema deleted
  /uploads/:
    get:
      operationId: listUploads
      summary: Get all uploads
      tags:
        - uploads
      parameters:
        - name: start
          in: query
          description: start index
          schema:
            type: number
            default: 0
        - name: end
          in: query
          description: end index, defaults to max return value, 10000
          schema:
            type: number
            default: 10000
      responses:
        '200':
          description: List uploads
          content:
            application/json:
              schema:
                type: object
                properties:
                  start:
                    type: number
                  end:
                    type: number
                  total_num_uploads:
                    type: number
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Import'
  /upload/{id}/data/:
    get:
      operationId: getUploadData
      summary: Get upload data
      tags:
        - uploads
      parameters:
        - name: id
          in: path
          schema:
            type: string
            format: uuid
        - name: start
          in: query
          description: start index
          schema:
            type: number
            default: 0
        - name: end
          in: query
          description: end index, defaults to max return value, 10000
          schema:
            type: number
            default: 10000
      responses:
        '200':
          description: >-
            Final import data. This endpoint only returns 10,000 rows at a time
            (per request). To specify which rows to return, you can pass in
            optional parameters start and end to specify the rows you want. For
            exmaple:
            https://app.dromo.io/api/v1/upload/<uploadId>/data/?start=0&end=10
            would return 11 items, indexed 0 to 10.
          content:
            application/json:
              schema:
                type: object
                properties:
                  start:
                    type: number
                  end:
                    type: number
                  total_num_rows:
                    type: number
                  data:
                    type: array
                    items:
                      type: object
                    example:
                      - name: Jack
                        email_address: jack@thehill.com
                      - name: Jill
                        email_address: jill@thehill.com
  /upload/{id}/metadata/:
    get:
      operationId: getUploadMetadata
      summary: Get upload metadata
      tags:
        - uploads
      parameters:
        - name: id
          in: path
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Upload metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportDetail'
  /upload/{id}/delete/:
    post:
      operationId: deleteUpload
      summary: Delete an upload permanently
      tags:
        - uploads
      parameters:
        - name: id
          in: path
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Deleted
  /headless/imports/{id}/:
    get:
      tags:
        - headless
      summary: Retrieve headless import
      operationId: retrieveHeadlessImport
      parameters:
        - name: id
          in: path
          description: Headless import ID
          required: true
          schema:
            type: string
            format: uuid
            example: 66d6300d-1414-4655-83b4-8c80fc527315
      responses:
        '200':
          description: Return headless import
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HeadlessImportFull'
        '404':
          description: Not found.
    delete:
      tags:
        - headless
      summary: Delete headless import
      operationId: deleteHeadlessImport
      parameters:
        - name: id
          in: path
          description: Headless import ID
          required: true
          schema:
            type: string
            format: uuid
            example: 66d6300d-1414-4655-83b4-8c80fc527315
      responses:
        '204':
          description: Headless import deleted successfully
        '404':
          description: Not found.
  /headless/imports/{id}/data/:
    get:
      tags:
        - headless
      summary: Retrieve headless import result data
      operationId: retrieveHeadlessImportResultData
      parameters:
        - name: id
          in: path
          description: Headless import ID
          required: true
          schema:
            type: string
            format: uuid
            example: 66d6300d-1414-4655-83b4-8c80fc527315
        - name: start
          in: query
          description: start index
          schema:
            type: number
            default: 0
        - name: end
          in: query
          description: end index, defaults to max return value, 10000
          schema:
            type: number
            default: 10000
      responses:
        '200':
          description: Result data from completed import
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResultData'
        '400':
          description: >-
            Schema has not been successfully completed, so there is no result
            data
        '404':
          description: No schema found with that ID
  /headless/imports/:
    get:
      tags:
        - headless
      summary: List headless imports
      operationId: listHeadlessImports
      parameters:
        - name: offset
          in: query
          description: starting index
          schema:
            type: number
            default: 0
        - name: limit
          in: query
          description: total number of imports to return, defaults 100 max 1000
          schema:
            type: number
            default: 100
      responses:
        '200':
          description: List headless imports
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: number
                    example: 75
                  next:
                    oneOf:
                      - type: string
                        example: >-
                          https://app.dromo.io/api/v1/api/v1/headless/imports/?limit=10&offset=10
                      - type: null
                  previous:
                    oneOf:
                      - type: string
                        example: >-
                          https://app.dromo.io/api/v1/api/v1/headless/imports/?limit=10&offset=10
                      - type: null
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/HeadlessImport'
    post:
      tags:
        - headless
      summary: Create a new headless import
      operationId: createHeadlessImport
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                schema_id:
                  type: string
                  example: 94187d21-9820-420f-b08c-a80cbbf52604
                original_filename:
                  type: string
                  example: user.csv
                import_metadata:
                  $ref: '#/components/schemas/ImportMetaData'
      responses:
        '201':
          description: Import successfully initialized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HeadlessImportFull'
        '404':
          description: No schema found with that id
      security:
        - api_key: []
components:
  schemas:
    HeadlessImport:
      type: object
      properties:
        id:
          type: string
          example: 94187d21-9820-420f-b08c-a80cbbf52604
          readOnly: true
        schema_id:
          type: string
          example: 94187d21-9820-420f-b08c-a80cbbf52604
        status:
          type: string
          enum:
            - AWAITING_UPLOAD
            - RUNNING
            - SUCCESSFUL
            - FAILED
            - NEEDS_REVIEW
          example: AWAITING_UPLOAD
          readOnly: true
        original_filename:
          type: string
          example: user_data.csv
        created_date:
          type: string
          format: date-time
          readOnly: true
        modified_date:
          type: string
          format: date-time
          readOnly: true
    HeadlessImportFull:
      allOf:
        - $ref: '#/components/schemas/HeadlessImport'
        - type: object
          properties:
            upload:
              type: string
              example: >-
                https://dromo-headless-imports-prod.s3.us-west-2.amazonaws.com/test-key-123?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIARY5HJCMTO2AUIBEU%2F20230227%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20230227T160315Z&X-Amz-Expires=1800&X-Amz-SignedHeaders=host&X-Amz-Signature=0998ccd9c93142498784d1046bc2709612430f6a0a573572f743e16896d4c498
              readOnly: true
            review_url:
              type: string
              example: >-
                https://app.dromo.io/headless/94187d21-9820-420f-b08c-a80cbbf52604/
              readOnly: true
            result_metadata:
              oneOf:
                - type: object
                - type: null
              example: null
              readOnly: true
            import_errors:
              oneOf:
                - type: array
                  items:
                    type: object
                - type: null
              example: null
              readOnly: true
    ImportMetaData:
      oneOf:
        - type: object
          properties:
            user:
              oneOf:
                - type: object
                  $ref: '#/components/schemas/UserSchema'
                - type: null
        - type: null
      example:
        user:
          id: jeff_id
          name: Jeff
          email: jeff@dromo.io
          companyName: Dromo
          companyId: dromo_id
    ResultData:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
        start:
          type: integer
        end:
          type: integer
        total_num_rows:
          type: integer
      example:
        data:
          - last: Phillips
            email: jason@moxie.xyz
        start: 0
        end: 0
        total_num_rows: 1
    ImportSchema:
      type: object
      example:
        id: 0631f213-ca91-41e0-9a88-7430c7d0ca28
        name: last - email
        fields:
          - key: lastName
            type: string
            label: last
            validators:
              - validate: required
          - key: email
            type: email
            label: email
            validators:
              - validate: required
        settings:
          webhookUrl: https://webhook.site/ce982a24-c8f1-406d-a372-75beea7c3db4
          styleOverrides:
            global:
              primaryTextColor: '#394B59'
              secondaryTextColor: '#667D8D'
            primaryButton:
              textColor: '#FFFFFF'
              backgroundColor: '#007BFF'
            secondaryButton:
              textColor: '#FFFFFF'
              backgroundColor: '#6C757D'
          allowCustomFields: false
          invalidDataBehavior: BLOCK_SUBMIT
        hooks:
          rowHooks:
            - (record) => { record.row.foo.value = 'bar'; return record }
      properties:
        id:
          type: string
          readOnly: true
        name:
          type: string
        fields:
          type: array
          items:
            $ref: '#/components/schemas/DeveloperFieldSchema'
        settings:
          $ref: '#/components/schemas/DeveloperSettingsSchema'
        hooks:
          $ref: '#/components/schemas/HooksSchema'
      required:
        - name
        - fields
        - settings
    Import:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 64b07421-f291-4449-a7d4-0f2e6ab912c4
        import_identifier:
          type: string
          example: new products
        raw_upload:
          type: object
          properties:
            filename:
              type: string
              example: my_file.csv
            storage_key:
              type: string
              example: c82e33b1-cea6-4271-9d21-38140c13fe28-my_file.csv
        user:
          $ref: '#/components/schemas/UserSchema'
        created_date:
          type: string
          format: date-time
        upload_status:
          type: string
          enum:
            - PENDING_UPLOAD
            - PROCESSING
            - PROCESSED
            - FAILED
        total_num_rows:
          type: number
        invalid_row_indexes:
          type: array
          items:
            type: number
        errors:
          type: array
          items:
            type: object
        storage_key:
          type: string
          format: uuid
          example: 64b07421-f291-4449-a7d4-0f2e6ab912c4
        field_order:
          type: array
          items:
            type: string
    ImportDetail:
      allOf:
        - $ref: '#/components/schemas/Import'
        - type: object
          properties:
            raw_upload:
              type: object
              properties:
                download_url:
                  type: string
                  example: >-
                    https://dromo-imports-prod.s3.us-west-2.amazonaws.com/test-key-123?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIARY5HJCMTO2AUIBEU%2F20230227%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20230227T160315Z&X-Amz-Expires=1800&X-Amz-SignedHeaders=host&X-Amz-Signature=0998ccd9c93142498784d1046bc2709612430f6a0a573572f743e16896d4c498
    errorMessage: &ref_0
      type: string
    level: &ref_1
      type: string
      enum:
        - info
        - warning
        - error
    RequiredValidatorSchema: &ref_2
      type: object
      properties:
        errorMessage:
          $ref: '#/components/schemas/errorMessage'
        level:
          $ref: '#/components/schemas/level'
        validate:
          type: string
          const: required
      required:
        - validate
      additionalProperties: false
    UniqueValidatorSchema: &ref_3
      type: object
      properties:
        errorMessage:
          $ref: '#/components/schemas/errorMessage'
        level:
          $ref: '#/components/schemas/level'
        validate:
          type: string
          enum:
            - unique
            - unique_case_insensitive
      required:
        - validate
      additionalProperties: false
    UniqueWithValidatorSchema: &ref_4
      type: object
      properties:
        errorMessage:
          $ref: '#/components/schemas/errorMessage'
        level:
          $ref: '#/components/schemas/level'
        validate:
          type: string
          const: unique_with
        uniqueKey:
          type: string
      required:
        - validate
        - uniqueKey
      additionalProperties: false
    RegexValidatorSchema: &ref_5
      type: object
      properties:
        errorMessage:
          $ref: '#/components/schemas/errorMessage'
        level:
          $ref: '#/components/schemas/level'
        validate:
          type: string
          enum:
            - regex_match
            - regex_exclude
        regex:
          anyOf:
            - type: string
        regexOptions:
          type: object
          properties:
            ignoreCase:
              type: boolean
            dotAll:
              type: boolean
            multiline:
              type: boolean
            unicode:
              type: boolean
          additionalProperties: false
      required:
        - validate
        - regex
      additionalProperties: false
    RequireWithValidatorSchema: &ref_6
      type: object
      properties:
        errorMessage:
          $ref: '#/components/schemas/errorMessage'
        level:
          $ref: '#/components/schemas/level'
        validate:
          type: string
          enum:
            - require_with
            - require_without
            - require_with_all
            - require_without_all
        fields:
          type: array
          items:
            type: string
      required:
        - validate
        - fields
      additionalProperties: false
    RequireWithValuesValidatorSchema: &ref_7
      type: object
      properties:
        errorMessage:
          $ref: '#/components/schemas/errorMessage'
        level:
          $ref: '#/components/schemas/level'
        validate:
          type: string
          enum:
            - require_with_values
            - require_without_values
            - require_with_all_values
            - require_without_all_values
        fieldValues:
          type: object
          additionalProperties: {}
      required:
        - validate
        - fieldValues
      additionalProperties: false
    ValidatorSchema: &ref_8
      anyOf:
        - $ref: '#/components/schemas/RequiredValidatorSchema'
        - $ref: '#/components/schemas/UniqueValidatorSchema'
        - $ref: '#/components/schemas/UniqueWithValidatorSchema'
        - $ref: '#/components/schemas/RegexValidatorSchema'
        - $ref: '#/components/schemas/RequireWithValidatorSchema'
        - $ref: '#/components/schemas/RequireWithValuesValidatorSchema'
    label: &ref_9
      type: string
    key: &ref_10
      type: string
    description: &ref_11
      type: string
    alternateMatches: &ref_12
      type: array
      items:
        type: string
    validators: &ref_13
      type: array
      items:
        $ref: '#/components/schemas/ValidatorSchema'
      default: []
    invalidValueMessage: &ref_14
      type: string
    readOnly: &ref_15
      type: boolean
      default: false
    hidden: &ref_16
      type: boolean
      default: false
    requireMapping: &ref_17
      type: boolean
    SelectOptionSchema: &ref_21
      type: object
      properties:
        label:
          type: string
        value:
          type: string
        alternateMatches:
          type: array
          items:
            type: string
      required:
        - label
        - value
      additionalProperties: false
    StringFieldSchema: &ref_18
      type: object
      properties:
        label:
          $ref: '#/components/schemas/label'
        key:
          $ref: '#/components/schemas/key'
        description:
          $ref: '#/components/schemas/description'
        alternateMatches:
          $ref: '#/components/schemas/alternateMatches'
        validators:
          $ref: '#/components/schemas/validators'
        invalidValueMessage:
          $ref: '#/components/schemas/invalidValueMessage'
        readOnly:
          $ref: '#/components/schemas/readOnly'
        hidden:
          $ref: '#/components/schemas/hidden'
        requireMapping:
          $ref: '#/components/schemas/requireMapping'
        type:
          anyOf:
            - type: string
              const: string
            - type: array
              minItems: 2
              maxItems: 2
              items:
                - type: string
                  const: string
                - type: object
                  additionalProperties:
                    not: {}
      required:
        - label
        - key
      additionalProperties: false
    CheckboxFieldSchema: &ref_19
      type: object
      properties:
        label:
          $ref: '#/components/schemas/label'
        key:
          $ref: '#/components/schemas/key'
        description:
          $ref: '#/components/schemas/description'
        alternateMatches:
          $ref: '#/components/schemas/alternateMatches'
        validators:
          $ref: '#/components/schemas/validators'
        invalidValueMessage:
          $ref: '#/components/schemas/invalidValueMessage'
        readOnly:
          $ref: '#/components/schemas/readOnly'
        hidden:
          $ref: '#/components/schemas/hidden'
        requireMapping:
          $ref: '#/components/schemas/requireMapping'
        type:
          anyOf:
            - type: string
              const: checkbox
            - type: array
              minItems: 2
              maxItems: 2
              items:
                - type: string
                  const: checkbox
                - type: object
                  additionalProperties:
                    not: {}
      required:
        - label
        - key
        - type
      additionalProperties: false
    EmailFieldSchema: &ref_20
      type: object
      properties:
        label:
          $ref: '#/components/schemas/label'
        key:
          $ref: '#/components/schemas/key'
        description:
          $ref: '#/components/schemas/description'
        alternateMatches:
          $ref: '#/components/schemas/alternateMatches'
        validators:
          $ref: '#/components/schemas/validators'
        invalidValueMessage:
          $ref: '#/components/schemas/invalidValueMessage'
        readOnly:
          $ref: '#/components/schemas/readOnly'
        hidden:
          $ref: '#/components/schemas/hidden'
        requireMapping:
          $ref: '#/components/schemas/requireMapping'
        type:
          anyOf:
            - type: string
              const: email
            - type: array
              minItems: 2
              maxItems: 2
              items:
                - type: string
                  const: email
                - type: object
                  additionalProperties:
                    not: {}
      required:
        - label
        - key
        - type
      additionalProperties: false
    SelectFieldSchema: &ref_22
      type: object
      properties:
        label:
          $ref: '#/components/schemas/label'
        key:
          $ref: '#/components/schemas/key'
        description:
          $ref: '#/components/schemas/description'
        alternateMatches:
          $ref: '#/components/schemas/alternateMatches'
        validators:
          $ref: '#/components/schemas/validators'
        invalidValueMessage:
          $ref: '#/components/schemas/invalidValueMessage'
        readOnly:
          $ref: '#/components/schemas/readOnly'
        hidden:
          $ref: '#/components/schemas/hidden'
        requireMapping:
          $ref: '#/components/schemas/requireMapping'
        type:
          anyOf:
            - type: string
              const: select
            - type: array
              minItems: 2
              maxItems: 2
              items:
                - type: string
                  const: select
                - type: object
                  additionalProperties:
                    not: {}
        selectOptions:
          type: array
          items:
            $ref: '#/components/schemas/SelectOptionSchema'
      required:
        - label
        - key
        - type
        - selectOptions
      additionalProperties: false
    NumberFieldSchema: &ref_23
      type: object
      properties:
        label:
          $ref: '#/components/schemas/label'
        key:
          $ref: '#/components/schemas/key'
        description:
          $ref: '#/components/schemas/description'
        alternateMatches:
          $ref: '#/components/schemas/alternateMatches'
        validators:
          $ref: '#/components/schemas/validators'
        invalidValueMessage:
          $ref: '#/components/schemas/invalidValueMessage'
        readOnly:
          $ref: '#/components/schemas/readOnly'
        hidden:
          $ref: '#/components/schemas/hidden'
        requireMapping:
          $ref: '#/components/schemas/requireMapping'
        type:
          anyOf:
            - type: string
              const: number
            - type: array
              minItems: 2
              maxItems: 2
              items:
                - type: string
                  const: number
                - anyOf:
                    - type: string
                      enum:
                        - default
                        - percent
                        - percent_0
                        - percent_1
                        - percent_2
                        - percent_3
                        - percent_4
                        - decimal_0
                        - decimal_1
                        - decimal_2
                        - decimal_3
                        - decimal_4
                        - integer
                        - plain
                        - usd
                        - usd_accounting
                        - eur
                        - gbp
                    - type: object
                      properties:
                        preset:
                          type: string
                          enum:
                            - default
                            - percent
                            - percent_0
                            - percent_1
                            - percent_2
                            - percent_3
                            - percent_4
                            - decimal_0
                            - decimal_1
                            - decimal_2
                            - decimal_3
                            - decimal_4
                            - integer
                            - plain
                            - usd
                            - usd_accounting
                            - eur
                            - gbp
                        round:
                          type: integer
                        displayFormat:
                          type: object
                          properties:
                            output:
                              type: string
                              enum:
                                - currency
                                - percent
                                - byte
                                - time
                                - ordinal
                                - number
                            base:
                              type: string
                              enum:
                                - decimal
                                - binary
                                - general
                            characteristic:
                              type: number
                            prefix:
                              type: string
                            postfix:
                              type: string
                            forceAverage:
                              type: string
                              enum:
                                - trillion
                                - billion
                                - million
                                - thousand
                            average:
                              type: boolean
                            currencyPosition:
                              type: string
                              enum:
                                - prefix
                                - infix
                                - postfix
                            currencySymbol:
                              type: string
                            totalLength:
                              type: number
                            mantissa:
                              type: number
                            optionalMantissa:
                              type: boolean
                            trimMantissa:
                              type: boolean
                            optionalCharacteristic:
                              type: boolean
                            thousandSeparated:
                              type: boolean
                            abbreviations:
                              type: object
                              properties:
                                thousand:
                                  type: string
                                million:
                                  type: string
                                billion:
                                  type: string
                                trillion:
                                  type: string
                              additionalProperties: false
                            negative:
                              type: string
                              enum:
                                - sign
                                - parenthesis
                            forceSign:
                              type: boolean
                            spaceSeparated:
                              type: boolean
                            spaceSeparatedCurrency:
                              type: boolean
                            spaceSeparatedAbbreviation:
                              type: boolean
                            exponential:
                              type: boolean
                            prefixSymbol:
                              type: boolean
                            lowPrecision:
                              type: boolean
                          additionalProperties: false
                        outputFormat:
                          $ref: >-
                            #/definitions/NumberFieldSchema/properties/type/anyOf/1/items/1/anyOf/1/properties/displayFormat
                      additionalProperties: false
      required:
        - label
        - key
        - type
      additionalProperties: false
    DateTimeFieldSchema: &ref_24
      type: object
      properties:
        label:
          $ref: '#/components/schemas/label'
        key:
          $ref: '#/components/schemas/key'
        description:
          $ref: '#/components/schemas/description'
        alternateMatches:
          $ref: '#/components/schemas/alternateMatches'
        validators:
          $ref: '#/components/schemas/validators'
        invalidValueMessage:
          $ref: '#/components/schemas/invalidValueMessage'
        readOnly:
          $ref: '#/components/schemas/readOnly'
        hidden:
          $ref: '#/components/schemas/hidden'
        requireMapping:
          $ref: '#/components/schemas/requireMapping'
        type:
          anyOf:
            - type: string
              enum:
                - date
                - time
                - datetime
            - type: array
              minItems: 2
              maxItems: 2
              items:
                - type: string
                  enum:
                    - date
                    - time
                    - datetime
                - type: object
                  properties:
                    displayFormat:
                      type: string
                    outputFormat:
                      type: string
                    locale:
                      type: string
                    withSeconds:
                      type: boolean
                  additionalProperties: false
      required:
        - label
        - key
        - type
      additionalProperties: false
    DeveloperFieldSchema:
      anyOf:
        - $ref: '#/components/schemas/StringFieldSchema'
        - $ref: '#/components/schemas/CheckboxFieldSchema'
        - $ref: '#/components/schemas/EmailFieldSchema'
        - $ref: '#/components/schemas/SelectFieldSchema'
        - $ref: '#/components/schemas/NumberFieldSchema'
        - $ref: '#/components/schemas/DateTimeFieldSchema'
      definitions:
        BaseValidatorSchema:
          type: object
          properties:
            errorMessage: *ref_0
            level: *ref_1
          additionalProperties: false
        RequiredValidatorSchema: *ref_2
        UniqueValidatorSchema: *ref_3
        UniqueWithValidatorSchema: *ref_4
        RegexValidatorSchema: *ref_5
        RequireWithValidatorSchema: *ref_6
        RequireWithValuesValidatorSchema: *ref_7
        ValidatorSchema: *ref_8
        BaseFieldSchema:
          type: object
          properties:
            label: *ref_9
            key: *ref_10
            description: *ref_11
            alternateMatches: *ref_12
            validators: *ref_13
            invalidValueMessage: *ref_14
            readOnly: *ref_15
            hidden: *ref_16
            requireMapping: *ref_17
          required:
            - label
            - key
          additionalProperties: false
        StringFieldSchema: *ref_18
        CheckboxFieldSchema: *ref_19
        EmailFieldSchema: *ref_20
        SelectOptionSchema: *ref_21
        SelectFieldSchema: *ref_22
        NumberFieldSchema: *ref_23
        DateTimeFieldSchema: *ref_24
      $schema: http://json-schema.org/draft-07/schema#
    StyleOverridesSchema: &ref_25
      type: object
      properties:
        global:
          type: object
          properties:
            textColor:
              type: string
              default: ''
            primaryTextColor:
              type: string
              default: ''
            secondaryTextColor:
              type: string
              default: ''
            successColor:
              type: string
              default: ''
            warningColor:
              type: string
              default: ''
            customFontURL:
              type:
                - string
                - 'null'
              default: null
            customFontFamily:
              type:
                - string
                - 'null'
              default: null
            backgroundColor:
              type: string
              default: ''
            borderRadius:
              type: string
              default: ''
          additionalProperties: false
          default: {}
        primaryButton:
          type: object
          properties:
            borderRadius:
              type: string
              default: ''
            backgroundColor:
              type: string
              default: ''
            textColor:
              type: string
              default: ''
            border:
              type: string
              default: ''
            hoverBackgroundColor:
              type: string
              default: ''
            hoverTextColor:
              type: string
              default: ''
            hoverBorder:
              type: string
              default: ''
          additionalProperties: false
          default: {}
        secondaryButton:
          type: object
          properties:
            borderRadius:
              type: string
              default: ''
            backgroundColor:
              type: string
              default: ''
            textColor:
              type: string
              default: ''
            border:
              type: string
              default: ''
            hoverBackgroundColor:
              type: string
              default: ''
            hoverTextColor:
              type: string
              default: ''
            hoverBorder:
              type: string
              default: ''
          additionalProperties: false
          default: {}
        tertiaryButton:
          type: object
          properties:
            borderRadius:
              type: string
              default: ''
            backgroundColor:
              type: string
              default: ''
            textColor:
              type: string
              default: ''
            border:
              type: string
              default: ''
            hoverBackgroundColor:
              type: string
              default: ''
            hoverTextColor:
              type: string
              default: ''
            hoverBorder:
              type: string
              default: ''
          additionalProperties: false
          default: {}
        dropzone:
          type: object
          properties:
            borderWidth:
              type: number
              default: -1
            borderRadius:
              type: number
              default: -1
            borderColor:
              type: string
              default: ''
            borderStyle:
              type: string
              default: ''
            backgroundColor:
              type: string
              default: ''
            color:
              type: string
              default: ''
            outline:
              type: string
              default: ''
          additionalProperties: false
          default: {}
        helpText:
          type: object
          properties:
            textColor:
              type: string
              default: ''
            backgroundColor:
              type: string
              default: ''
          additionalProperties: false
          default: {}
        stepperBar:
          type: object
          properties:
            completeColor:
              type: string
              default: ''
            incompleteColor:
              type: string
              default: ''
            currentColor:
              type: string
              default: ''
            fontSize:
              type: string
              default: ''
            completeFontWeight:
              type: string
              default: ''
            incompleteFontWeight:
              type: string
              default: ''
            currentFontWeight:
              type: string
              default: ''
            backgroundColor:
              type: string
              default: ''
            borderBottom:
              type: string
              default: ''
          additionalProperties: false
          default: {}
        dataTable:
          type: object
          properties:
            headerFontWeight:
              type: string
              default: ''
          additionalProperties: false
          default: {}
      additionalProperties: false
    DeveloperSettingsSchema:
      type: object
      properties:
        importIdentifier:
          type: string
        title:
          type: string
        allowInvalidSubmit:
          type: boolean
        invalidDataBehavior:
          type: string
          enum:
            - BLOCK_SUBMIT
            - INCLUDE_INVALID_ROWS
            - REMOVE_INVALID_ROWS
        backendSync:
          type: boolean
        backendSyncMode:
          type: string
          enum:
            - DISABLED
            - FULL_DATA
            - MAPPINGS_ONLY
        manualInputDisabled:
          type: boolean
          default: false
        manualInputOnly:
          type: boolean
          default: false
        allowCustomFields:
          type: boolean
          default: false
        maxRecords:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
        developmentMode:
          type: boolean
        displayEncoding:
          type: boolean
          default: true
        styleOverrides:
          $ref: '#/components/schemas/StyleOverridesSchema'
          default: {}
        webhookUrl:
          type:
            - string
            - 'null'
          default: null
        needsReviewWebhookUrl:
          type:
            - string
            - 'null'
          default: null
        initialData:
          anyOf:
            - anyOf:
                - type: array
                  items:
                    type: object
                    additionalProperties: {}
                - type: array
                  items:
                    type: array
            - type: 'null'
          default: null
        uploadStep:
          type: object
          properties:
            helpText:
              type:
                - string
                - 'null'
              default: null
          additionalProperties: false
          default: {}
        matchingStep:
          type: object
          properties:
            helpText:
              type:
                - string
                - 'null'
              default: null
            headerRowOverride:
              anyOf:
                - type: integer
                - type: 'null'
              default: null
            fuzzyMatchHeaders:
              type: boolean
              default: true
            alwaysMatchSelectFields:
              type: boolean
              default: false
            matchToSchema:
              type: boolean
              default: false
          additionalProperties: false
          default: {}
        reviewStep:
          type: object
          properties:
            helpText:
              type:
                - string
                - 'null'
              default: null
            processingText:
              type:
                - string
                - 'null'
              default: null
            saveForLater:
              type: boolean
              default: false
          additionalProperties: false
          default: {}
        autoMapHeaders:
          type: boolean
          default: false
        delimiter:
          type: string
        backendOverride:
          type: object
          properties:
            url:
              type: string
            type:
              type: string
              enum:
                - AWS
                - AZURE
          required:
            - url
            - type
          additionalProperties: false
          default:
            url: http://localhost:8000
            type: AWS
        locale:
          type: string
          enum:
            - bn
            - en
            - hr
            - ja
            - nl
            - ru
            - uk
            - cs
            - es
            - hu
            - ko
            - 'no'
            - sv
            - vi
            - da
            - fi
            - id
            - lt
            - pl
            - sw
            - zh_CN
            - de
            - fr
            - is
            - lv
            - pt
            - th
            - zh_TW
            - el
            - hi
            - it
            - ms
            - ro
            - tr
          default: en
        templateDownloadFilename:
          type:
            - string
            - 'null'
          default: null
        browserExcelParsing:
          type: boolean
          default: false
        version:
          type: string
          default: ''
      required:
        - importIdentifier
      additionalProperties: false
      definitions:
        StyleOverridesSchema: *ref_25
      $schema: http://json-schema.org/draft-07/schema#
    HooksSchema:
      type: object
      properties:
        rowHooks:
          type: array
          items:
            type: string
        bulkRowHooks:
          type: array
          items:
            type: string
        rowDeleteHooks:
          type: array
          items:
            type: string
        beforeFinishCallback:
          type: string
        columnHooks:
          type: array
          items:
            type: object
            properties:
              fieldName:
                type: string
              callback:
                type: string
            required:
              - fieldName
              - callback
            additionalProperties: false
        stepHooks:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - UPLOAD_STEP
                  - REVIEW_STEP
                  - REVIEW_STEP_POST_HOOKS
              callback:
                type: string
            required:
              - type
              - callback
            additionalProperties: false
      additionalProperties: false
      $schema: http://json-schema.org/draft-07/schema#
    UserSchema:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        email:
          type: string
        companyId:
          type: string
        companyName:
          type: string
      required:
        - id
      additionalProperties: false
      $schema: http://json-schema.org/draft-07/schema#
  securitySchemes:
    api_key:
      type: apiKey
      name: X-Dromo-License-Key
      in: header
      description: >-
        This backend API key is different than your frontend license key. Please
        use the "Backend" license key from your [Dromo
        Dashboard](https://dashboard.dromo.io/).
