swagger: '2.0'

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

basePath: /api/v1

schemes:
    - https
    - http

paths:
    /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
                      properties:
                          room:
                              type: string
                              default: 'test'
            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:
    JoinResponse:
        type: 'object'
        properties:
            join:
                type: 'object'
                properties:
                    broadcast:
                        type: 'string'
                    viewer:
                        type: 'string'
                    viewerHome:
                        type: 'string'
        example:
            join:
                broadcast: 'https://bro.mirotalk.com/broadcast?id=test&name=broadcast-86387'
                viewer: 'https://bro.mirotalk.com/viewer?id=test&name=viewer-89359'
                viewerHome: 'https://bro.mirotalk.com/home?id=test'
