swagger: '2.0'

info:
    title: MiroTalk SFU API
    description: API description for external applications that integrates with MiroTalk SFU.
    version: 1.0.0

basePath: /api/v1

schemes:
    - https
    - http

paths:
    /meeting:
        post:
            tags:
                - 'meeting'
            summary: 'Create meeting'
            description: 'Create meeting'
            consumes:
                - 'application/json'
            produces:
                - 'application/json'
            security:
                - secretApiKey: []
            responses:
                '200':
                    description: 'Meeting created'
                    schema:
                        $ref: '#/definitions/MeetingResponse'
                '403':
                    description: 'Unauthorized!'
    /join:
        post:
            tags:
                - 'join'
            summary: 'Create direct join'
            description: 'Create join'
            parameters:
                - in: body
                  name: Join
                  description: Custom Join URL.
                  schema:
                      type: object
                      required:
                          - room
                          - name
                          - audio
                          - video
                          - notify
                      properties:
                          room:
                              type: string
                          name:
                              type: string
                          audio:
                              type: boolean
                          video:
                              type: boolean
                          notify:
                              type: boolean
            consumes:
                - 'application/json'
            produces:
                - 'application/json'
            security:
                - secretApiKey: []
            responses:
                '200':
                    description: 'Direct join created'
                    schema:
                        $ref: '#/definitions/JoinResponse'
                '403':
                    description: 'Unauthorized!'

securityDefinitions:
    secretApiKey:
        type: 'apiKey'
        name: 'authorization'
        in: 'header'
        description: 'Format like this: authorization: {API_KEY_SECRET}'

definitions:
    MeetingResponse:
        type: 'object'
        properties:
            meeting:
                type: 'string'
    JoinResponse:
        type: 'object'
        properties:
            join:
                type: 'string'
