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

# Create File Object and Get File Upload Location

> This endpoint creates a file object by specifying the import file's `type`, `name`, and `locale` in the request body. The response will include the URL location to upload the file.



## OpenAPI

````yaml files-jobs.openapi post /product-files
openapi: 3.0.0
info:
  description: >-
    fabric's **Files** and **Jobs** APIs support bulk import and export of
    items, attributes, and bundles. To begin with importing, download the
    appropriate template for the specific `type` of import. A standardized
    template ensures consistency in data structure and formatting. It also helps
    enforce data validation rules to ensure imported data meets the specified
    criteria and reduces the chance of incorrect and inaccurate information.
    Once you have completed filling out the import details in the template, add
    the file name and `type` in the request body of the `POST /files/product`
    endpoint. The response will provide you with the URL where you can upload
    the file for importing. After successfully importing the file, you can use
    the job exports endpoints to export the imported products and attributes
    based on specified criteria.
  title: Products - Files and Jobs
  version: 3.0.0
  x-audience: external-public
  contact:
    email: support@fabric.inc
    name: Product team
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
  termsOfService: https://fabric.inc/terms-of-use
servers:
  - url: https://api.fabric.inc/v3
    description: Production URL
security:
  - authorization: []
tags:
  - name: Files
    description: >-
      Files endpoints interact with the file object, which is associated with
      (and points to) a job.
  - name: Jobs
    description: >-
      Bulk import of attributes must be in a standardized format. This endpoint
      gets the template required to bulk import attributes.
externalDocs:
  description: Find out more about Products (previously called PIM)
  url: https://developer.fabric.inc/docs/products-overview
paths:
  /product-files:
    post:
      tags:
        - Files
      summary: Create File Object and Get File Upload Location
      description: >-
        This endpoint creates a file object by specifying the import file's
        `type`, `name`, and `locale` in the request body. The response will
        include the URL location to upload the file.
      operationId: createFile
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      requestBody:
        $ref: '#/components/requestBodies/createFileRequest'
      responses:
        '200':
          description: Create file success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/file'
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/x-fabric-request-id-header'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/notAuthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '500':
          $ref: '#/components/responses/internalServerError'
components:
  parameters:
    x-fabric-tenant-id:
      name: x-fabric-tenant-id
      in: header
      description: >-
        A header used by fabric to identify the tenant making the request. You
        must include tenant id in the authentication header for an API request
        to access any of fabric’s endpoints. You can retrieve the tenant id ,
        which is also called account id, from
        [Copilot](/v3/platform/settings/account-details/getting-the-account-id).
        This header is required.
      schema:
        type: string
        example: 517fa9dfd42d8b00g1o3k312
    x-fabric-request-id:
      name: x-fabric-request-id
      in: header
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
      required: false
  requestBodies:
    createFileRequest:
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            description: Request for file creation
            required:
              - type
              - name
            properties:
              type:
                $ref: '#/components/schemas/fileJobTypes'
              name:
                type: string
                description: File name
                example: bulk_import_123345677788999.csv
              locale:
                $ref: '#/components/schemas/locale'
  schemas:
    file:
      type: object
      properties:
        id:
          type: string
          description: 24-character system-generated file ID
          example: 337f1f77bcf86cd799439011
        type:
          $ref: '#/components/schemas/fileJobTypes'
        name:
          type: string
          description: File name to be uploaded to the generated URL
          example: bulk_import_123345677788999.csv
        locale:
          $ref: '#/components/schemas/locale'
        location:
          type: string
          description: S3 file location of the uploaded file.
          example: >-
            https://s3.console.aws.amazon.com/s3/buckets/greatwall-stg01-bulk-import-pim/bulk_import_123345677788999.csv
        createdAt:
          type: string
          description: File creation time (UTC)
          example: '2021-09-14T22:10:30.618Z'
        updatedBy:
          type: string
          description: Email of user who last updated the file
          example: test@email.com
        updatedAt:
          type: string
          description: Time of last update to file (UTC)
          example: '2021-09-14T22:10:30.618Z'
    fileJobTypes:
      type: string
      enum:
        - ITEM_VARIANT_EXPORT
        - ITEM_VARIANT_IMPORT
        - BUNDLE_EXPORT
        - BUNDLE_IMPORT
        - ATTRIBUTE_IMPORT
        - ATTRIBUTE_EXPORT
        - CATEGORY_IMPORT
        - CATEGORY_EXPORT
        - COLLECTION_IMPORT
        - COLLECTION_EXPORT
      description: Supported job types
      example: ITEM_VARIANT_EXPORT
    locale:
      type: string
      description: >-
        If `isLocalizable` is true, the search is based on the localized name in
        specified locales. If `isLocalizable` is false, the search is only based
        on the non-localized names.
      example: en-US
    genericError:
      type: object
      description: Error details
      properties:
        message:
          type: string
          description: Placeholder error message for all the 4xx, 5xx errors
          example: Request is invalid
        type:
          type: string
          description: Placeholder error type for all the 4xx, 5xx errors
          example: Bad request
        errors:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                description: Error type
                example: CLIENT_ERROR
              message:
                type: string
                description: Error message
                example: Invalid request. Unable to find/create product
  headers:
    x-fabric-request-id-header:
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
  responses:
    badRequest:
      description: Request is invalid or malformed
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
    notAuthorized:
      description: Requester is unauthorized
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
          example:
            type: UNAUTHORIZED_ERROR
            message: Requester is unauthorized
    forbidden:
      description: User isn't allowed to perform the action
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
          example:
            type: REQUEST_DENIED
            message: User doesn't have the required permission
    internalServerError:
      description: Internal server error
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
          example:
            type: SERVER_ERROR
            message: Internal Server Error
  securitySchemes:
    authorization:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: S2S access token (JWT) from fabric Identity service (during login)

````