openapi: 3.0.3
info:
  title: Proofly API
  description: >-
    The Proofly API provides powerful tools for detecting and analyzing
    deepfakes with cutting-edge AI capabilities. Designed to support real-world
    applications, it allows users to upload images, retrieve detection results,
    and access session information seamlessly.


    Key Features:

    • Deepfake Detection: Upload images and receive highly accurate deepfake
    analysis using proprietary AI models.

    • Session Tracking: Retrieve session details, including status, processed
    faces, and results.

    • Content Retrieval: Access original and processed files for further
    analysis or verification.
      
     Whether you’re developing secure communication systems or combating fraud, the Proofly API enables efficient integration of AI-powered deepfake detection into your workflows.

    Some useful links:

    - [check.proofly.ai](https://check.proofly.ai/)
  termsOfService: https://www.proofly.ai/terms-of-use
  contact:
    email: dev@proofly.ai
  version: 1.0.11
servers:
  - url: https://api.proofly.ai/
tags:
  - name: system
    description: Check system health
    externalDocs:
      description: AI Deepfake Detect Platform
      url: https://www.proofly.ai/
  - name: app
    description: General API functions
paths:
  /api/system:
    get:
      tags:
        - system
      summary: Get system status
      description: Returns the current status of the API system
      operationId: getSystemStatus
      responses:
        '200':
          description: Successful operation - API is running
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSystemRespose'
        '400':
          description: Invalid status value
  /api/upload:
    post:
      tags:
        - app
      summary: Upload a new image to the storage
      description: Upload a new image to the storage
      operationId: uploadFile
      requestBody:
        description: Upload a new image to the storage and get session UUID
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileUploadRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileUploadResponse'
        '400':
          description: No file uploaded
        '415':
          description: File type not allowed
        '500':
          description: Internal server error
  /api/{sessionUuid}:
    get:
      tags:
        - app
      summary: Get session info
      description: Get session info
      operationId: getSessionInfo
      parameters:
        - name: sessionUuid
          in: path
          description: Get all info about session
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionInfoResponse'
        '400':
          description: UUID not found
        '500':
          description: Internal server error
  /api/{sessionUuid}/status:
    get:
      tags:
        - app
      summary: Get session status
      description: Get session status
      operationId: getStatus
      parameters:
        - name: sessionUuid
          in: path
          description: Get file detection status
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UuidStatusResponse'
        '400':
          description: UUID not found
        '500':
          description: Internal server error
  /api/storage/original/{filename}:
    get:
      tags:
        - app
      summary: Get original file
      description: Get original file
      operationId: getOriginalFile
      parameters:
        - name: filename
          in: path
          description: Get original file by filename
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/octet-stream:
              schema:
                $ref: '#/components/schemas/GetOriginalFile'
        '404':
          description: File not found
        '500':
          description: Internal server error
  /api/storage/faces/{filename}:
    get:
      tags:
        - app
      summary: Get face file
      description: Get face file
      operationId: getFaceFile
      parameters:
        - name: filename
          in: path
          description: Get face from original file by filename
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/octet-stream:
              schema:
                $ref: '#/components/schemas/GetOFaceFile'
        '404':
          description: File not found
        '500':
          description: Internal server error
components:
  schemas:
    GetSystemRespose:
      type: object
      properties:
        status:
          type: string
          description: API is running
    FileUploadRequest:
      required:
        - file
      type: object
      properties:
        file:
          type: string
          format: binary
          description: The image to upload
    FileUploadResponse:
      required:
        - uuid
      type: object
      properties:
        message:
          type: string
          description: File uploaded
        uuid:
          type: string
          description: UUID of the uploaded file
    SessionInfoResponse:
      required:
        - uuid
        - image_path
        - faces
        - status
        - total_faces
      type: object
      properties:
        uuid:
          type: string
          description: Session UUID
        image_path:
          type: string
          description: Path to uploaded image
        status:
          type: string
          description: Session status
        total_faces:
          type: integer
          description: All faces on original image
        faces:
          type: array
          items:
            type: object
            properties:
              is_real_model_1:
                type: number
                format: float
                description: The probability that the image is not fake model 1
              is_real_model_2:
                type: number
                format: float
                description: The probability that the image is not fake model 2
              is_real_model_3:
                type: number
                format: float
                description: The probability that the image is not fake model 3
              is_real_model_4:
                type: number
                format: float
                description: The probability that the image is not fake model 4
              is_real_model_5:
                type: number
                format: float
                description: The probability that the image is not fake model 5
              is_real_model_6:
                type: number
                format: float
                description: The probability that the image is not fake model 6
              is_real_model_7:
                type: number
                format: float
                description: The probability that the image is not fake model 7
              is_real_model_8:
                type: number
                format: float
                description: The probability that the image is not fake model 8
              is_real_model_9:
                type: number
                format: float
                description: The probability that the image is not fake model 9
              is_real_model_10:
                type: number
                format: float
                description: The probability that the image is not fake model 10
              ansamble:
                type: number
                format: float
                description: The probability that the image is not fake ansamble
              face_path:
                type: string
                description: Path to face
    UuidStatusResponse:
      required:
        - status
      type: object
      properties:
        status:
          type: string
          description: Session status
    GetOriginalFile:
      type: string
      format: binary
    GetOFaceFile:
      type: string
      format: binary
