{
  "swagger": "2.0",
  "info": {
    "title": "AI Mastering API",
    "description": "This is a AI Mastering API document. You can use the mastering feature of [AI Mastering](https://aimastering.com) through this API.",
    "version": "1.0.0",
    "termsOfService": "https://aimastering.com/terms_of_service/",
    "contact": {
      "email": "info@bakuage.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "host": "api.bakuage.com:443",
  "basePath": "",
  "schemes": [
    "https"
  ],
  "securityDefinitions": {
    "bearer": {
      "type": "apiKey",
      "name": "Authorization",
      "in": "header"
    }
  },
  "security": [
    {
      "bearer": [

      ]
    }
  ],
  "tags": [
    {
      "name": "accessToken"
    },
    {
      "name": "amazonSubscription"
    },
    {
      "name": "audio"
    },
    {
      "name": "config"
    },
    {
      "name": "externalSearch"
    },
    {
      "name": "libraryAudio"
    },
    {
      "name": "mastering",
      "description": "A mastering consists of input audio, mastering parameters, and output audio."
    },
    {
      "name": "payment"
    },
    {
      "name": "paymentCustomer"
    },
    {
      "name": "plan"
    },
    {
      "name": "spSubscription"
    },
    {
      "name": "statistics"
    },
    {
      "name": "subscription"
    },
    {
      "name": "user"
    },
    {
      "name": "video"
    }
  ],
  "definitions": {
    "AccessToken": {
      "type": "object",
      "properties": {
        "access_token": {
          "$ref": "#/definitions/JWT"
        }
      }
    },
    "AmazonSubscription": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "user_id": {
          "type": "integer"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "deactivated"
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "AnonymizedMastering": {
      "type": "object",
      "properties": {
        "user_id": {
          "type": "string"
        },
        "user_auth_provider": {
          "type": "string"
        },
        "mode": {
          "type": "string",
          "enum": [
            "default",
            "custom"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "waiting",
            "processing",
            "canceled",
            "failed",
            "succeeded"
          ]
        },
        "failure_reason": {
          "type": "string",
          "enum": [
            "unknown",
            "expired",
            "failed_to_prepare"
          ]
        },
        "target_loudness": {
          "type": "number"
        },
        "output_format": {
          "type": "string",
          "enum": [
            "wav",
            "mp3"
          ]
        },
        "preset": {
          "type": "string",
          "enum": [
            "general",
            "pop",
            "jazz",
            "classical"
          ]
        },
        "bit_depth": {
          "type": "integer",
          "enum": [
            16,
            24,
            32
          ]
        },
        "sample_rate": {
          "type": "integer",
          "enum": [
            44100
          ]
        },
        "review_score": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "mastering_matching_level": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "mastering": {
          "type": "boolean"
        },
        "paid": {
          "type": "boolean"
        },
        "payment_service": {
          "type": "string",
          "enum": [
            "paypal",
            "stripe"
          ]
        },
        "retry_count": {
          "type": "integer"
        },
        "mastering_reverb": {
          "type": "boolean"
        },
        "mastering_reverb_gain": {
          "type": "number"
        },
        "low_cut_freq": {
          "type": "number"
        },
        "high_cut_freq": {
          "type": "number"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "Audio": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "file_resource_id": {
          "type": "integer"
        },
        "user_id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "created_by_user": {
          "type": "boolean"
        },
        "status": {
          "type": "string"
        },
        "failure_reason": {
          "type": "string"
        },
        "probe_json": {
          "type": "string",
          "format": "JSON"
        },
        "rms": {
          "type": "number"
        },
        "peak": {
          "type": "number"
        },
        "true_peak": {
          "type": "number"
        },
        "lowpass_true_peak_15khz": {
          "type": "number"
        },
        "loudness": {
          "type": "number"
        },
        "dynamics": {
          "type": "number"
        },
        "sharpness": {
          "type": "number"
        },
        "space": {
          "type": "number"
        },
        "loudness_range": {
          "type": "number"
        },
        "drr": {
          "type": "number"
        },
        "sound_quality": {
          "type": "number"
        },
        "sound_quality2": {
          "type": "number"
        },
        "dissonance": {
          "type": "number"
        },
        "frames": {
          "type": "integer"
        },
        "sample_rate": {
          "type": "integer"
        },
        "channels": {
          "type": "integer"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "AudioAnalysis": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Audio analysis id"
        },
        "audio_id": {
          "type": "integer",
          "description": "Audio id"
        },
        "analysis": {
          "type": "object",
          "description": "Audio analysis data. The schema changes frequently."
        }
      }
    },
    "AudioDownloadToken": {
      "type": "object",
      "properties": {
        "download_token": {
          "$ref": "#/definitions/JWT"
        },
        "download_url": {
          "type": "string"
        }
      }
    },
    "Config": {
      "type": "object",
      "properties": {
        "auth0": {
          "type": "object",
          "properties": {
            "audience": {
              "type": "string"
            },
            "domain": {
              "type": "string"
            },
            "client_id": {
              "type": "string"
            }
          }
        },
        "paypal": {
          "type": "object",
          "properties": {
            "mode": {
              "type": "string"
            },
            "client_id": {
              "type": "string"
            }
          }
        },
        "stripe": {
          "type": "object",
          "properties": {
            "publishable_key": {
              "type": "string"
            }
          }
        },
        "version": {
          "type": "object",
          "properties": {
            "commit": {
              "type": "string"
            }
          }
        }
      }
    },
    "ExternalSearchResult": {
      "type": "object",
      "properties": {
        "itunes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "thumbnail_url": {
                "type": "string"
              },
              "preview_url": {
                "type": "string"
              },
              "album_name": {
                "type": "string"
              },
              "album_url": {
                "type": "string"
              },
              "artist_name": {
                "type": "string"
              },
              "artist_url": {
                "type": "string"
              },
              "track_number": {
                "type": "integer"
              }
            }
          }
        },
        "youtube": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "thumbnail_url": {
                "type": "string"
              },
              "channel_id": {
                "type": "string"
              },
              "channel_url": {
                "type": "string"
              },
              "channel_name": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "GroupBuyStatistics": {
      "type": "object",
      "properties": {
        "premium_plan_subscribed_user_count": {
          "type": "integer"
        }
      }
    },
    "JWT": {
      "type": "string",
      "format": "JWT"
    },
    "Kpi": {
      "type": "object"
    },
    "LibraryAudio": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "user_id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "album": {
          "type": "string"
        },
        "album_artist": {
          "type": "string"
        },
        "artist": {
          "type": "string"
        },
        "genre": {
          "type": "string"
        },
        "track": {
          "type": "integer"
        },
        "publisher": {
          "type": "string"
        },
        "file_hash": {
          "type": "string"
        },
        "size": {
          "type": "integer"
        },
        "status": {
          "type": "string"
        },
        "failure_reason": {
          "type": "string"
        },
        "probe_json": {
          "type": "string",
          "format": "JSON"
        },
        "rms": {
          "type": "number"
        },
        "peak": {
          "type": "number"
        },
        "true_peak": {
          "type": "number"
        },
        "lowpass_true_peak_15khz": {
          "type": "number"
        },
        "loudness": {
          "type": "number"
        },
        "dynamics": {
          "type": "number"
        },
        "sharpness": {
          "type": "number"
        },
        "space": {
          "type": "number"
        },
        "loudness_range": {
          "type": "number"
        },
        "drr": {
          "type": "number"
        },
        "sound_quality": {
          "type": "number"
        },
        "sound_quality2": {
          "type": "number"
        },
        "dissonance": {
          "type": "number"
        },
        "frames": {
          "type": "integer"
        },
        "sample_rate": {
          "type": "integer"
        },
        "channels": {
          "type": "integer"
        },
        "is_public": {
          "type": "boolean"
        },
        "liked_by_self": {
          "type": "boolean"
        },
        "like_count": {
          "type": "integer"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "LibraryAudioAnalysis": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Audio analysis id"
        },
        "library_audio_id": {
          "type": "integer",
          "description": "Audio id"
        },
        "analysis": {
          "type": "object",
          "description": "Audio analysis data. The schema changes frequently."
        }
      }
    },
    "LibraryAudioLike": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Audio analysis id"
        },
        "library_audio_id": {
          "type": "integer",
          "description": "Audio id"
        },
        "user_id": {
          "type": "integer",
          "description": "User id"
        }
      }
    },
    "Mastering": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "user_id": {
          "type": "integer"
        },
        "input_audio_id": {
          "type": "integer"
        },
        "output_audio_id": {
          "type": "integer"
        },
        "output_video_id": {
          "type": "integer"
        },
        "reference_audio_id": {
          "type": "integer"
        },
        "mode": {
          "type": "string",
          "enum": [
            "default",
            "custom"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "waiting",
            "processing",
            "canceled",
            "failed",
            "succeeded"
          ]
        },
        "failure_reason": {
          "type": "string",
          "enum": [
            "unknown",
            "expired",
            "failed_to_prepare"
          ]
        },
        "target_loudness_mode": {
          "type": "string",
          "enum": [
            "loudness",
            "rms",
            "peak",
            "youtube_loudness"
          ]
        },
        "target_loudness": {
          "type": "number"
        },
        "output_format": {
          "type": "string",
          "enum": [
            "wav",
            "mp3"
          ]
        },
        "preset": {
          "type": "string",
          "enum": [
            "general",
            "pop",
            "jazz",
            "classical"
          ]
        },
        "bit_depth": {
          "type": "integer",
          "enum": [
            16,
            24,
            32
          ]
        },
        "sample_rate": {
          "type": "integer",
          "enum": [
            44100
          ]
        },
        "review_comment": {
          "type": "string"
        },
        "review_score": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "mastering_matching_level": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "progression": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "bass_preservation": {
          "type": "boolean"
        },
        "mastering": {
          "type": "boolean"
        },
        "mastering_algorithm": {
          "type": "string",
          "enum": [
            "v1",
            "v2"
          ]
        },
        "preserved": {
          "type": "boolean"
        },
        "retry_count": {
          "type": "integer"
        },
        "mastering_reverb": {
          "type": "boolean"
        },
        "mastering_reverb_gain": {
          "type": "number"
        },
        "low_cut_freq": {
          "type": "number"
        },
        "high_cut_freq": {
          "type": "number"
        },
        "ceiling": {
          "type": "number"
        },
        "ceiling_mode": {
          "type": "string"
        },
        "oversample": {
          "type": "integer"
        },
        "limiting_error": {
          "type": "number"
        },
        "video_title": {
          "type": "string"
        },
        "video_status": {
          "type": "string",
          "enum": [
            "waiting",
            "failed",
            "succeeded"
          ]
        },
        "expire_at": {
          "type": "string",
          "format": "date-time"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "Payment": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "service": {
          "type": "string",
          "enum": [
            "paypal",
            "stripe"
          ]
        },
        "product_given": {
          "type": "boolean"
        },
        "product": {
          "type": "object"
        },
        "transaction_id": {
          "type": "string"
        },
        "transaction_detail": {
          "type": "object"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "PaymentCustomer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "payment_customer_detail": {
          "type": "object"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "Plan": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "integer"
        },
        "currency": {
          "type": "string",
          "enum": [
            "jpy",
            "usd"
          ]
        },
        "interval": {
          "type": "string",
          "enum": [
            "month"
          ]
        },
        "name": {
          "type": "string"
        },
        "stripe_plan_id": {
          "type": "string"
        }
      }
    },
    "SpSubscription": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "user_id": {
          "type": "integer"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "inactive"
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "Subscription": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "user_id": {
          "type": "integer"
        },
        "stripe_subscription_id": {
          "type": "string"
        },
        "current_period_start_at": {
          "type": "string",
          "format": "date-time"
        },
        "current_period_end_at": {
          "type": "string",
          "format": "date-time"
        },
        "canceled": {
          "type": "boolean"
        },
        "cancel_at_period_end": {
          "type": "boolean"
        },
        "trial_end": {
          "type": "string",
          "format": "date-time"
        },
        "status": {
          "type": "string",
          "enum": [
            "trialing",
            "active",
            "past_due",
            "unpaid",
            "canceled"
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "User": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "affiliate_enabled": {
          "type": "boolean"
        },
        "agreed_terms_of_service": {
          "type": "boolean"
        },
        "auth_id": {
          "type": "string"
        },
        "auth_provider": {
          "type": "string",
          "enum": [
            "auth0",
            "github",
            "google",
            "twitter"
          ]
        },
        "email": {
          "type": "string"
        },
        "registration_notified": {
          "type": "boolean"
        },
        "statistics": {
          "type": "object",
          "properties": {
            "registration_invitation_count": {
              "type": "integer"
            },
            "subscription_invitation_count": {
              "type": "integer"
            },
            "mastering_count": {
              "type": "integer"
            },
            "monthly_registration_invitation_count": {
              "type": "integer"
            },
            "monthly_subscription_invitation_count": {
              "type": "integer"
            },
            "monthly_mastering_count": {
              "type": "integer"
            }
          }
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "Video": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "file_resource_id": {
          "type": "integer"
        },
        "user_id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "VideoDownloadToken": {
      "type": "object",
      "properties": {
        "download_token": {
          "$ref": "#/definitions/JWT"
        },
        "download_url": {
          "type": "string"
        }
      }
    }
  },
  "parameters": {
    "AudioDownloadToken": {
      "name": "download_token",
      "in": "query",
      "description": "Audio download token",
      "required": true,
      "type": "string",
      "format": "JWT"
    },
    "AudioId": {
      "name": "id",
      "in": "path",
      "description": "Audio id",
      "required": true,
      "type": "integer",
      "minimum": 1
    },
    "LibraryAudioId": {
      "name": "id",
      "in": "path",
      "description": "Library audio id",
      "required": true,
      "type": "integer",
      "minimum": 1
    },
    "MasteringId": {
      "name": "id",
      "in": "path",
      "description": "Mastering id",
      "required": true,
      "type": "integer",
      "minimum": 1
    },
    "PaymentId": {
      "name": "id",
      "in": "path",
      "description": "Payment id",
      "required": true,
      "type": "integer",
      "minimum": 1
    },
    "SubscriptionId": {
      "name": "id",
      "in": "path",
      "description": "Subscription id",
      "required": true,
      "type": "integer",
      "minimum": 1
    },
    "VideoDownloadToken": {
      "name": "download_token",
      "in": "query",
      "description": "Video download token",
      "required": true,
      "type": "string",
      "format": "JWT"
    },
    "VideoId": {
      "name": "id",
      "in": "path",
      "description": "Video id",
      "required": true,
      "type": "integer",
      "minimum": 1
    }
  },
  "paths": {
    "/access_tokens": {
      "post": {
        "tags": [
          "accessToken"
        ],
        "operationId": "createAccessToken",
        "summary": "Create an API access token.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/AccessToken"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/amazon_subscriptions": {
      "get": {
        "tags": [
          "amazonSubscription"
        ],
        "operationId": "listAmazonSubscriptions",
        "summary": "Get all accessable amazon subscriptions.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/AmazonSubscription"
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/audios": {
      "post": {
        "tags": [
          "audio"
        ],
        "operationId": "createAudio",
        "summary": "Create a new audio.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "file",
            "in": "formData",
            "type": "file",
            "description": "The file to upload."
          },
          {
            "name": "name",
            "in": "formData",
            "description": "Audio name. If this is not specified, the name in file parameter is used.",
            "required": false,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Audio"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      },
      "get": {
        "tags": [
          "audio"
        ],
        "operationId": "listAudios",
        "summary": "Get all audios accessable.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Audio"
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/audios/{id}": {
      "get": {
        "tags": [
          "audio"
        ],
        "operationId": "getAudio",
        "summary": "Get an audio by id.",
        "parameters": [
          {
            "$ref": "#/parameters/AudioId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Audio"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/audios/{id}/download": {
      "get": {
        "tags": [
          "audio"
        ],
        "operationId": "downloadAudio",
        "summary": "Download an audio data by id.",
        "parameters": [
          {
            "$ref": "#/parameters/AudioId"
          }
        ],
        "produces": [
          "application/octet-stream"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "string",
              "format": "binary"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/audios/download_by_token": {
      "get": {
        "tags": [
          "audio"
        ],
        "operationId": "downloadAudioByToken",
        "summary": "Download an audio data by audio_download_token.",
        "parameters": [
          {
            "$ref": "#/parameters/AudioDownloadToken"
          }
        ],
        "produces": [
          "application/octet-stream"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "string",
              "format": "binary"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/audios/{id}/download_token": {
      "get": {
        "tags": [
          "audio"
        ],
        "operationId": "getAudioDownloadToken",
        "summary": "Get an audio download token by id.",
        "parameters": [
          {
            "$ref": "#/parameters/AudioId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/AudioDownloadToken"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/audios/{id}/analysis": {
      "get": {
        "tags": [
          "audio"
        ],
        "operationId": "getAudioAnalysis",
        "summary": "Get an audio analysis by id.",
        "parameters": [
          {
            "$ref": "#/parameters/AudioId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/AudioAnalysis"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/config": {
      "get": {
        "tags": [
          "config"
        ],
        "operationId": "getConfig",
        "summary": "Get config.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Config"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/external_search": {
      "get": {
        "tags": [
          "externalSearch"
        ],
        "operationId": "searchExternal",
        "summary": "Search external music and get name, url, thumbnails, etc.",
        "parameters": [
          {
            "in": "query",
            "name": "query",
            "type": "string",
            "description": "Search query",
            "required": true
          },
          {
            "in": "query",
            "name": "country",
            "type": "string",
            "description": "Country ex. US, JP, etc",
            "required": true
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/ExternalSearchResult"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/library_audios": {
      "post": {
        "tags": [
          "libraryAudio"
        ],
        "operationId": "createLibraryAudio",
        "summary": "Create a new library audio.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "in": "formData",
            "name": "file",
            "type": "file",
            "description": "The file to upload."
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/LibraryAudio"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      },
      "get": {
        "tags": [
          "libraryAudio"
        ],
        "operationId": "listLibraryAudios",
        "summary": "Get all library audios accessable.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LibraryAudio"
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/library_audios/{id}": {
      "get": {
        "tags": [
          "libraryAudio"
        ],
        "operationId": "getLibraryAudio",
        "summary": "Get a library audio by id.",
        "parameters": [
          {
            "$ref": "#/parameters/LibraryAudioId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/LibraryAudio"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      },
      "put": {
        "tags": [
          "libraryAudio"
        ],
        "operationId": "updateLibraryAudio",
        "summary": "Update library audio.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/LibraryAudioId"
          },
          {
            "name": "is_public",
            "in": "formData",
            "description": "Whether the library audio is public.",
            "required": false,
            "type": "boolean"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/LibraryAudio"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      },
      "delete": {
        "tags": [
          "libraryAudio"
        ],
        "operationId": "deleteLibraryAudio",
        "summary": "Delete library audio.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/LibraryAudioId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/LibraryAudio"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/library_audios/{id}/analysis": {
      "get": {
        "tags": [
          "libraryAudio"
        ],
        "operationId": "getLibraryAudioAnalysis",
        "summary": "Get a library audio analysis by id.",
        "parameters": [
          {
            "$ref": "#/parameters/LibraryAudioId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/LibraryAudioAnalysis"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/library_audios/{id}/like": {
      "post": {
        "tags": [
          "libraryAudio"
        ],
        "operationId": "createLibraryAudioLike",
        "summary": "Create a new library audio like.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/LibraryAudioId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/LibraryAudioLike"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/masterings": {
      "post": {
        "tags": [
          "mastering"
        ],
        "operationId": "createMastering",
        "summary": "Create a new mastering.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "mode",
            "in": "formData",
            "description": "Mode",
            "required": false,
            "type": "string",
            "default": "default",
            "enum": [
              "default",
              "custom"
            ]
          },
          {
            "name": "input_audio_id",
            "in": "formData",
            "description": "Input audio id",
            "required": true,
            "type": "integer",
            "minimum": 1
          },
          {
            "name": "bass_preservation",
            "in": "formData",
            "description": "This parameter represents if the bass preservation is enabled.",
            "default": false,
            "required": false,
            "type": "boolean"
          },
          {
            "name": "mastering",
            "in": "formData",
            "description": "This parameter represents if the mastering is enabled. This parameter is effective only when the mode is \"default\" or \"custom\".",
            "default": false,
            "required": false,
            "type": "boolean"
          },
          {
            "name": "mastering_algorithm",
            "in": "formData",
            "default": "v2",
            "required": false,
            "type": "string",
            "enum": [
              "v1",
              "v2"
            ]
          },
          {
            "name": "noise_reduction",
            "in": "formData",
            "description": "This parameter represents if the nosie reduction is enabled. This parameter is effective only when the mode is \"custom\".",
            "default": false,
            "required": false,
            "type": "boolean"
          },
          {
            "name": "preset",
            "in": "formData",
            "description": "This parameter is effective only when the mode is \"custom\".",
            "default": "general",
            "required": false,
            "type": "string",
            "enum": [
              "general",
              "pop",
              "classical",
              "jazz"
            ]
          },
          {
            "name": "target_loudness",
            "in": "formData",
            "description": "This parameter represents the target loudness of the output audio in dB. This parameter is effective only when the mode is \"custom\".",
            "default": -5,
            "required": false,
            "type": "number"
          },
          {
            "name": "target_loudness_mode",
            "in": "formData",
            "default": "loudness",
            "required": false,
            "type": "string",
            "enum": [
              "loudness",
              "rms",
              "peak",
              "youtube_loudness"
            ]
          },
          {
            "name": "mastering_matching_level",
            "in": "formData",
            "description": "This parameter represents the mastering reference matching level. This parameter is effective only when the mode is \"custom\" and the mastering is enabled.",
            "default": 0.5,
            "required": false,
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          {
            "name": "mastering_reverb",
            "in": "formData",
            "description": "This parameter represents if the mastering reverb is enabled. This parameter is effective only when the mode is \"custom\" and the mastering is enabled.",
            "default": false,
            "required": false,
            "type": "boolean"
          },
          {
            "name": "mastering_reverb_gain",
            "in": "formData",
            "description": "This parameter represents the mastering reverb gain relative to the dry sound in dB. This parameter is effective only when the mode is \"custom\" and the mastering is \"true\" and the mastering_reverb is \"true\".",
            "default": -36,
            "required": false,
            "type": "number"
          },
          {
            "name": "reference_audio_id",
            "in": "formData",
            "description": "Reference audio id. This parameter is effective only when the mode is \"custom\" and the mastering is enabled.",
            "required": false,
            "type": "integer",
            "minimum": 1
          },
          {
            "name": "low_cut_freq",
            "in": "formData",
            "description": "This parameter represents the low cut freq  of the output audio in Hz. This parameter is effective only when the mode is \"custom\".",
            "default": 20,
            "required": false,
            "type": "number",
            "minimum": 0
          },
          {
            "name": "high_cut_freq",
            "in": "formData",
            "description": "This parameter represents the high cut freq of the output audio in Hz. This parameter is effective only when the mode is \"custom\".",
            "default": 20000,
            "required": false,
            "type": "number",
            "minimum": 0
          },
          {
            "name": "ceiling",
            "in": "formData",
            "default": 0,
            "required": false,
            "type": "number"
          },
          {
            "name": "ceiling_mode",
            "in": "formData",
            "default": 0,
            "required": false,
            "type": "string",
            "enum": [
              "peak",
              "true_peak",
              "lowpass_true_peak"
            ]
          },
          {
            "name": "oversample",
            "in": "formData",
            "default": 1,
            "required": false,
            "type": "integer"
          },
          {
            "name": "sample_rate",
            "in": "formData",
            "description": "This parameter represents the sample rate of the output audio in dB. This parameter is effective only when the mode is \"custom\".",
            "default": 44100,
            "required": false,
            "type": "integer",
            "enum": [
              44100
            ]
          },
          {
            "name": "bit_depth",
            "in": "formData",
            "description": "This parameter represents the bit depth of the output audio in dB. This parameter is effective only when the mode is \"custom\".",
            "default": 16,
            "required": false,
            "type": "integer",
            "enum": [
              16,
              24,
              32
            ]
          },
          {
            "name": "output_format",
            "in": "formData",
            "description": "This parameter represents the format of the output audio. This parameter is effective only when the mode is \"custom\".",
            "default": "wav",
            "required": false,
            "type": "string",
            "enum": [
              "wav",
              "mp3"
            ]
          },
          {
            "name": "for_preview",
            "in": "formData",
            "description": "If this is true, the mastering is treated for preview purpose (ex. not purchasable, not publishable, short lifetime). ",
            "required": false,
            "type": "boolean",
            "default": false
          },
          {
            "name": "start_at",
            "in": "formData",
            "description": "Partial mastering start at. ",
            "required": false,
            "type": "number",
            "default": 0
          },
          {
            "name": "end_at",
            "in": "formData",
            "description": "Partial mastering end at. ",
            "required": false,
            "type": "number",
            "default": -1
          },
          {
            "name": "video_title",
            "in": "formData",
            "description": "This parameter represents the title of output video.",
            "default": "",
            "required": false,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Mastering"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      },
      "get": {
        "tags": [
          "mastering"
        ],
        "operationId": "listMasterings",
        "summary": "Get all accessable masterings.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Mastering"
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/masterings/{id}": {
      "get": {
        "tags": [
          "mastering"
        ],
        "operationId": "getMastering",
        "summary": "Get a mastering by id.",
        "parameters": [
          {
            "$ref": "#/parameters/MasteringId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Mastering"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      },
      "put": {
        "tags": [
          "mastering"
        ],
        "operationId": "updateMastering",
        "summary": "Update a mastering.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/MasteringId"
          },
          {
            "name": "preserved",
            "in": "formData",
            "description": "Disable auto delete.",
            "required": false,
            "type": "boolean"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Mastering"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      },
      "delete": {
        "tags": [
          "mastering"
        ],
        "operationId": "deleteMastering",
        "summary": "Delete mastering.",
        "parameters": [
          {
            "$ref": "#/parameters/MasteringId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Mastering"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/masterings/{id}/cancel": {
      "put": {
        "tags": [
          "mastering"
        ],
        "operationId": "cancelMastering",
        "summary": "Cancel a mastering by id.",
        "parameters": [
          {
            "$ref": "#/parameters/MasteringId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Mastering"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/masterings/{id}/review": {
      "put": {
        "tags": [
          "mastering"
        ],
        "operationId": "reviewMastering",
        "summary": "Review a mastering by id.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/MasteringId"
          },
          {
            "name": "review_comment",
            "in": "formData",
            "description": "This parameter represents the review comment.",
            "required": false,
            "type": "string"
          },
          {
            "name": "review_score",
            "in": "formData",
            "description": "This parameter represents the review score.",
            "required": false,
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Mastering"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/masterings/{id}/free_unlock": {
      "put": {
        "tags": [
          "mastering"
        ],
        "operationId": "freeUnlockMastering",
        "summary": "Free unlock a mastering by id.",
        "parameters": [
          {
            "$ref": "#/parameters/MasteringId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Mastering"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/masterings/{id}/unlock_product": {
      "get": {
        "tags": [
          "mastering"
        ],
        "operationId": "getMasteringUnlockProduct",
        "summary": "Review a mastering by id.",
        "parameters": [
          {
            "$ref": "#/parameters/MasteringId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Mastering"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/masterings/{id}/publish": {
      "post": {
        "tags": [
          "mastering"
        ],
        "operationId": "publishMastering",
        "summary": "Publish a mastering by id.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/MasteringId"
          },
          {
            "name": "service",
            "in": "formData",
            "description": "This parameter represents the publishment service.",
            "required": false,
            "type": "string",
            "enum": [
              "twitter",
              "youtube"
            ]
          },
          {
            "name": "access_token",
            "in": "formData",
            "description": "This parameter represents if the access token of the publishment service API.",
            "required": true,
            "type": "string"
          },
          {
            "name": "access_token_secret",
            "in": "formData",
            "description": "This parameter represents the access token secret of the publishment service API. This parameter is effective only when the service is \"twitter\".",
            "required": false,
            "type": "string"
          },
          {
            "name": "message",
            "in": "formData",
            "description": "This parameter represents the publishment message.",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Mastering"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/payments": {
      "post": {
        "tags": [
          "payment"
        ],
        "operationId": "createPayment",
        "summary": "Create a new payment.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "product_token",
            "in": "formData",
            "description": "This parameter represents the product token.",
            "required": true,
            "type": "string"
          },
          {
            "name": "service",
            "in": "formData",
            "description": "This parameter represents the payment message.",
            "required": true,
            "type": "string",
            "enum": [
              "paypal",
              "stripe"
            ]
          },
          {
            "name": "token",
            "in": "formData",
            "description": "This parameter represents the card token. This parameter is effective only when the service is \"stripe\".",
            "required": false,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Payment"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      },
      "get": {
        "tags": [
          "payment"
        ],
        "operationId": "listPayments",
        "summary": "Get all accessable payments.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Payment"
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/payments/{id}": {
      "get": {
        "tags": [
          "payment"
        ],
        "operationId": "getPayment",
        "summary": "Get a payment by id.",
        "parameters": [
          {
            "$ref": "#/parameters/PaymentId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Payment"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/payments/{id}/execute": {
      "put": {
        "tags": [
          "payment"
        ],
        "operationId": "executePayment",
        "summary": "Execute a payment by id.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/PaymentId"
          },
          {
            "name": "payer_id",
            "in": "formData",
            "description": "This parameter represents the card token. This parameter is effective only when the service is \"paypal\".",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Payment"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/payment_customers/default": {
      "get": {
        "tags": [
          "paymentCustomer"
        ],
        "operationId": "getDefaultPaymentCustomer",
        "summary": "Get a default payment customer.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/PaymentCustomer"
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/plans": {
      "get": {
        "tags": [
          "plan"
        ],
        "operationId": "listPlans",
        "summary": "Get all accessable plans.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Plan"
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/sp_subscriptions": {
      "post": {
        "tags": [
          "spSubscription"
        ],
        "operationId": "createSpSubscription",
        "summary": "Create a new smartphone subscription.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "service",
            "in": "formData",
            "description": "Service.",
            "required": true,
            "type": "string",
            "enum": [
              "appstore"
            ]
          },
          {
            "name": "receipt",
            "in": "formData",
            "description": "Base64 encoded app store receipt. This parameter is effective only when the service is \"appstore\".",
            "required": false,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/SpSubscription"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      },
      "get": {
        "tags": [
          "spSubscription"
        ],
        "operationId": "listSpSubscriptions",
        "summary": "Get all accessable smartphone subscriptions.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/SpSubscription"
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/statistics/anonymized_masterings": {
      "get": {
        "tags": [
          "statistics"
        ],
        "operationId": "listAnonymizedMasterings",
        "summary": "Get anonymized masterings.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/AnonymizedMastering"
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/statistics/kpis": {
      "get": {
        "tags": [
          "statistics"
        ],
        "operationId": "listKpis",
        "summary": "Get KPIs.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Kpi"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/statistics/group_buy": {
      "get": {
        "tags": [
          "statistics"
        ],
        "operationId": "getGroupBuyStatistics",
        "summary": "Get group buy statistics.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/GroupBuyStatistics"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/subscriptions": {
      "post": {
        "tags": [
          "subscription"
        ],
        "operationId": "createSubscription",
        "summary": "Create a new subscription.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "service",
            "in": "formData",
            "description": "This parameter represents the payment message.",
            "required": true,
            "type": "string",
            "enum": [
              "stripe"
            ]
          },
          {
            "name": "stripe_plan_id",
            "in": "formData",
            "description": "The Stripe plan id. This parameter is effective only when the service is \"stripe\".",
            "required": false,
            "type": "string"
          },
          {
            "name": "token",
            "in": "formData",
            "description": "This parameter represents the card token. This parameter is effective only when the service is \"stripe\".",
            "required": false,
            "type": "string"
          },
          {
            "name": "affiliate_id",
            "in": "formData",
            "description": "Affiliate id of inviter user.",
            "required": false,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Subscription"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      },
      "get": {
        "tags": [
          "subscription"
        ],
        "operationId": "listSubscriptions",
        "summary": "Get all accessable subscriptions.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Subscription"
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/subscriptions/{id}": {
      "get": {
        "tags": [
          "subscription"
        ],
        "operationId": "getSubscription",
        "summary": "Get a subscription by id.",
        "parameters": [
          {
            "$ref": "#/parameters/SubscriptionId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Subscription"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/subscriptions/{id}/cancel": {
      "put": {
        "tags": [
          "subscription"
        ],
        "operationId": "cancelSubscription",
        "summary": "Cancel a subscription by id.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/SubscriptionId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Subscription"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/subscriptions/{id}/cancel_cancellation": {
      "put": {
        "tags": [
          "subscription"
        ],
        "operationId": "cancelSubscriptionCancellation",
        "summary": "Cancel the subscription cancellation  by id.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/SubscriptionId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Subscription"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/users/self": {
      "put": {
        "tags": [
          "user"
        ],
        "operationId": "updateSelf",
        "summary": "Update self user.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "agreed_terms_of_service",
            "in": "formData",
            "description": "Whether you agreed terms of service.",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "email",
            "in": "formData",
            "description": "The email.",
            "required": false,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      },
      "get": {
        "tags": [
          "user"
        ],
        "operationId": "getSelf",
        "summary": "Get self user.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/users/self/notify_registration": {
      "put": {
        "tags": [
          "user"
        ],
        "operationId": "notifyRegistration",
        "summary": "Notify user is registered.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "affiliate_id",
            "in": "formData",
            "description": "The affiliate id of inviter.",
            "required": false,
            "type": "string"
          },
          {
            "name": "referrer_url",
            "in": "formData",
            "description": "The referrer URL.",
            "required": false,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/users/self/send_invitation": {
      "post": {
        "tags": [
          "user"
        ],
        "operationId": "sendInvitation",
        "summary": "Send invitation.",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "name": "invitee_email",
            "in": "formData",
            "description": "The email of invitee.",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/videos": {
      "get": {
        "tags": [
          "video"
        ],
        "operationId": "listVideos",
        "summary": "Get all videos accessable.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Video"
              }
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/videos/{id}": {
      "get": {
        "tags": [
          "video"
        ],
        "operationId": "getVideo",
        "summary": "Get an video by id.",
        "parameters": [
          {
            "$ref": "#/parameters/VideoId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/Video"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/videos/{id}/download": {
      "get": {
        "tags": [
          "video"
        ],
        "operationId": "downloadVideo",
        "summary": "Download an video data by id.",
        "parameters": [
          {
            "$ref": "#/parameters/VideoId"
          }
        ],
        "produces": [
          "application/octet-stream"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "string",
              "format": "binary"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/videos/download_by_token": {
      "get": {
        "tags": [
          "video"
        ],
        "operationId": "downloadVideoByToken",
        "summary": "Download an video data by video_download_token.",
        "parameters": [
          {
            "$ref": "#/parameters/VideoDownloadToken"
          }
        ],
        "produces": [
          "application/octet-stream"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "string",
              "format": "binary"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    },
    "/videos/{id}/download_token": {
      "get": {
        "tags": [
          "video"
        ],
        "operationId": "getVideoDownloadToken",
        "summary": "Get an video download token by id.",
        "parameters": [
          {
            "$ref": "#/parameters/VideoId"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/VideoDownloadToken"
            }
          },
          "default": {
            "description": "Error"
          }
        }
      }
    }
  }
}