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

# Import a file

> Store a file from a public URL or from inline base64 and return its CDN URL. The JSON alternative to the multipart POST /files upload.



## OpenAPI

````yaml openapi-v2.json post /files/import
openapi: 3.0.3
info:
  title: Productlane API
  description: Productlane API v2.
  version: 2.0.0
servers:
  - url: https://productlane.com/api/v2
security: []
paths:
  /files/import:
    post:
      tags:
        - files
      summary: Import a file
      description: >-
        Store a file from a public URL or from inline base64 and return its CDN
        URL. The JSON alternative to the multipart POST /files upload.
      operationId: files-import
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: >-
                    Public http(s) URL the server downloads and re-hosts.
                    Mutually exclusive with content_base64. Max 10485760 bytes.
                content_base64:
                  type: string
                  minLength: 1
                  description: >-
                    Base64-encoded file bytes, for uploads that have no public
                    URL. Mutually exclusive with url. Max 1048576 decoded bytes;
                    use url above that.
                file_name:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    Overrides the name derived from the URL. Its extension is
                    used for the stored object key.
                content_type:
                  type: string
                  minLength: 1
                  description: >-
                    Required with content_base64. With url it overrides the
                    server's Content-Type. One of: application/msword,
                    application/pdf, application/vnd.ms-excel,
                    application/vnd.ms-powerpoint,
                    application/vnd.openxmlformats-officedocument.presentationml.presentation,
                    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
                    application/vnd.openxmlformats-officedocument.wordprocessingml.document,
                    image/gif, image/jpeg, image/png, image/webp, text/csv,
                    text/plain.
              additionalProperties: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  file_url:
                    type: string
                  content_type:
                    type: string
                  size:
                    type: number
                  original_file_name:
                    type: string
                    nullable: true
                required:
                  - file_url
                  - content_type
                  - size
                  - original_file_name
                additionalProperties: false
        default:
          $ref: '#/components/responses/error'
      security:
        - Authorization: []
components:
  responses:
    error:
      description: Error response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              code:
                type: string
              issues:
                type: array
                items:
                  type: object
                  properties:
                    message:
                      type: string
                  required:
                    - message
                  additionalProperties: false
            required:
              - message
              - code
            additionalProperties: false
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````