ProcessMaker Files API

File and media management

OpenAPI Specification

processmaker-files-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: ProcessMaker Platform RESTful Environment Variables Files API
  description: 'The ProcessMaker Platform RESTful API provides programmatic access to all platform functionality including process design, case management, task handling, user management, and enterprise integrations. The API is BPMN 2.0 compliant and follows the OpenAPI specification with interactive Swagger UI documentation auto-generated by Swagger/L5-Swagger.

    '
  version: 1.0.0
  contact:
    email: info@processmaker.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: https://{organization}.processmaker.net/api/1.0
  description: ProcessMaker Cloud instance
  variables:
    organization:
      default: myorg
      description: Your ProcessMaker organization subdomain
security:
- bearerAuth: []
tags:
- name: Files
  description: File and media management
paths:
  /files:
    get:
      tags:
      - Files
      summary: Returns all files associated with the authenticated user
      operationId: getFiles
      parameters:
      - name: request_id
        in: query
        schema:
          type: integer
      - $ref: '#/components/parameters/filter'
      - $ref: '#/components/parameters/order_by'
      - $ref: '#/components/parameters/order_direction'
      - $ref: '#/components/parameters/per_page'
      responses:
        '200':
          description: List of files
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Media'
                  meta:
                    $ref: '#/components/schemas/Metadata'
    post:
      tags:
      - Files
      summary: Save a new file
      operationId: createFile
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                model_id:
                  type: integer
                model_type:
                  type: string
                collection_name:
                  type: string
      responses:
        '201':
          description: Created file
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Media'
  /files/{file_id}:
    get:
      tags:
      - Files
      summary: Get a single file
      operationId: getFileById
      parameters:
      - name: file_id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Single file
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Media'
        '404':
          $ref: '#/components/responses/404'
    put:
      tags:
      - Files
      summary: Update a file
      operationId: updateFile
      parameters:
      - name: file_id
        in: path
        required: true
        schema:
          type: integer
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '204':
          description: No content
    delete:
      tags:
      - Files
      summary: Delete a file
      operationId: deleteFile
      parameters:
      - name: file_id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '204':
          description: No content
components:
  schemas:
    Media:
      type: object
      properties:
        id:
          type: integer
        model_id:
          type: integer
        model_type:
          type: string
        collection_name:
          type: string
        name:
          type: string
        file_name:
          type: string
        mime_type:
          type: string
        size:
          type: integer
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        url:
          type: string
          format: uri
    Metadata:
      type: object
      properties:
        total:
          type: integer
        count:
          type: integer
        per_page:
          type: integer
        current_page:
          type: integer
        total_pages:
          type: integer
        sort_by:
          type: string
        sort_order:
          type: string
        search:
          type: string
  parameters:
    per_page:
      name: per_page
      in: query
      schema:
        type: integer
        default: 10
    filter:
      name: filter
      in: query
      description: 'Filter results by string. Searches Name, Description, and Status. Status must match exactly. Others can be a substring.

        '
      schema:
        type: string
    order_by:
      name: order_by
      in: query
      description: Field to order results by
      schema:
        type: string
    order_direction:
      name: order_direction
      in: query
      schema:
        type: string
        enum:
        - asc
        - desc
        default: asc
  responses:
    '404':
      description: Not Found
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT