Bytescale Upload API

The Upload API from Bytescale — 3 operation(s) for upload.

OpenAPI Specification

bytescale-upload-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Bytescale Files Upload API
  description: REST API for the Bytescale (formerly Upload.io) file upload, storage, media processing, and CDN platform. Upload files via raw binary, multipart form data, or from a URL; manage files and folders; and serve optimized media through the upcdn.io edge network. All Upload and File API endpoints are rooted at https://api.bytescale.com/v2/accounts/{accountId} and authenticate with a Bearer API key.
  termsOfService: https://www.bytescale.com/legal/terms
  contact:
    name: Bytescale Support
    url: https://www.bytescale.com/docs
  version: '2.0'
servers:
- url: https://api.bytescale.com
  description: Bytescale REST API (Upload and File APIs)
security:
- bearerAuth: []
tags:
- name: Upload
paths:
  /v2/accounts/{accountId}/uploads/binary:
    post:
      operationId: basicUpload
      tags:
      - Upload
      summary: Upload a file with a single HTTP request (raw binary body).
      parameters:
      - $ref: '#/components/parameters/AccountId'
      - name: fileName
        in: query
        required: false
        schema:
          type: string
          maxLength: 512
        description: File name (without "/"). Supports path variables.
      - name: fileNameFallback
        in: query
        required: false
        schema:
          type: string
          maxLength: 512
        description: Fallback name used if fileName is already taken.
      - name: fileNameVariablesEnabled
        in: query
        required: false
        schema:
          type: boolean
          default: true
      - name: filePath
        in: query
        required: false
        schema:
          type: string
          maxLength: 512
        description: Complete file path including name. Must start with "/".
      - name: folderPath
        in: query
        required: false
        schema:
          type: string
          maxLength: 512
        description: Directory path excluding file name. Supports path variables.
      - name: folderPathVariablesEnabled
        in: query
        required: false
        schema:
          type: boolean
          default: true
      - name: originalFileName
        in: query
        required: false
        schema:
          type: string
          minLength: 1
          maxLength: 255
      - name: tag
        in: query
        required: false
        schema:
          type: string
        description: Rule-trigger tag for the upload. Repeatable.
      - name: X-Upload-Metadata
        in: header
        required: false
        schema:
          type: string
        description: Arbitrary FileMetadata JSON object to attach to the file.
      requestBody:
        required: true
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: File uploaded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResult'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v2/accounts/{accountId}/uploads/form_data:
    post:
      operationId: formDataUpload
      tags:
      - Upload
      summary: Upload one or more files with a single multipart/form-data request.
      parameters:
      - $ref: '#/components/parameters/AccountId'
      - name: fileName
        in: query
        required: false
        schema:
          type: string
          maxLength: 512
      - name: fileNameFallback
        in: query
        required: false
        schema:
          type: string
          maxLength: 512
      - name: folderPath
        in: query
        required: false
        schema:
          type: string
          maxLength: 512
      - name: tag
        in: query
        required: false
        schema:
          type: string
      - name: X-Upload-Metadata
        in: header
        required: false
        schema:
          type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              additionalProperties:
                type: string
                format: binary
      responses:
        '200':
          description: Files processed (per-file successes and errors returned).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormDataUploadResult'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v2/accounts/{accountId}/uploads/url:
    post:
      operationId: uploadFromUrl
      tags:
      - Upload
      summary: Upload a file from a remote URL.
      parameters:
      - $ref: '#/components/parameters/AccountId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadFromUrlRequest'
      responses:
        '200':
          description: File uploaded from URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResult'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    UploadFromUrlRequest:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: The source URL of the file to upload.
      required:
      - url
    UploadResult:
      type: object
      properties:
        accountId:
          type: string
        etag:
          type: string
        filePath:
          type: string
        fileUrl:
          type: string
          format: uri
      required:
      - accountId
      - filePath
      - fileUrl
    FormDataUploadResult:
      type: object
      properties:
        files:
          type: array
          items:
            type: object
            properties:
              accountId:
                type: string
              etag:
                type: string
              filePath:
                type: string
              fileUrl:
                type: string
                format: uri
              formDataFieldName:
                type: string
        errors:
          type: array
          items:
            type: object
            properties:
              formDataFieldName:
                type: string
              error:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  timestamp:
                    type: string
                    format: date-time
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            timestamp:
              type: string
              format: date-time
  parameters:
    AccountId:
      name: accountId
      in: path
      required: true
      schema:
        type: string
        minLength: 7
        maxLength: 7
      description: Your 7-character Bytescale account ID (from dashboard settings).
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bytescale API key passed as a Bearer token. Secret keys (secret_*) are required for write and management operations; public keys (public_*) may be used with JWT-based auth.