Losant Private Files API

The Private Files API from Losant — 4 operation(s) for private files.

Operations 7

GET /applications/{applicationId}/privateFiles Returns the private files for an application #
POST /applications/{applicationId}/privateFiles Create a new private file for an application #
GET /applications/{applicationId}/privateFiles/{privateFileId} Retrieves information on a private file #
PATCH /applications/{applicationId}/privateFiles/{privateFileId} Reupload a private file #
DELETE /applications/{applicationId}/privateFiles/{privateFileId} Deletes a private file or directory, if a directory all the contents that… #
POST /applications/{applicationId}/privateFiles/{privateFileId}/move Move a private file or the entire contents of a directory #
POST /applications/{applicationId}/privateFiles/{privateFileId}/upload Uploads the private file #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/losant:losant-private-files-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

losant-private-files-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Platform Private Files API
  version: 1.31.0
  description: User API for accessing platform data
servers:
- url: https://api.losant.com
security:
- bearerAuth: []
tags:
- name: Private Files
paths:
  /applications/{applicationId}/privateFiles:
    get:
      operationId: privateFiles.get
      summary: Returns the private files for an application
      tags:
      - Private Files
      parameters:
      - name: applicationId
        in: path
        required: true
        description: ID associated with the application
        schema:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        example: 575ec8687ae143cd83dc4a97
      - name: sortField
        in: query
        required: false
        description: Field to sort the results by
        schema:
          type: string
          enum:
          - lastUpdated
          - type
          - name
          - creationDate
          default: lastUpdated
        example: name
      - name: sortDirection
        in: query
        required: false
        description: Direction to sort the results by
        schema:
          type: string
          enum:
          - asc
          - desc
          default: asc
        example: asc
      - name: page
        in: query
        required: false
        description: Which page of results to return
        schema:
          type: string
          default: 0
        example: 0
      - name: perPage
        in: query
        required: false
        description: How many items to return per page
        schema:
          type: string
          default: 100
        example: 10
      - name: filterField
        in: query
        required: false
        description: Field to filter the results by. Blank or not provided means no filtering.
        schema:
          type: string
          enum:
          - name
        example: name
      - name: filter
        in: query
        required: false
        description: Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
        schema:
          type: string
        example: myFile
      - name: type
        in: query
        required: false
        description: Limit by the type (file or directory) of the file
        schema:
          type: string
        example: file
      - name: status
        in: query
        required: false
        description: Limit the result to only files of this status
        schema:
          type: string
          enum:
          - completed
          - pending
        example: completed
      - name: directory
        in: query
        required: false
        description: Get private files that are inside of this directory
        schema:
          type: string
        example: /a/path/
      - name: urlTTL
        in: query
        required: false
        description: Time in seconds that the private file url will be valid for. Only applies to private files of type 'file'. If 0, no url will be returned.
        schema:
          type: string
          default: 900
        example: 900
      responses:
        '200':
          description: Collection of private files
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/files'
        '400':
          description: Error if malformed request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Error if application was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      x-losant-auth-scopes:
      - privateFiles.get
    post:
      operationId: privateFiles.post
      summary: Create a new private file for an application
      tags:
      - Private Files
      parameters:
      - name: applicationId
        in: path
        required: true
        description: ID associated with the application
        schema:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        example: 575ec8687ae143cd83dc4a97
      responses:
        '201':
          description: Successfully created private file and the information needed to upload the file content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/fileUploadPostResponse'
        '400':
          description: Error if malformed request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Error if application was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/filePost'
        description: New private file information
      x-losant-auth-scopes:
      - privateFiles.post
  /applications/{applicationId}/privateFiles/{privateFileId}:
    get:
      operationId: privateFile.get
      summary: Retrieves information on a private file
      tags:
      - Private Files
      parameters:
      - name: applicationId
        in: path
        required: true
        description: ID associated with the application
        schema:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        example: 575ec8687ae143cd83dc4a97
      - name: privateFileId
        in: path
        required: true
        description: ID associated with the private file
        schema:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        example: 575ec76c7ae143cd83dc4a96
      - name: urlTTL
        in: query
        required: false
        description: Time in seconds that the private file url will be valid for. Only applies to private files of type 'file'. If 0, no url will be returned.
        schema:
          type: string
          default: 900
        example: 900
      responses:
        '200':
          description: Private file information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/file'
        '400':
          description: Error if malformed request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Error if private file was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      x-losant-auth-scopes:
      - privateFile.get
    patch:
      operationId: privateFile.patch
      summary: Reupload a private file
      tags:
      - Private Files
      parameters:
      - name: applicationId
        in: path
        required: true
        description: ID associated with the application
        schema:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        example: 575ec8687ae143cd83dc4a97
      - name: privateFileId
        in: path
        required: true
        description: ID associated with the private file
        schema:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        example: 575ec76c7ae143cd83dc4a96
      responses:
        '200':
          description: Successfully updated private file and the information needed to upload the file content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/fileUploadPostResponse'
        '400':
          description: Error if malformed request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Error if private file was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/filePatch'
        description: Updated information about the private file
      x-losant-auth-scopes:
      - privateFile.patch
    delete:
      operationId: privateFile.delete
      summary: Deletes a private file or directory, if a directory all the contents that…
      tags:
      - Private Files
      parameters:
      - name: applicationId
        in: path
        required: true
        description: ID associated with the application
        schema:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        example: 575ec8687ae143cd83dc4a97
      - name: privateFileId
        in: path
        required: true
        description: ID associated with the private file
        schema:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        example: 575ec76c7ae143cd83dc4a96
      responses:
        '200':
          description: If private file was successfully deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/success'
        '400':
          description: Error if malformed request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Error if private file was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      x-losant-auth-scopes:
      - privateFile.delete
  /applications/{applicationId}/privateFiles/{privateFileId}/move:
    post:
      operationId: privateFile.move
      summary: Move a private file or the entire contents of a directory
      tags:
      - Private Files
      parameters:
      - name: applicationId
        in: path
        required: true
        description: ID associated with the application
        schema:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        example: 575ec8687ae143cd83dc4a97
      - name: privateFileId
        in: path
        required: true
        description: ID associated with the private file
        schema:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        example: 575ec76c7ae143cd83dc4a96
      - name: name
        in: query
        required: false
        description: The new name of the private file or directory
        schema:
          type: string
        example: fileA
      - name: parentDirectory
        in: query
        required: false
        description: The new parent directory for the private file or directory to move into.
        schema:
          type: string
        example: /new/location/here
      - name: urlTTL
        in: query
        required: false
        description: Time in seconds that the private file url will be valid for. Only applies to private files of type 'file'. If 0, no url will be returned.
        schema:
          type: string
          default: 900
        example: 900
      responses:
        '201':
          description: Returns a new private file or directory that was created by the move, if a directory a job will kick off to move all the directory's children.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/file'
        '400':
          description: Error if malformed request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Error if private file was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      x-losant-auth-scopes:
      - privateFile.move
  /applications/{applicationId}/privateFiles/{privateFileId}/upload:
    post:
      operationId: privateFile.upload
      summary: Uploads the private file
      tags:
      - Private Files
      parameters:
      - name: applicationId
        in: path
        required: true
        description: ID associated with the application
        schema:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        example: 575ec8687ae143cd83dc4a97
      - name: privateFileId
        in: path
        required: true
        description: ID associated with the private file
        schema:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        example: 575ec76c7ae143cd83dc4a96
      - name: urlTTL
        in: query
        required: false
        description: Time in seconds that the private file url will be valid for. Only applies to private files of type 'file'. If 0, no url will be returned.
        schema:
          type: string
          default: 900
        example: 900
      responses:
        '200':
          description: Updated private file content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/file'
        '400':
          description: Error if malformed request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Error if file was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      x-losant-auth-scopes:
      - privateFile.upload
components:
  schemas:
    file:
      title: File
      description: Schema for a single public or private file
      type: object
      properties:
        id:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        applicationId:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        creationDate:
          type: string
          format: date-time
        lastUpdated:
          type: string
          format: date-time
        authorId:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        authorType:
          type: string
          enum:
          - flow
          - user
          - device
          - apiToken
          - notebook
        status:
          type: string
          enum:
          - pending
          - moving
          - deleting
          - completed
        name:
          type: string
          minLength: 1
          maxLength: 1024
        parentDirectory:
          type: string
          maxLength: 1024
        type:
          type: string
          enum:
          - file
          - directory
        fileSize:
          type: number
        s3etag:
          type: string
        contentType:
          type: string
          maxLength: 1024
        fileDimensions:
          type: object
          properties:
            width:
              type: number
            height:
              type: number
        moveIntoId:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        url:
          type: string
    error:
      title: Error
      description: Schema for errors returned by the API
      type: object
      properties:
        type:
          type: string
        message:
          type: string
        validationErrors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              validationMessage:
                type: string
    files:
      title: Files
      description: Schema for a collection of public or private files
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/file'
        count:
          type: integer
        totalCount:
          type: integer
        perPage:
          type: integer
        page:
          type: integer
        filter:
          type: string
        filterField:
          type: string
        sortField:
          type: string
        sortDirection:
          type: string
          enum:
          - asc
          - desc
          - ASC
          - DESC
          - ''
        applicationId:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        parentExists:
          type: boolean
    success:
      title: Success
      description: Schema for reporting a successful operation
      type: object
      properties:
        success:
          type: boolean
          enum:
          - true
    filePatch:
      title: File Patch
      description: Schema to patch a public or private file
      type: object
      properties:
        fileSize:
          type: number
        contentType:
          type: string
          maxLength: 1024
        fileDimensions:
          type: object
          properties:
            width:
              type: number
            height:
              type: number
    filePost:
      title: File Post
      description: Schema to create a single public or private file or directory
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 1024
        parentDirectory:
          type: string
          maxLength: 1024
        type:
          type: string
          enum:
          - file
          - directory
        fileSize:
          type: number
        contentType:
          type: string
          maxLength: 1024
        fileDimensions:
          type: object
          properties:
            width:
              type: number
            height:
              type: number
          additionalProperties: false
      additionalProperties: false
      required:
      - name
      - type
    fileUploadPostResponse:
      title: File Upload Post Response
      description: Schema with the information needed to upload public or private file contents
      type: object
      properties:
        id:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        applicationId:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        creationDate:
          type: string
          format: date-time
        lastUpdated:
          type: string
          format: date-time
        authorId:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        authorType:
          type: string
          enum:
          - flow
          - user
          - device
          - apiToken
          - notebook
        status:
          type: string
          enum:
          - pending
          - moving
          - deleting
          - completed
        name:
          type: string
          minLength: 1
          maxLength: 1024
        parentDirectory:
          type: string
          maxLength: 1024
        type:
          type: string
          enum:
          - file
          - directory
        fileSize:
          type: number
        s3etag:
          type: string
        contentType:
          type: string
          maxLength: 1024
        fileDimensions:
          type: object
          properties:
            width:
              type: number
            height:
              type: number
        moveIntoId:
          type: string
          pattern: ^[A-Fa-f\d]{24}$
        url:
          type: string
        upload:
          type: object
          properties:
            url:
              type: string
            fields:
              type: object
              patternProperties:
                ^.*$:
                  type: string
              properties:
                key:
                  type: string
                bucket:
                  type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
x-derived-from:
  format: bravado 1.0
  by: all/0-working/bravado-to-openapi.py (roadmap#799)
  note: 'every action keeps its own path: resource.path + action.path'