swagger: '2.0'
info:
  title: Teamwork Spaces
  description: 'Teamwork Spaces is a modern, intuitive content collaboration workspace with smart features like required reading and live widgets.'
  version: '1.0'
  contact:
    name: Teamwork Spaces Support
    url: 'https://support.teamwork.com/spaces'
    email: api@teamwork.com
basePath: /spaces/api
consumes:
  - application/json
produces:
  - application/json
tags:
  - name: access
  - name: activity
  - name: attachments
  - name: categories
  - name: category
  - name: collaborators
  - name: comments
  - name: companies
  - name: enable
  - name: export
  - name: favorites
  - name: features
  - name: feedback
  - name: following
  - name: globalTemplates
  - name: health
  - name: iframely
  - name: importer
  - name: inlineComments
  - name: installation
  - name: invites
  - name: me
  - name: notifications
  - name: pageBanner
  - name: pagepermissions
  - name: pages
  - name: pageshare
  - name: permissions
  - name: pluginstates
  - name: reaction
  - name: reactiontypes
  - name: requiredReading
  - name: search
  - name: setup
  - name: slug
  - name: spaceBanner
  - name: spaceContent
  - name: spaceOptions
  - name: spaceOwner
  - name: spaces
  - name: stats
  - name: subscription
  - name: tags
  - name: templates
  - name: trash
  - name: users
  - name: webhook-events
  - name: webhook-requests
  - name: webhooks
paths:
  '/v0/spaces/{spaceID}/pages/{pageID}/read.json':
    put:
      operationId: 'PUT_v0_spaces_{spaceID}_pages_{pageID}_read.json'
      tags:
        - requiredReading
      summary: Updates the users read state of a page.
      description: Updating a users read status can either set it to read or unread.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: http.LegacyRead
          in: body
          required: true
          schema:
            $ref: '#/definitions/http.LegacyRead'
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/http.LegacyRead'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v0/users/{userID}/reading.json':
    get:
      operationId: 'GET_v0_users_{userID}_reading.json'
      tags:
        - requiredReading
      summary: get fetches a users required reading.
      produces:
        - application/json
      parameters:
        - name: userID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.ReadingItem'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/attachments/:attachmentId/copy.json':
    post:
      operationId: 'POST_v1_attachments_:attachmentId_copy.json'
      tags:
        - attachments
      summary: creates a copy of an attachment currently stored in S3 and associates with a given Space and Page.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.AttachmentCopy
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.AttachmentCopy'
      responses:
        '201':
          description: 201 Created
          schema:
            $ref: '#/definitions/spaces-api.Attachment'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/companies.json:
    get:
      operationId: GET_v1_companies.json
      tags:
        - companies
      summary: Get a list of your companies
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Company'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    post:
      operationId: POST_v1_companies.json
      tags:
        - companies
      summary: Create a new Company
      produces:
        - application/json
      responses:
        '201':
          description: 201 Created
          schema:
            $ref: '#/definitions/spaces-api.ProjectsCreateStatusOK'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/spaces-api.ProjectsCreateStatusErr'
        '409':
          description: 409 Conflict
          schema:
            $ref: '#/definitions/spaces-api.ProjectsCreateStatusErr'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/companies/{companyID}.json':
    get:
      operationId: 'GET_v1_companies_{companyID}.json'
      tags:
        - companies
      summary: Get a single company
      produces:
        - application/json
      parameters:
        - name: companyID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Company'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    put:
      operationId: 'PUT_v1_companies_{companyID}.json'
      tags:
        - companies
      summary: Updates an existing Company
      produces:
        - application/json
      parameters:
        - name: companyID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.ProjectsStatus'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/spaces-api.ProjectsCreateStatusErr'
        '409':
          description: 409 Conflict
          schema:
            $ref: '#/definitions/spaces-api.ProjectsCreateStatusErr'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_companies_{companyID}.json'
      tags:
        - companies
      description: Delete a company from central store.
      produces:
        - application/json
      parameters:
        - name: companyID
          in: path
          type: integer
          required: true
      responses:
        '201':
          description: 201 Created
          schema:
            $ref: '#/definitions/spaces-api.ProjectsStatus'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/companies/{companyID}/movepeople.json':
    put:
      operationId: 'PUT_v1_companies_{companyID}_movepeople.json'
      tags:
        - companies
      summary: Updates the company user/s are assigned to
      description: 'Status codes match existing proxy behaviour, of 200, or 500'
      produces:
        - application/json
      parameters:
        - name: companyID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.ProjectsStatus'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/spaces-api.ProjectsCreateStatusErr'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/enableEarlyAccess:
    get:
      operationId: GET_v1_enableEarlyAccess
      tags:
        - enable
      summary: Enables spaces for the current installation
      produces:
        - application/json
      responses:
        '301':
          description: 301 Moved Permanently (no data)
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/enabled.json:
    get:
      operationId: GET_v1_enabled.json
      tags:
        - enable
      summary: get the current users data
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/http.enabledResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/features.json:
    get:
      operationId: GET_v1_features.json
      tags:
        - features
      summary: Get list of all features
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Feature'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/feedback.json:
    post:
      operationId: POST_v1_feedback.json
      tags:
        - feedback
      summary: Post feedback to the spaces team
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.Feedback
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.Feedback'
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Feedback'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/health.json:
    get:
      operationId: GET_v1_health.json
      tags:
        - health
      summary: Get the health of spaces-api
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK (application/json data)
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/iframely.json:
    get:
      operationId: GET_v1_iframely.json
      tags:
        - iframely
      summary: returns rich media for a url from the iframely.com service
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.IframelyArgs
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.IframelyArgs'
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.IframelyResponse'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/importer/confluence/zip.json:
    post:
      operationId: POST_v1_importer_confluence_zip.json
      tags:
        - importer
      summary: import a confluence html export to a teamwork space
      description: Request body (multipart/form-data)
      produces:
        - application/json
      responses:
        '202':
          description: 202 Accepted (no data)
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/installation.json:
    get:
      operationId: GET_v1_installation.json
      tags:
        - installation
      summary: Get the installation of the current user
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Installation'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: PATCH_v1_installation.json
      tags:
        - installation
      summary: Update the current installation
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.InstallationUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.InstallationUpdate'
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Installation'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/me.json:
    get:
      operationId: GET_v1_me.json
      tags:
        - me
      summary: Get the current users data
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Me'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
      parameters: []
    patch:
      operationId: PATCH_v1_me.json
      tags:
        - me
      summary: Update the current users preferences
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.MeUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.MeUpdate'
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Me'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/notifications.json:
    get:
      operationId: GET_v1_notifications.json
      tags:
        - notifications
      summary: Returns a list of notifications.
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.NotificationPaged'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: DELETE_v1_notifications.json
      tags:
        - notifications
      summary: Delete all read and deleted Notifications for current user.
      produces:
        - application/json
      responses:
        '204':
          description: 204 No Content (no data)
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/notifications/read.json:
    post:
      operationId: POST_v1_notifications_read.json
      tags:
        - notifications
      summary: Marks all notifications as read
      produces:
        - application/json
      responses:
        '204':
          description: 204 No Content (no data)
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/notifications/unreadcount:
    get:
      operationId: GET_v1_notifications_unreadcount
      tags:
        - notifications
      summary: Returns a number of unread notifications.
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.UnreadNotifications'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/notifications/{notificationID}':
    patch:
      operationId: 'PATCH_v1_notifications_{notificationID}'
      tags:
        - notifications
      summary: Update a Notification.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.NotificationUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.NotificationUpdate'
        - name: notificationID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.NotificationResponse'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_notifications_{notificationID}'
      tags:
        - notifications
      summary: Delete a Notification.
      produces:
        - application/json
      parameters:
        - name: notificationID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/pages/{pageID}.json':
    head:
      operationId: 'HEAD_v1_pages_{pageID}.json'
      tags:
        - pages
      summary: checks if a page is accessible by ID without spaceID. This is used for OT session auth
      produces:
        - application/json
      parameters:
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK (no data)
        '403':
          description: 403 Forbidden (no data)
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/reactions/spaces/{spaceID}/pages/{pageID}.json':
    get:
      operationId: 'GET_v1_reactions_spaces_{spaceID}_pages_{pageID}.json'
      tags:
        - reaction
      summary: 'Fetch a list of users, the counts for each reaction type and the user''s own reaction for the specified resource'
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Reactions'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    put:
      operationId: 'PUT_v1_reactions_spaces_{spaceID}_pages_{pageID}.json'
      tags:
        - reaction
      summary: Add/remove a reaction against a specified resource
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.ReactionUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.ReactionUpdate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '405':
          description: 405 Method Not Allowed
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/reactions/spaces/{spaceID}/pages/{pageID}/comments/inline/{commentID}.json':
    get:
      operationId: 'GET_v1_reactions_spaces_{spaceID}_pages_{pageID}_comments_inline_{commentID}.json'
      tags:
        - reaction
      summary: 'Fetch a list of users, the counts for each reaction type and the user''s own reaction for the specified resource'
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Reactions'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    put:
      operationId: 'PUT_v1_reactions_spaces_{spaceID}_pages_{pageID}_comments_inline_{commentID}.json'
      tags:
        - reaction
      summary: Add/remove a reaction against a specified resource
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.ReactionUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.ReactionUpdate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '405':
          description: 405 Method Not Allowed
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/reactions/spaces/{spaceID}/pages/{pageID}/comments/inline/{commentID}/reactiontypes/{reactionTypeID}.json':
    get:
      operationId: 'GET_v1_reactions_spaces_{spaceID}_pages_{pageID}_comments_inline_{commentID}_reactiontypes_{reactionTypeID}.json'
      tags:
        - reaction
      summary: 'Fetch a list of users, the counts for each reaction type and the user''s own reaction for the specified resource'
      description: and reaction type
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: reactionTypeID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.ReactionsByType'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/reactions/spaces/{spaceID}/pages/{pageID}/comments/{commentID}.json':
    get:
      operationId: 'GET_v1_reactions_spaces_{spaceID}_pages_{pageID}_comments_{commentID}.json'
      tags:
        - reaction
      summary: 'Fetch a list of users, the counts for each reaction type and the user''s own reaction for the specified resource'
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Reactions'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    put:
      operationId: 'PUT_v1_reactions_spaces_{spaceID}_pages_{pageID}_comments_{commentID}.json'
      tags:
        - reaction
      summary: Add/remove a reaction against a specified resource
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.ReactionUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.ReactionUpdate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '405':
          description: 405 Method Not Allowed
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/reactions/spaces/{spaceID}/pages/{pageID}/comments/{commentID}/reactiontypes/{reactionTypeID}.json':
    get:
      operationId: 'GET_v1_reactions_spaces_{spaceID}_pages_{pageID}_comments_{commentID}_reactiontypes_{reactionTypeID}.json'
      tags:
        - reaction
      summary: 'Fetch a list of users, the counts for each reaction type and the user''s own reaction for the specified resource'
      description: and reaction type
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: reactionTypeID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.ReactionsByType'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/reactions/spaces/{spaceID}/pages/{pageID}/plugins/{pluginID}.json':
    get:
      operationId: 'GET_v1_reactions_spaces_{spaceID}_pages_{pageID}_plugins_{pluginID}.json'
      tags:
        - reaction
      summary: 'Fetch a list of users, the counts for each reaction type and the user''s own reaction for the specified resource'
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pluginID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Reactions'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    put:
      operationId: 'PUT_v1_reactions_spaces_{spaceID}_pages_{pageID}_plugins_{pluginID}.json'
      tags:
        - reaction
      summary: Add/remove a reaction against a specified resource
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.ReactionUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.ReactionUpdate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pluginID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '405':
          description: 405 Method Not Allowed
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/reactions/spaces/{spaceID}/pages/{pageID}/plugins/{pluginID}/reactiontypes/{reactionTypeID}.json':
    get:
      operationId: 'GET_v1_reactions_spaces_{spaceID}_pages_{pageID}_plugins_{pluginID}_reactiontypes_{reactionTypeID}.json'
      tags:
        - reaction
      summary: 'Fetch a list of users, the counts for each reaction type and the user''s own reaction for the specified resource'
      description: and reaction type
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: reactionTypeID
          in: path
          type: integer
          required: true
        - name: pluginID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.ReactionsByType'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/reactions/spaces/{spaceID}/pages/{pageID}/reactiontypes/{reactionTypeID}.json':
    get:
      operationId: 'GET_v1_reactions_spaces_{spaceID}_pages_{pageID}_reactiontypes_{reactionTypeID}.json'
      tags:
        - reaction
      summary: 'Fetch a list of users, the counts for each reaction type and the user''s own reaction for the specified resource'
      description: and reaction type
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: reactionTypeID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.ReactionsByType'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/reactions/types.json:
    get:
      operationId: GET_v1_reactions_types.json
      tags:
        - reactiontypes
      summary: Get the list of enabled reaction types
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.ReactionType'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/requiredreading/next.json:
    get:
      operationId: GET_v1_requiredreading_next.json
      tags:
        - requiredReading
      summary: Returns the next required reading item for a user as part of the continuous reading feature
      description: This returns a linked page object that can be expanded by submitting an include=pages
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.ContinuousReading'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/requiredreading/spaces/{spaceID}/pages/{pageID}/audience.json':
    get:
      operationId: 'GET_v1_requiredreading_spaces_{spaceID}_pages_{pageID}_audience.json'
      tags:
        - requiredReading
      summary: List the audience of a given page
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.AudienceResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    put:
      operationId: 'PUT_v1_requiredreading_spaces_{spaceID}_pages_{pageID}_audience.json'
      tags:
        - requiredReading
      summary: Sets the required audience of a given page
      description: ko
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.AudienceRequest
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.AudienceRequest'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.AudienceResp'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/requiredreading/spaces/{spaceID}/pages/{pageID}/next.json':
    get:
      operationId: 'GET_v1_requiredreading_spaces_{spaceID}_pages_{pageID}_next.json'
      tags:
        - requiredReading
      summary: Returns the next required reading item for a user as part of the continuous reading feature
      description: This returns a linked page object that can be expanded by submitting an include=pages
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.ContinuousReading'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/requiredreading/spaces/{spaceID}/pages/{pageID}/stats.json':
    get:
      operationId: 'GET_v1_requiredreading_spaces_{spaceID}_pages_{pageID}_stats.json'
      tags:
        - requiredReading
      summary: Returns a list of users who have and haven't read a page.
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.RequiredPageUsers'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/requiredreading/spaces/{spaceID}/pages/{pageID}/status.json':
    get:
      operationId: 'GET_v1_requiredreading_spaces_{spaceID}_pages_{pageID}_status.json'
      tags:
        - requiredReading
      summary: Retrieves the current Required Reading status of a page for a user.
      description: |-
        This will include the version the user has last read (if any) and the current version
        of the page. This can assist when looking to get a diff of what has changed from
        last read.
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Read'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    put:
      operationId: 'PUT_v1_requiredreading_spaces_{spaceID}_pages_{pageID}_status.json'
      tags:
        - requiredReading
      summary: Updates the users read state of a page.
      description: Updating a users read status can either set it to read or unread.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.ReadUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.ReadUpdate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Read'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/search.json:
    get:
      operationId: GET_v1_search.json
      tags:
        - search
      summary: searches pages' title and content for text and return results
      produces:
        - application/json
      parameters:
        - name: q
          in: query
          description: The search query.
          type: string
          required: true
        - name: offset
          in: query
          type: integer
        - name: limit
          in: query
          type: integer
        - name: deleted
          in: query
          description: Specify whether or not to include deleted pages in the search.
          type: boolean
          default: 'false'
        - name: spaceid
          in: query
          description: An array of spaceIDs to search within.
          type: array
          items:
            type: integer
          default: all space ids user has access to
        - name: fields
          in: query
          description: Fields to search within.
          type: array
          items:
            type: string
          enum:
            - title
            - content
            - tags
          default: title content
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.SearchResponse'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/setup.json:
    post:
      operationId: POST_v1_setup.json
      tags:
        - setup
      summary: Sync new spaces installation with existing installation in projects
      produces:
        - application/json
      responses:
        '202':
          description: 202 Accepted (no data)
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    put:
      operationId: PUT_v1_setup.json
      tags:
        - setup
      summary: Sync existing spaces installation with existing installation in projects
      produces:
        - application/json
      responses:
        '202':
          description: 202 Accepted (no data)
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/spaces.json:
    get:
      operationId: GET_v1_spaces.json
      tags:
        - spaces
      summary: Get a list of spaces for an installation
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Spaces'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
      x-private: true
    post:
      operationId: POST_v1_spaces.json
      tags:
        - spaces
      summary: Create a space
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.SpaceCreate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.SpaceCreate'
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Space'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/spaces/categories.json:
    get:
      operationId: GET_v1_spaces_categories.json
      tags:
        - categories
      summary: get all categories
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Category'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    post:
      operationId: POST_v1_spaces_categories.json
      tags:
        - categories
      summary: create a category
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.CategoryCreate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.CategoryCreate'
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Category'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/categories/{categoryID}.json':
    get:
      operationId: 'GET_v1_spaces_categories_{categoryID}.json'
      tags:
        - categories
      summary: get a single category
      produces:
        - application/json
      parameters:
        - name: categoryID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Category'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: 'PATCH_v1_spaces_categories_{categoryID}.json'
      tags:
        - category
      summary: update a category
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.CategoryUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.CategoryUpdate'
        - name: categoryID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Category'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_categories_{categoryID}.json'
      tags:
        - category
      summary: delete a category
      produces:
        - application/json
      parameters:
        - name: categoryID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/spaces/options/styling.json:
    get:
      operationId: GET_v1_spaces_options_styling.json
      tags:
        - spaceOptions
      summary: retrieves the options for this space
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Options'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/spaces/permissions.json:
    get:
      operationId: GET_v1_spaces_permissions.json
      tags:
        - permissions
      summary: Get list of permissions for all spaces in the current installation
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.UserSpacePermission'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/spaces/pluginstates.json:
    post:
      operationId: POST_v1_spaces_pluginstates.json
      tags:
        - pluginstates
      summary: create a pluginstate
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.PluginStateCreate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.PluginStateCreate'
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.PluginState'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/pluginstates/{pluginstateID}.json':
    get:
      operationId: 'GET_v1_spaces_pluginstates_{pluginstateID}.json'
      tags:
        - pluginstates
      summary: get a single pluginstate
      produces:
        - application/json
      parameters:
        - name: pluginstateID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.PluginState'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: 'PATCH_v1_spaces_pluginstates_{pluginstateID}.json'
      tags:
        - pluginstates
      summary: update a pluginstate
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.PluginStateUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.PluginStateUpdate'
        - name: pluginstateID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.PluginState'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/spaces/templates/all.json:
    get:
      operationId: GET_v1_spaces_templates_all.json
      tags:
        - templates
      summary: get all global and local templates
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.AllTemplates'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/spaces/templates/library.json:
    get:
      operationId: GET_v1_spaces_templates_library.json
      tags:
        - globalTemplates
      summary: get all global templates
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.GlobalTemplate'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/templates/library/{global_templateID}.json':
    get:
      operationId: 'GET_v1_spaces_templates_library_{global_templateID}.json'
      tags:
        - globalTemplates
      summary: get a single global template
      produces:
        - application/json
      parameters:
        - name: global_templateID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.GlobalTemplate'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}.json'
      tags:
        - spaces
      summary: Get a single space by ID
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - in: body
          name: body
          schema:
            type: object
            properties: {}
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Space'
        '201':
          description: Created
          schema:
            type: object
            properties: {}
        '400':
          description: Bad Request
          schema:
            type: object
            properties: {}
        '401':
          description: Unauthorized
          schema:
            type: object
            properties: {}
        '403':
          description: Forbidden
          schema:
            type: object
            properties: {}
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: 'PATCH_v1_spaces_{spaceID}.json'
      tags:
        - spaces
      summary: Delete a single space by ID
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.SpaceUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.SpaceUpdate'
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Space'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}.json'
      tags:
        - spaces
      summary: Delete a single space by ID
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    head:
      operationId: 'HEAD_v1_spaces_{spaceID}.json'
      tags:
        - slug
      summary: Returns whether or not the slug is already in use
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK (no data)
        '409':
          description: 409 Conflict (no data)
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/access.json':
    post:
      operationId: 'POST_v1_spaces_{spaceID}_access.json'
      tags:
        - access
      summary: Create the requested access request
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.AccessDetail
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.AccessDetail'
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Access'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/banner':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_banner'
      tags:
        - spaceBanner
      summary: Get the banner image for a space
      description: Response 200 (attachmentType)
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    put:
      operationId: 'PUT_v1_spaces_{spaceID}_banner'
      tags:
        - spaceBanner
      summary: Update the banner image for a space
      description: |-
        URL banner image url spaces/api/v1/spaces/{{spaceID}}/pages/{{pageID}}/banner?{{guid}}

        Request body (multipart/form-data)
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.BannerUpdateResponse'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_banner'
      tags:
        - spaceBanner
      summary: Remove the banner image for a space
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/collaborators.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_collaborators.json'
      tags:
        - spaces
      summary: Get a single space by ID
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.SpaceCollaborator'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/export/{exportFormat}.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_export_{exportFormat}.json'
      tags:
        - export
      summary: Export a space to a specified format
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: exportFormat
          in: path
          type: integer
          required: true
      responses:
        '202':
          description: 202 Accepted (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    head:
      operationId: 'HEAD_v1_spaces_{spaceID}_export_{exportFormat}.json'
      tags:
        - export
      summary: Check if an export is in progress
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: exportFormat
          in: path
          type: integer
          required: true
      responses:
        '202':
          description: 202 Accepted (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/export/{exportFormat}/latest.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_export_{exportFormat}_latest.json'
      tags:
        - export
      summary: Return a previous export if one exists
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: exportFormat
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/follow.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_follow.json'
      tags:
        - following
      summary: Get following level for for this resource.
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Follow'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: 'PATCH_v1_spaces_{spaceID}_follow.json'
      tags:
        - following
      summary: Create or update a following level for this resource
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.Follow
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.Follow'
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Follow'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_follow.json'
      tags:
        - following
      summary: Unfollowing this resource
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/homepage.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_homepage.json'
      tags:
        - pages
      summary: Returns the homepage for the given spaceID
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Page'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/owner.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_owner.json'
      tags:
        - spaceOwner
      summary: Get the owner of the given space
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.SpaceOwner'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages.json'
      tags:
        - spaceContent
      summary: Get all pages under the given space
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.SpaceContents'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    post:
      operationId: 'POST_v1_spaces_{spaceID}_pages.json'
      tags:
        - pages
      summary: Creates a new page
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.PageCreate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.PageCreate'
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Page'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}.json'
      tags:
        - pages
      summary: Returns a single page by pageID
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Page'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: 'PATCH_v1_spaces_{spaceID}_pages_{pageID}.json'
      tags:
        - pages
      summary: Update an existing page
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.PageUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.PageUpdate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Page'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_pages_{pageID}.json'
      tags:
        - pages
      summary: Delete an existing page
      description: Delete an existing page from site. This will bypass the trash can. If you want to move a spaces page to the trash can, please use the [places a page object into trash via state change](/docs/spaces/v1/trash/post-v1-spaces-space-id-trash-page-id-json) endpoint
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/attachments/inline.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}_attachments_inline.json'
      tags:
        - attachments
      summary: list the attachments for the specified page
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Attachment'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    post:
      operationId: 'POST_v1_spaces_{spaceID}_pages_{pageID}_attachments_inline.json'
      tags:
        - attachments
      summary: uploads the attached image to the server
      description: 'Request body (multipart/form-data):'
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Attachment'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/attachments/inline/{attachmentID}.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}_attachments_inline_{attachmentID}.json'
      tags:
        - attachments
      summary: retrieves the specified attachment
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: attachmentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Attachment'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_pages_{pageID}_attachments_inline_{attachmentID}.json'
      tags:
        - attachments
      summary: deletes the specified attachment
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: attachmentID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/attachments/inline/{attachmentID}/view':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}_attachments_inline_{attachmentID}_view'
      tags:
        - attachments
      summary: retrieves the specified attachment
      produces:
        - application/json
        - attachmentType
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: attachmentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK (attachmentType data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/attachments/{attachmentID}':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}_attachments_{attachmentID}'
      tags:
        - attachments
      summary: retrieves the specified attachment
      produces:
        - application/json
        - attachmentType
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: attachmentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK (attachmentType data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/banner':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}_banner'
      tags:
        - pageBanner
      summary: Get the banner image for a page
      description: Response 200 (attachmentType)
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    put:
      operationId: 'PUT_v1_spaces_{spaceID}_pages_{pageID}_banner'
      tags:
        - pageBanner
      summary: Update the banner image for a page
      description: |-
        URL banner image url spaces/api/v1/spaces/{{spaceID}}/pages/{{pageID}}/banner?{{guid}}

        Request body (multipart/form-data)
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.BannerUpdateResponse'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_pages_{pageID}_banner'
      tags:
        - pageBanner
      summary: Remove the banner image for a page
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/comment/{commentID}/follow.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}_comment_{commentID}_follow.json'
      tags:
        - following
      summary: Get following level for for this resource.
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Follow'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: 'PATCH_v1_spaces_{spaceID}_pages_{pageID}_comment_{commentID}_follow.json'
      tags:
        - following
      summary: Create or update a following level for this resource
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.Follow
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.Follow'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Follow'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_pages_{pageID}_comment_{commentID}_follow.json'
      tags:
        - following
      summary: Unfollowing this resource
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/comments.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}_comments.json'
      tags:
        - comments
      summary: get all comments for a page
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.CommentParent'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    post:
      operationId: 'POST_v1_spaces_{spaceID}_pages_{pageID}_comments.json'
      tags:
        - comments
      summary: create a comment
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.CommentCreate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.CommentCreate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Comment'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/comments/inline.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}_comments_inline.json'
      tags:
        - inlineComments
      summary: get all comments for a page
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.CommentParent'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    post:
      operationId: 'POST_v1_spaces_{spaceID}_pages_{pageID}_comments_inline.json'
      tags:
        - inlineComments
      summary: create a comment
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.CommentCreate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.CommentCreate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Comment'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/comments/inline/{commentID}.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}_comments_inline_{commentID}.json'
      tags:
        - inlineComments
      summary: get a single comment
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Comment'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: 'PATCH_v1_spaces_{spaceID}_pages_{pageID}_comments_inline_{commentID}.json'
      tags:
        - inlineComments
      summary: update a comment
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.CommentUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.CommentUpdate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Comment'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_pages_{pageID}_comments_inline_{commentID}.json'
      tags:
        - inlineComments
      summary: delete a comment
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/comments/{commentID}.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}_comments_{commentID}.json'
      tags:
        - comments
      summary: get a single comment
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Comment'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: 'PATCH_v1_spaces_{spaceID}_pages_{pageID}_comments_{commentID}.json'
      tags:
        - comments
      summary: update a comment
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.CommentUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.CommentUpdate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Comment'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_pages_{pageID}_comments_{commentID}.json'
      tags:
        - comments
      summary: delete a comment
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: commentID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/content/{versionID}.json':
    put:
      operationId: 'PUT_v1_spaces_{spaceID}_pages_{pageID}_content_{versionID}.json'
      tags:
        - pages
      summary: Updates the page content to add inline comments on a specific OT version
      produces:
        - application/json
      parameters:
        - name: versionID
          in: path
          type: integer
          required: true
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/duplicate.json':
    post:
      operationId: 'POST_v1_spaces_{spaceID}_pages_{pageID}_duplicate.json'
      tags:
        - pages
      summary: Duplicates the page
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.PageDuplicate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.PageDuplicate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Page'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/follow.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}_follow.json'
      tags:
        - following
      summary: Get following level for for this resource.
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Follow'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: 'PATCH_v1_spaces_{spaceID}_pages_{pageID}_follow.json'
      tags:
        - following
      summary: Create or update a following level for this resource
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.Follow
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.Follow'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Follow'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_pages_{pageID}_follow.json'
      tags:
        - following
      summary: Unfollowing this resource
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/permissions.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}_permissions.json'
      tags:
        - pagepermissions
      summary: get all pagepermissions
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.PagePermission'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    post:
      operationId: 'POST_v1_spaces_{spaceID}_pages_{pageID}_permissions.json'
      tags:
        - pagepermissions
      summary: create one or many pagepermission entries for a page. This will return a list
      description: of permissions that have been added with ID.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.PagePermissionCreate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.PagePermissionCreate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.PagePermission'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_pages_{pageID}_permissions.json'
      tags:
        - pagepermissions
      description: |-
        422 returned if attempting to delete permissions from a non private page
        400 returned if attempting to delete permissions from a child of a private page
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '422':
          description: 422 Unprocessable Entity
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/permissions/{pagepermissionID}.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}_permissions_{pagepermissionID}.json'
      tags:
        - pagepermissions
      summary: get a single pagepermission by id
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pagepermissionID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.PagePermission'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_pages_{pageID}_permissions_{pagepermissionID}.json'
      tags:
        - pagepermissions
      summary: delete a pagepermission for a page. This will also delete
      description: |-
        the equivalent permission from all sub pages

        422 returned if attempting to delete permissions from a non private page
        400 returned if attempting to delete permissions from a child of a private page
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pagepermissionID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '422':
          description: 422 Unprocessable Entity
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/shares.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_pages_{pageID}_shares.json'
      tags:
        - pageshare
      summary: 'get sharing information for a page, this will show if the share is'
      description: enabled or not and also the list of scopes relevant to the page
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.PublicShare'
        '403':
          description: 403 Forbidden
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: 'PATCH_v1_spaces_{spaceID}_pages_{pageID}_shares.json'
      tags:
        - pageshare
      summary: update a page sharing state to enabled or disable public sharing
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.PublicShareUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.PublicShareUpdate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.PublicShare'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/shares/scopes.json':
    post:
      operationId: 'POST_v1_spaces_{spaceID}_pages_{pageID}_shares_scopes.json'
      tags:
        - pageshare
      summary: add one or many sharing scopes to a page
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.ScopeCreate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.ScopeCreate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '201':
          description: 201 Created
          schema:
            $ref: '#/definitions/spaces-api.Scope'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/shares/scopes/{scopeID}.json':
    patch:
      operationId: 'PATCH_v1_spaces_{spaceID}_pages_{pageID}_shares_scopes_{scopeID}.json'
      tags:
        - pageshare
      summary: update the properties of a scope.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.ScopeUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.ScopeUpdate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: scopeID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '201':
          description: 201 Created
          schema:
            $ref: '#/definitions/spaces-api.Scope'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_pages_{pageID}_shares_scopes_{scopeID}.json'
      tags:
        - pageshare
      summary: delete a sharing scope for a page
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: scopeID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/pages/{pageID}/star.json':
    put:
      operationId: 'PUT_v1_spaces_{spaceID}_pages_{pageID}_star.json'
      tags:
        - favorites
      summary: Marks a resource as favorite
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Favorite'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_pages_{pageID}_star.json'
      tags:
        - favorites
      summary: Unfavorite a resource for a user
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/permission.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_permission.json'
      tags:
        - permissions
      summary: Get a list of permissions for the requested space
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.UserPermission'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/permissions.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_permissions.json'
      tags:
        - permissions
      summary: Get list of permissions for the requested space
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Permission'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    post:
      operationId: 'POST_v1_spaces_{spaceID}_permissions.json'
      tags:
        - permissions
      summary: Create a permission for the given space
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.PermissionCreateItem
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.PermissionCreateItem'
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Permission'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/permissions/{permissionID}.json':
    patch:
      operationId: 'PATCH_v1_spaces_{spaceID}_permissions_{permissionID}.json'
      tags:
        - permissions
      summary: Update an existing permission
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.PermissionUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.PermissionUpdate'
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: permissionID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Permission'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_permissions_{permissionID}.json'
      tags:
        - permissions
      summary: Delete an existing permission
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: permissionID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/star.json':
    put:
      operationId: 'PUT_v1_spaces_{spaceID}_star.json'
      tags:
        - favorites
      summary: Marks a resource as favorite
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Favorite'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_star.json'
      tags:
        - favorites
      summary: Unfavorite a resource for a user
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/trash.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}_trash.json'
      tags:
        - trash
      summary: gets a list of all trashed pages in a space
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.SpacePages'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_trash.json'
      tags:
        - trash
      summary: deletes all trashed pages within a Space
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}/trash/{pageID}.json':
    post:
      operationId: 'POST_v1_spaces_{spaceID}_trash_{pageID}.json'
      tags:
        - trash
      summary: places a page object into trash via state change
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '201':
          description: 201 Created
          schema:
            $ref: '#/definitions/spaces-api.SpacePages'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    put:
      operationId: 'PUT_v1_spaces_{spaceID}_trash_{pageID}.json'
      tags:
        - trash
      summary: restores a trashed page via a state change
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.SpacePages'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_spaces_{spaceID}_trash_{pageID}.json'
      tags:
        - trash
      summary: permanently deletes a trashed page
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceID}}/pages/{pageID}/collaborators.json':
    get:
      operationId: 'GET_v1_spaces_{spaceID}}_pages_{pageID}_collaborators.json'
      tags:
        - collaborators
      summary: Retrieve all collaborators for a single page
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Collaborator'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/spaces/{spaceId}/activity.json':
    get:
      operationId: 'GET_v1_spaces_{spaceId}_activity.json'
      tags:
        - activity
      summary: Get activities for this space.
      description: Retrieves a paged result set of activities.
      produces:
        - application/json
      parameters:
        - name: spaceId
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.ActivityPaged'
  /v1/starred.json:
    get:
      operationId: GET_v1_starred.json
      tags:
        - favorites
      summary: List the favourites of the current user
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Favorite'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/stats.json:
    get:
      operationId: GET_v1_stats.json
      tags:
        - stats
      summary: Get the stats for an installation
      description: Retrieves the specified stats from the data store
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Stats'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/subscription.json:
    get:
      operationId: GET_v1_subscription.json
      tags:
        - subscription
      summary: Get the users subscription
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Subscription'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/subscription/trial.json:
    get:
      operationId: GET_v1_subscription_trial.json
      tags:
        - subscription
      summary: Get the users trial subscription information
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.SubscriptionTrial'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/tags.json:
    get:
      operationId: GET_v1_tags.json
      tags:
        - tags
      summary: get all tags by Installation ID
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Tag'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/tags/{tagID}.json':
    get:
      operationId: 'GET_v1_tags_{tagID}.json'
      tags:
        - tags
      summary: get a single tag by ID
      produces:
        - application/json
      parameters:
        - name: tagID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Tag'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    post:
      operationId: 'POST_v1_tags_{tagID}.json'
      tags:
        - tags
      summary: create one or many tag/s for an installation. This will return a list
      description: of tags that have been added with ID.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.Tag
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.Tag'
        - name: tagID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Tag'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: 'PATCH_v1_tags_{tagID}.json'
      tags:
        - tags
      summary: update a single tag by ID
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.TagUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.TagUpdate'
        - name: tagID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Tag'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_tags_{tagID}.json'
      tags:
        - tags
      summary: delete a tag for an installation.
      produces:
        - application/json
      parameters:
        - name: tagID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/templates/local.json:
    get:
      operationId: GET_v1_templates_local.json
      tags:
        - templates
      summary: get all local/custom templates
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Template'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    post:
      operationId: POST_v1_templates_local.json
      tags:
        - templates
      summary: create a local/custom template
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.TemplateCreate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.TemplateCreate'
      responses:
        '201':
          description: 201 Created
          schema:
            $ref: '#/definitions/spaces-api.Template'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/templates/local/{templateID}.json':
    get:
      operationId: 'GET_v1_templates_local_{templateID}.json'
      tags:
        - templates
      summary: get a single local/custom template
      produces:
        - application/json
      parameters:
        - name: templateID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Template'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: 'PATCH_v1_templates_local_{templateID}.json'
      tags:
        - templates
      summary: update a local/custom template
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.TemplateUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.TemplateUpdate'
        - name: templateID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Template'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_templates_local_{templateID}.json'
      tags:
        - templates
      summary: delete a local/custom template
      produces:
        - application/json
      parameters:
        - name: templateID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/templates/metrics.json:
    post:
      operationId: POST_v1_templates_metrics.json
      tags:
        - globalTemplates
      summary: create a template metric recording when a global template has been used to create a page.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.GlobalTemplateMetrics
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.GlobalTemplateMetrics'
      responses:
        '201':
          description: 201 Created
          schema:
            $ref: '#/definitions/spaces-api.GlobalTemplateMetric'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/users.json:
    get:
      operationId: GET_v1_users.json
      tags:
        - users
      summary: Get all spaces users.
      description: Retrieves the space users from the entire installation.
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.User'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: PATCH_v1_users.json
      tags:
        - users
      summary: Update a batch of users.
      description: Updates a batch users stored in the Spaces data store.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.UserUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.UserUpdate'
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.User'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/users/bulk/invite.json:
    post:
      operationId: POST_v1_users_bulk_invite.json
      tags:
        - invites
      summary: Performs a soft user registration and emails an invite to each user email listed.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.InviteUser
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.InviteUser'
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.InviteResponse'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/users/invite.json:
    post:
      operationId: POST_v1_users_invite.json
      tags:
        - invites
      summary: Performs a user registration and emails an invite to the user.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.InviteUser
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.InviteUser'
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.InvitedUser'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/users/{userID}.json':
    get:
      operationId: 'GET_v1_users_{userID}.json'
      tags:
        - users
      summary: Get the single specified user
      description: Retrieves the specified user from the spaces data store
      produces:
        - application/json
      parameters:
        - name: userID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.User'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    put:
      operationId: 'PUT_v1_users_{userID}.json'
      tags:
        - users
      description: Updates a user stored in the central store
      produces:
        - application/json
      parameters:
        - name: userID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.User'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    patch:
      operationId: 'PATCH_v1_users_{userID}.json'
      tags:
        - users
      summary: Update a local spaces user.
      description: Updates a user stored in the Spaces data store.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.UserUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.UserUpdate'
        - name: userID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.User'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v1_users_{userID}.json'
      tags:
        - users
      description: Delete a user from central store.
      produces:
        - application/json
      parameters:
        - name: userID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.User'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/users/{userID}/avatar.json':
    put:
      operationId: 'PUT_v1_users_{userID}}_avatar.json'
      tags:
        - users
      description: Upload an image to the users profile to add or replace their avatar.
      produces:
        - application/json
      parameters:
        - name: userID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.User'
        '403':
          description: 403 Forbidden
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/webhook-events.json:
    get:
      operationId: GET_v1_webhook-events.json
      tags:
        - webhook-events
      summary: Get a list of all Spaces' webhook events
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.WebhookEvent'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/webhook-requests.json:
    get:
      operationId: GET_v1_webhook-requests.json
      tags:
        - webhook-requests
      summary: Gets a list of webhook requests
      description: Returns all webhooks requests along with their request body and headers
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.WebhookRequests'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/webhook-requests/{webhookRequest}.json':
    get:
      operationId: 'GET_v1_webhook-requests_{webhookRequest}.json'
      tags:
        - webhook-requests
      summary: Fetches & returns a single webhook-request by its ID.
      description: Returns a webhook request response
      produces:
        - application/json
      parameters:
        - name: webhookRequest
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.WebhookRequestResponse'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/webhook/{webhookID}.json':
    delete:
      operationId: 'DELETE_v1_webhook_{webhookID}.json'
      tags:
        - webhooks
      summary: Soft deletes an existing Webhook by the specified id
      produces:
        - application/json
      parameters:
        - name: webhookID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  /v1/webhooks.json:
    get:
      operationId: GET_v1_webhooks.json
      tags:
        - webhooks
      summary: Gets a list of webhooks
      description: Returns a webhooks list response
      produces:
        - application/json
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Webhook'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    post:
      operationId: POST_v1_webhooks.json
      tags:
        - webhooks
      summary: 'Creates a webhook from a user-defined URL, token and chosen events to track.'
      description: Returns a webhook response
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.WebhookCreate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.WebhookCreate'
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Webhook'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/webhooks/{webhookID}.json':
    get:
      operationId: 'GET_v1_webhooks_{webhookID}.json'
      tags:
        - webhooks
      summary: Fetches & returns a single webhook by its ID.
      description: Returns a webhook response
      produces:
        - application/json
      parameters:
        - name: webhookID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Webhook'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    put:
      operationId: 'PUT_v1_webhooks_{webhookID}.json'
      tags:
        - webhooks
      summary: Updates a webhook from a user-defined event.
      description: Returns a webhook response
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: spaces-api.WebhookUpdate
          in: body
          required: true
          schema:
            $ref: '#/definitions/spaces-api.WebhookUpdate'
        - name: webhookID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Webhook'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v1/webhooks/{webhook}/requests.json':
    get:
      operationId: 'GET_v1_webhooks_{webhook}_requests.json'
      tags:
        - webhook-requests
      summary: Gets a list of webhook requests for a single webhook
      description: Returns a webhooks requests along with the request body and headers
      produces:
        - application/json
      parameters:
        - name: webhook
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.WebhookRequests'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v2/spaces/{spaceID}/pages.json':
    get:
      operationId: 'GET_v2_spaces_{spaceID}_pages.json'
      tags:
        - spaceContent
      summary: Returns all pages the user has access to in a Space as
      description: |-
        a nested tree.
        The tree contains two main nodes, pages, which contains
        open pages with no privacy set as well as private, which contains
        pages that the user can access, but are restricted to other users.
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.SpaceContents'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v2/spaces/{spaceID}/pages/{pageID}/attachments.json':
    get:
      operationId: 'GET_v2_spaces_{spaceID}_pages_{pageID}_attachments.json'
      tags:
        - attachments
      summary: list the attachments for the specified page
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Attachment'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    post:
      operationId: 'POST_v2_spaces_{spaceID}_pages_{pageID}_attachments.json'
      tags:
        - attachments
      summary: uploads the attached image to the server
      description: 'Request body (multipart/form-data):'
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Attachment'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v2/spaces/{spaceID}/pages/{pageID}/attachments/{attachmentID}.json':
    get:
      operationId: 'GET_v2_spaces_{spaceID}_pages_{pageID}_attachments_{attachmentID}.json'
      tags:
        - attachments
      summary: retrieves the specified attachment
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: attachmentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.Attachment'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
    delete:
      operationId: 'DELETE_v2_spaces_{spaceID}_pages_{pageID}_attachments_{attachmentID}.json'
      tags:
        - attachments
      summary: deletes the specified attachment
      produces:
        - application/json
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: attachmentID
          in: path
          type: integer
          required: true
      responses:
        '204':
          description: 204 No Content (no data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/v2/spaces/{spaceID}/pages/{pageID}/attachments/{attachmentID}/view':
    get:
      operationId: 'GET_v2_spaces_{spaceID}_pages_{pageID}_attachments_{attachmentID}_view'
      tags:
        - attachments
      summary: retrieves the specified attachment
      produces:
        - application/json
        - attachmentType
      parameters:
        - name: spaceID
          in: path
          type: integer
          required: true
        - name: pageID
          in: path
          type: integer
          required: true
        - name: attachmentID
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK (attachmentType data)
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
        '500':
          description: 500 Internal Server Error
          schema:
            $ref: '#/definitions/api.errResp'
  '/webhook-requests/{webhookRequest}/resend.json':
    post:
      operationId: 'POST_webhook-requests_{webhookRequest}_resend.json'
      tags:
        - webhook-requests
      summary: Resends a webhook-request
      description: Returns the new webhook request body.
      produces:
        - application/json
      parameters:
        - name: webhookRequest
          in: path
          type: integer
          required: true
      responses:
        '200':
          description: 200 OK
          schema:
            $ref: '#/definitions/spaces-api.WebhookRequestResponse'
        '400':
          description: 400 Bad Request
          schema:
            $ref: '#/definitions/api.errResp'
        '404':
          description: 404 Not Found
          schema:
            $ref: '#/definitions/api.errResp'
definitions:
  api.OrderByFilter:
    title: OrderByFilter
    description: |-
      OrderByFilter will allow support for ordering a response
      by one or more fields, in ascending or descending order.
      This could be sorting spaces by title in reserver order:
      orderBy=title&orderMode=desc.

      Ordering my multiple columns is supported too, via comma
      seperation: orderBy=title,id&orderMode=desc
    type: object
    properties:
      Fields:
        type: array
        items:
          type: string
      Mode:
        type: string
  api.PagingFilter:
    title: PagingFilter
    description: PagingFilter represents paging query parameters.
    type: object
  api.Params:
    title: Params
    description: |-
      Params is the holder for all param objects and can be passed through the api if all params
      are required for an endpoint.
    type: object
    properties:
      Filtering:
        type: object
      Ordering:
        $ref: '#/definitions/api.OrderByFilter'
      Paging:
        $ref: '#/definitions/api.PagingFilter'
  api.errResp:
    title: errResp
    type: object
    properties:
      Code:
        type: integer
      Detail:
        type: string
      ID:
        type: string
      Title:
        type: string
  decimal.Decimal:
    title: Decimal
    description: |-
      Decimal represents a fixed-point decimal. It is immutable.
      number = value * 10 ^ exp
    type: object
  http.LegacyRead:
    title: LegacyRead
    type: object
    properties:
      reading:
        title: LegacyRead
        type: object
        properties:
          revision:
            type: integer
          state:
            type: string
  http.enabledResp:
    title: enabledResp
    type: object
    properties:
      enabled:
        title: enabledResp
        type: object
        properties:
          state:
            type: string
  spaces-api.Access:
    title: Access
    type: object
    properties:
      access:
        title: Access
        description: Access contains the user submitted request details and the context of the request
        type: object
        properties:
          LinkedInstallation:
            $ref: '#/definitions/spaces-api.LinkedInstallation'
          access:
            title: AccessDetail
            description: AccessDetail is an individual permission access Request
            type: object
            properties:
              details:
                description: Details is string containing the request justification
                type: string
              id:
                description: ID is the unique identifier for an access request
                type: integer
              level:
                description: Level
                type: string
                enum:
                  - read
                  - edit
                  - manage
              state:
                description: State
                type: string
                enum:
                  - active
                  - deleted
                  - granted
                  - denied
          createdAt:
            type: string
            format: date-time
          createdBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          deletedAt:
            type: string
            format: date-time
          deletedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          space:
            $ref: '#/definitions/spaces-api.LinkedSpace'
          updatedAt:
            type: string
            format: date-time
          updatedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.AccessDetail:
    title: AccessDetail
    type: object
    properties:
      access:
        title: AccessDetail
        description: AccessDetail is an individual permission access Request
        type: object
        properties:
          details:
            description: Details is string containing the request justification
            type: string
          id:
            description: ID is the unique identifier for an access request
            type: integer
          level:
            description: Level
            type: string
            enum:
              - read
              - edit
              - manage
          state:
            description: State
            type: string
            enum:
              - active
              - deleted
              - granted
              - denied
  spaces-api.Activity:
    title: Activity
    description: Activity represents a single space activity e.g. page updated
    type: object
    properties:
      changedBy:
        $ref: '#/definitions/spaces-api.LinkedUser'
      date:
        type: string
        format: date-time
      description:
        type: string
      objectDeleted:
        type: boolean
      objectID:
        type: integer
      objectTitle:
        type: string
      objectType:
        type: string
      operation:
        type: string
      url:
        type: string
      version:
        type: integer
  spaces-api.ActivityPaged:
    title: ActivityPaged
    type: object
    properties:
      activity:
        title: ActivityPaged
        description: |-
          ActivityPaged is a wrapper containing the paging information as well
          as the list of activities.
        type: object
        properties:
          Activities:
            type: array
            items:
              $ref: '#/definitions/spaces-api.Activity'
          count:
            type: integer
          pageOffset:
            type: integer
          pageSize:
            type: integer
  spaces-api.AllTemplates:
    title: AllTemplates
    type: object
    properties:
      global_templates:
        type: array
        items:
          title: AllTemplates
          description: AllTemplates is a list of all global and installations templates
          type: object
          properties:
            Global:
              $ref: '#/definitions/spaces-api.GlobalTemplates'
            Installation:
              $ref: '#/definitions/spaces-api.Templates'
  spaces-api.ApplicationRoles:
    title: ApplicationRoles
    description: ApplicationRoles contains the admin levels.
    type: object
    properties:
      IsAdmin:
        type: boolean
      IsExternal:
        type: boolean
      Level:
        type: string
      State:
        type: string
  spaces-api.Attachment:
    title: Attachment
    type: object
    properties:
      attachments:
        type: array
        items:
          title: Attachment
          description: Attachment is any user uploaded file
          type: object
          properties:
            LinkedInstallation:
              $ref: '#/definitions/spaces-api.LinkedInstallation'
            createdAt:
              type: string
              format: date-time
            createdBy:
              $ref: '#/definitions/spaces-api.LinkedUser'
            deletedAt:
              type: string
              format: date-time
            deletedBy:
              $ref: '#/definitions/spaces-api.LinkedUser'
            fileName:
              type: string
            id:
              type: integer
            mimeType:
              type: string
            objectType:
              type: string
            page:
              $ref: '#/definitions/spaces-api.LinkedPage'
            size:
              type: integer
            space:
              $ref: '#/definitions/spaces-api.LinkedSpace'
            state:
              type: string
            updatedAt:
              type: string
              format: date-time
            updatedBy:
              $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.AttachmentCopy:
    title: AttachmentCopy
    type: object
    properties:
      attachment:
        title: AttachmentCopy
        description: AttachmentCopy for making a copy of an existing attachment
        type: object
        properties:
          pageId:
            description: PageID is the new Page which the copy will be associated with.
            type: integer
          spaceId:
            description: SpaceID is the new Space which the copy will be associated with.
            type: integer
  spaces-api.Audience:
    title: Audience
    description: Audience represents an audience of a required reading page
    type: object
    properties:
      all:
        type: boolean
      companies:
        type: array
        items:
          type: integer
      individuals:
        type: array
        items:
          type: integer
  spaces-api.AudienceList:
    title: AudienceList
    description: AudienceList represents all users with access to a page that can be assigned the page as required reading
    type: object
    properties:
      all:
        type: boolean
      companies:
        description: AudCompanies because companies is the implemented interface func for including companies
        type: array
        items:
          $ref: '#/definitions/spaces-api.RequiredCompany'
  spaces-api.AudienceRequest:
    title: AudienceRequest
    type: object
    properties:
      requiredReading:
        title: AudienceRequest
        description: AudienceRequest represents a request to assign an audience for a page
        type: object
        properties:
          audience:
            $ref: '#/definitions/spaces-api.Audience'
  spaces-api.AudienceResp:
    title: AudienceResp
    type: object
    properties:
      requiredReading:
        title: AudienceResp
        description: AudienceResp represents the response to an audience request
        type: object
        properties:
          audience:
            $ref: '#/definitions/spaces-api.AudienceList'
  spaces-api.AuthToken:
    title: AuthToken
    description: AuthToken is used to allow a user to authenticate with the socket server.
    type: object
    properties:
      installationId:
        type: integer
      key:
        type: string
      timestamp:
        type: string
      userId:
        type: integer
  spaces-api.Banner:
    title: Banner
    description: Banner struct is used to represent the banner fields returned in the page response
    type: object
    properties:
      url:
        type: string
      x:
        type: number
      'y':
        type: number
  spaces-api.BannerUpdate:
    title: BannerUpdate
    description: BannerUpdate model for updating individual fields of a banner
    type: object
    properties:
      url:
        type: string
      x:
        type: number
      'y':
        type: number
  spaces-api.BannerUpdateResponse:
    title: BannerUpdateResponse
    type: object
    properties:
      pageBanner:
        title: BannerUpdateResponse
        description: BannerUpdateResponse struct is used to represent the response when replacing the banner for a page
        type: object
        properties:
          url:
            type: string
  spaces-api.Category:
    title: Category
    type: object
    properties:
      category:
        title: Category
        description: Category is a single struct for a category that has been created by a user.
        type: object
        properties:
          color:
            description: Color is the color assigned to the category
            type: string
          createdAt:
            type: string
            format: date-time
          createdBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          deletedAt:
            type: string
            format: date-time
          deletedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          id:
            description: ID is a unique identifier for a Category.
            type: integer
          meta:
            $ref: '#/definitions/spaces-api.CategoryMeta'
          name:
            description: Name is the given name for a Category.
            type: string
          updatedAt:
            type: string
            format: date-time
          updatedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.CategoryCreate:
    title: CategoryCreate
    type: object
    properties:
      category:
        title: CategoryCreate
        description: CategoryCreate adds a new Category to the data store.
        type: object
        properties:
          color:
            description: Color is the color to be displayed with the category.
            type: string
          name:
            description: Name is the name of the category for the Space.
            type: string
  spaces-api.CategoryMeta:
    title: CategoryMeta
    description: CategoryMeta contains metrics relating to the page.
    type: object
    properties:
      spaceCount:
        type: integer
  spaces-api.CategoryUpdate:
    title: CategoryUpdate
    type: object
    properties:
      category:
        title: CategoryUpdate
        description: |-
          CategoryUpdate is used for partial updates to a Category record.
          As many or few fields can be supplied and only those supplied will be updated in the store.
        type: object
        properties:
          color:
            description: Color is the color to be displayed with the category.
            type: string
          name:
            description: Name is the name of the category for the Space.
            type: string
  spaces-api.Collaborator:
    title: Collaborator
    type: object
    properties:
      collaborators:
        type: array
        items:
          title: Collaborator
          description: Collaborator represents a contributor to a page
          type: object
          properties:
            collaborator:
              $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.Color:
    title: Color
    description: Color represents the color choosen for a Space
    type: object
    properties:
      spaceColor:
        type: string
  spaces-api.Comment:
    title: Comment
    type: object
    properties:
      comment:
        title: Comment
        description: Comment is a single comment without replies.
        type: object
        properties:
          content:
            type: string
          createdAt:
            type: string
            format: date-time
          createdBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          deletedAt:
            type: string
            format: date-time
          deletedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          id:
            type: integer
          identifier:
            type: string
          isPrivate:
            type: boolean
          page:
            $ref: '#/definitions/spaces-api.LinkedPage'
          parentId:
            type: integer
          reactions:
            $ref: '#/definitions/spaces-api.ReactionsMeta'
          selection:
            type: string
          space:
            $ref: '#/definitions/spaces-api.LinkedSpace'
          state:
            type: string
          updatedAt:
            type: string
            format: date-time
          updatedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.CommentCreate:
    title: CommentCreate
    type: object
    properties:
      comment:
        title: CommentCreate
        description: CommentCreate is an object to use when creating a new comment.
        type: object
        properties:
          InstallationID:
            type: integer
          IsPrivate:
            type: boolean
          PageID:
            type: integer
          QueryParams:
            $ref: '#/definitions/api.Params'
          Roles:
            $ref: '#/definitions/spaces-api.ApplicationRoles'
          SpaceID:
            type: integer
          Type:
            type: string
          UserID:
            type: integer
          content:
            type: string
          emailAddress:
            type: string
          identifier:
            type: string
          isPrivate:
            type: boolean
          name:
            type: string
          parentID:
            type: integer
          selection:
            type: string
  spaces-api.CommentParent:
    title: CommentParent
    type: object
    properties:
      comments:
        type: array
        items:
          title: CommentParent
          description: CommentParent is a parent comment which replies can be added to.
          type: object
          properties:
            comment:
              title: Comment
              description: Comment is a single comment without replies.
              type: object
              properties:
                content:
                  type: string
                createdAt:
                  type: string
                  format: date-time
                createdBy:
                  $ref: '#/definitions/spaces-api.LinkedUser'
                deletedAt:
                  type: string
                  format: date-time
                deletedBy:
                  $ref: '#/definitions/spaces-api.LinkedUser'
                id:
                  type: integer
                identifier:
                  type: string
                isPrivate:
                  type: boolean
                page:
                  $ref: '#/definitions/spaces-api.LinkedPage'
                parentId:
                  type: integer
                reactions:
                  $ref: '#/definitions/spaces-api.ReactionsMeta'
                selection:
                  type: string
                space:
                  $ref: '#/definitions/spaces-api.LinkedSpace'
                state:
                  type: string
                updatedAt:
                  type: string
                  format: date-time
                updatedBy:
                  $ref: '#/definitions/spaces-api.LinkedUser'
            replies:
              type: array
              items:
                $ref: '#/definitions/spaces-api.Comment'
  spaces-api.CommentUpdate:
    title: CommentUpdate
    type: object
    properties:
      comment:
        title: CommentUpdate
        description: CommentUpdate is an object to use when updating an existing comment.
        type: object
        properties:
          InstallationID:
            type: integer
          IsPrivate:
            type: boolean
          PageID:
            type: integer
          QueryParams:
            $ref: '#/definitions/api.Params'
          Roles:
            $ref: '#/definitions/spaces-api.ApplicationRoles'
          SpaceID:
            type: integer
          Type:
            type: string
          UserID:
            type: integer
          commentId:
            type: integer
          content:
            type: string
          isPrivate:
            type: boolean
          state:
            type: string
  spaces-api.Company:
    title: Company
    type: object
    properties:
      companies:
        type: array
        items:
          title: Company
          description: Company is the company that a user belongs to.
          type: object
          properties:
            LinkedInstallation:
              $ref: '#/definitions/spaces-api.LinkedInstallation'
            createdAt:
              type: string
              format: date-time
            createdBy:
              $ref: '#/definitions/spaces-api.LinkedUser'
            deletedAt:
              type: string
              format: date-time
            deletedBy:
              $ref: '#/definitions/spaces-api.LinkedUser'
            id:
              type: integer
            logo:
              type: string
            name:
              type: string
            updatedAt:
              type: string
              format: date-time
            updatedBy:
              $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.ContinuousReading:
    title: ContinuousReading
    type: object
    properties:
      requiredReading:
        title: ContinuousReading
        description: |-
          ContinuousReading is a page that a user is yet to read.
          This is used when the next endpoint is called and will return the next
          item in a users required reading list.
        type: object
        properties:
          next:
            $ref: '#/definitions/spaces-api.LinkedPage'
  spaces-api.Favorite:
    title: Favorite
    type: object
    properties:
      favorites:
        type: array
        items:
          title: Favorite
          description: Favorite struct used to return the favorite status of a resource
          type: object
          properties:
            id:
              type: integer
            meta:
              type: object
            type:
              type: string
  spaces-api.Feature:
    title: Feature
    type: object
    properties:
      features:
        type: array
        items:
          title: Feature
          description: Feature is the model for the feature resource
          type: object
          properties:
            date:
              type: string
              format: date-time
            id:
              type: integer
            isRead:
              type: boolean
            link:
              type: string
            linkText:
              type: string
            text:
              type: string
            title:
              type: string
            type:
              type: string
  spaces-api.Feedback:
    title: Feedback
    type: object
    properties:
      feedback:
        title: Feedback
        description: Feedback is the submission item received from the UI
        type: object
        properties:
          emoji:
            type: string
          messageBody:
            type: string
  spaces-api.Follow:
    title: Follow
    type: object
    properties:
      following:
        title: Follow
        description: Follow is a level of following for a resource by a user.
        type: object
        properties:
          level:
            type: string
  spaces-api.GlobalTemplate:
    title: GlobalTemplate
    type: object
    properties:
      globaltemplate:
        title: GlobalTemplate
        description: |-
          GlobalTemplate is a single template that can be accessed from any installation. It is stored in the
          global master DB
        type: object
        properties:
          LinkedInstallation:
            $ref: '#/definitions/spaces-api.LinkedInstallation'
          bannerURL:
            description: BannerURL contains the URL link to the S3/assets location for the template banner
            type: string
          content:
            description: Content is the given content for a Template page.
            type: string
          contentRevision:
            description: ContentRevision is the version number for a Template. This is incremented each time a change is made.
            type: integer
          description:
            description: Description is the user entered description of what the template is used for.
            type: string
          iconURL:
            description: IconURL contains the URL link to the public S3 for the template icon
            type: string
          id:
            description: ID is a unique identifier for a Template.
            type: integer
          isFullWidth:
            description: IsFullWidth is a flag indicating if template is in full width
            type: boolean
          name:
            description: Name is the given name for a Template.
            type: string
          state:
            description: State.
            type: string
            enum:
              - active
              - deleted
  spaces-api.GlobalTemplateMetric:
    title: GlobalTemplateMetric
    type: object
    properties:
      globalTemplate:
        title: GlobalTemplateMetric
        description: |-
          GlobalTemplateMetric is a single metric that has been recorded when a user has selected a global template from
          the template library.
        type: object
        properties:
          createdAt:
            description: CreatedAt is the time the template was selected at.
            type: string
            format: date-time
          id:
            description: ID is a unique identifier for a Template.
            type: integer
          installationId:
            description: InstallationID identifies the current users installation.
            type: integer
          userId:
            description: UserID is the acting user making the change.
            type: integer
  spaces-api.GlobalTemplateMetrics:
    title: GlobalTemplateMetrics
    type: object
    properties:
      globalTemplate:
        title: GlobalTemplateMetrics
        description: |-
          GlobalTemplateMetrics contains all required arguments to create
          entry in the metrics table to track when a global template has been used.
        type: object
        properties:
          templateId:
            description: TemplateID identifies the global template that has been selected by the user.
            type: integer
  spaces-api.GlobalTemplates:
    title: GlobalTemplates
    description: GlobalTemplates is the paged response for listing GlobalTemplates.
    type: object
    properties:
      globalTemplates:
        description: GlobalTemplates is the paged list.
        type: array
        items:
          $ref: '#/definitions/spaces-api.GlobalTemplate'
      # Invalid ref
      # meta:
      #   $ref: '#/definitions/api.PagingResponse'
  spaces-api.Icon:
    title: Icon
    description: Icon represents the icon choosen for a Space
    type: object
    properties:
      icon:
        type: string
  spaces-api.IframelyArgs:
    title: IframelyArgs
    type: object
    properties:
      iframely:
        title: IframelyArgs
        description: IframelyArgs is the arguments struct required for iframely service requests
        type: object
        properties:
          TargetURL:
            type: string
  spaces-api.IframelyResponse:
    title: IframelyResponse
    type: object
    properties:
      iframely:
        title: IframelyResponse
        description: IframelyResponse is a vanilla interface for the Iframely api response payload
        type: object
        properties:
          html:
            type: string
  spaces-api.InstallSub:
    title: InstallSub
    description: InstallSub will return a cut down subscription for the installation response.
    type: object
    properties:
      isPaid:
        type: boolean
      isStarterPlan:
        type: boolean
      pageCountLimit:
        type: integer
      pricePlanId:
        type: integer
      trial:
        title: SubscriptionTrial
        description: SubscriptionTrial will return some cut down subscription info for trial periods.
        type: object
        properties:
          currentUsers:
            type: integer
          daysLeft:
            type: integer
          isInGracePeriod:
            type: boolean
          isInTrial:
            type: boolean
          paymentMethod:
            type: string
          planUsers:
            type: integer
          trialUntil:
            type: string
            format: date-time
  spaces-api.Installation:
    title: Installation
    type: object
    properties:
      installation:
        title: Installation
        description: Installation model is the base model which is used for the create
        type: object
        properties:
          LinkedCompany:
            $ref: '#/definitions/spaces-api.LinkedCompany'
          allowTeamworkBrand:
            type: boolean
          appOwner:
            $ref: '#/definitions/spaces-api.LinkedUser'
          baseHref:
            type: string
          createdAt:
            type: string
            format: date-time
          createdBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          deletedAt:
            type: string
            format: date-time
          deletedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          id:
            type: integer
          name:
            type: string
          preferences:
            $ref: '#/definitions/spaces-api.InstallationPreferences'
          region:
            type: string
          signupProduct:
            type: string
          subscription:
            $ref: '#/definitions/spaces-api.InstallSub'
          updatedAt:
            type: string
            format: date-time
          updatedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          welcomeText:
            type: string
          welcomeTextTitle:
            type: string
  spaces-api.InstallationPreferences:
    title: InstallationPreferences
    description: InstallationPreferences are the preferences for an installation-do
    type: object
    properties:
      emailEnabled:
        type: boolean
      peopleEnabled:
        type: boolean
  spaces-api.InstallationPreferencesUpdate:
    title: InstallationPreferencesUpdate
    description: InstallationPreferencesUpdate contains updateable preference fields
    type: object
    properties:
      emailEnabled:
        type: boolean
      peopleEnabled:
        type: boolean
  spaces-api.InstallationUpdate:
    title: InstallationUpdate
    type: object
    properties:
      installation:
        title: InstallationUpdate
        description: InstallationUpdate represents an installation that can be updated
        type: object
        properties:
          preferences:
            $ref: '#/definitions/spaces-api.InstallationPreferencesUpdate'
          welcomeText:
            type: string
          welcomeTextTitle:
            type: string
  spaces-api.InviteResponse:
    title: InviteResponse
    type: object
    properties:
      invites:
        title: InviteResponse
        description: |-
          InviteResponse will return a list of the users who have been created along with their ID.
          Any users we have failed to invite will also be returned for retry if the client wishes.
        type: object
        properties:
          failed:
            type: object
            additionalProperties:
              type: string
          users:
            type: array
            items:
              $ref: '#/definitions/spaces-api.InvitedUser'
  spaces-api.InviteUser:
    title: InviteUser
    type: object
    properties:
      invites:
        type: array
        items:
          title: InviteUser
          description: InviteUser is the request object submitted to create a new invite for a user.
          type: object
          properties:
            email:
              type: string
            firstName:
              type: string
            lastName:
              type: string
  spaces-api.InvitedUser:
    title: InvitedUser
    description: InvitedUser will contain the userID and email address for the new user.
    type: object
    properties:
      email:
        type: string
      id:
        type: integer
  spaces-api.LinkedCategory:
    title: LinkedCategory
    description: |-
      LinkedCategory represents a linked category includeable object
      which can be embedded in other types to create a relationship.

      This can then be expanded by using the includes query string.
    type: object
    properties:
      category:
        $ref: '#/definitions/spaces-api.LinkedResource'
  spaces-api.LinkedCompany:
    title: LinkedCompany
    description: LinkedCompany A linked company resource.
    type: object
    properties:
      company:
        $ref: '#/definitions/spaces-api.LinkedResource'
  spaces-api.LinkedInstallation:
    title: LinkedInstallation
    description: LinkedInstallation represents a linked Installation and the relationship
    type: object
    properties:
      installation:
        $ref: '#/definitions/spaces-api.LinkedResource'
  spaces-api.LinkedLatestRequest:
    title: LinkedLatestRequest
    description: LinkedLatestRequest represents a linked request and the relationship
    type: object
    properties:
      id:
        type: integer
      meta:
        type: object
      type:
        type: string
  spaces-api.LinkedPage:
    title: LinkedPage
    description: LinkedPage represents a linked Page and the relationship
    type: object
    properties:
      id:
        type: integer
      meta:
        type: object
      type:
        type: string
  spaces-api.LinkedPublicShare:
    title: LinkedPublicShare
    description: LinkedComment represents a linked Page and the relationship
    type: object
    properties:
      id:
        type: integer
      meta:
        type: object
      type:
        type: string
  spaces-api.LinkedResource:
    title: LinkedResource
    description: |-
      LinkedResource is used to define a relationship in a response.
      This is used for 'includes' support and prevents having to
      copy full objects all over the response.
      Instead using a linkedResource we can then just add a reference
      and when a client adds "includes" we can then get the full referenced
      object and include it in the response only once.
    type: object
    properties:
      id:
        type: integer
      meta:
        type: object
      type:
        type: string
  spaces-api.LinkedSpace:
    title: LinkedSpace
    description: LinkedSpace represents a linked space and the relationship
    type: object
    properties:
      id:
        type: integer
      meta:
        type: object
      type:
        type: string
  spaces-api.LinkedUser:
    title: LinkedUser
    description: LinkedUser represents a linked user and the relationship
    type: object
    properties:
      id:
        type: integer
      meta:
        type: object
      type:
        type: string
  spaces-api.LinkedWebhookEvents:
    title: LinkedWebhookEvents
    type: object
    properties:
      LinkedEvents:
        type: array
        items:
          $ref: '#/definitions/spaces-api.LinkedResource'
  spaces-api.MaintainerInfo:
    title: MaintainerInfo
    description: |-
      MaintainerInfo is used (via composition) in almost every model.
      It adds details of all users who have modified this user.
    type: object
    properties:
      createdAt:
        type: string
        format: date-time
      createdBy:
        $ref: '#/definitions/spaces-api.LinkedUser'
      deletedAt:
        type: string
        format: date-time
      deletedBy:
        $ref: '#/definitions/spaces-api.LinkedUser'
      updatedAt:
        type: string
        format: date-time
      updatedBy:
        $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.Me:
    title: Me
    type: object
    properties:
      me:
        title: Me
        description: Me represents the current user
        type: object
        properties:
          LinkedCompany:
            $ref: '#/definitions/spaces-api.LinkedCompany'
          LinkedInstallation:
            $ref: '#/definitions/spaces-api.LinkedInstallation'
          authToken:
            $ref: '#/definitions/spaces-api.AuthToken'
          avatar:
            type: string
          email:
            type: string
          firstname:
            type: string
          id:
            type: integer
          isAdmin:
            type: boolean
          isExternal:
            type: boolean
          isOnboarded:
            type: boolean
          lastname:
            type: string
          preferences:
            $ref: '#/definitions/spaces-api.MePreferences'
          projectsRoles:
            $ref: '#/definitions/spaces-api.ProjectsRoles'
          state:
            type: string
  spaces-api.MePreferences:
    title: MePreferences
    description: MePreferences provide the email preferences for a user
    type: object
    properties:
      emailEnabled:
        type: boolean
      showOnboardingHelp:
        type: boolean
      welcomeTextEnabled:
        type: boolean
  spaces-api.MePreferencesUpdate:
    title: MePreferencesUpdate
    description: MePreferencesUpdate contains updateable fields for user preferences.
    type: object
    properties:
      emailEnabled:
        type: boolean
      showOnboardingHelp:
        type: boolean
      welcomeTextEnabled:
        type: boolean
  spaces-api.MeUpdate:
    title: MeUpdate
    type: object
    properties:
      me:
        title: MeUpdate
        description: MeUpdate is used to update a user preferences
        type: object
        properties:
          preferences:
            $ref: '#/definitions/spaces-api.MePreferencesUpdate'
  spaces-api.NotificationPaged:
    title: NotificationPaged
    type: object
    properties:
      notifications:
        title: NotificationPaged
        description: |-
          NotificationPaged is a wrapper containing the paging information as well
          as the list of NotificationResponse.
        type: object
        properties:
          Notifications:
            type: array
            items:
              $ref: '#/definitions/spaces-api.NotificationResponse'
  spaces-api.NotificationResponse:
    title: NotificationResponse
    description: NotificationResponse is returned to the api and supports including.
    type: object
    properties:
      changedBy:
        $ref: '#/definitions/spaces-api.LinkedUser'
      eventDate:
        type: string
        format: date-time
      id:
        type: integer
      isRead:
        type: boolean
      object:
        $ref: '#/definitions/spaces-api.LinkedResource'
      operation:
        type: string
      title:
        type: string
      url:
        type: string
  spaces-api.NotificationUpdate:
    title: NotificationUpdate
    type: object
    properties:
      notification:
        title: NotificationUpdate
        description: NotificationUpdate is an object to use when updating an existing notification state.
        type: object
        properties:
          state:
            type: string
  spaces-api.Options:
    title: Options
    type: object
    properties:
      styling:
        title: Options
        description: Options is an element in the space content tree.
        type: object
        properties:
          colors:
            type: array
            items:
              $ref: '#/definitions/spaces-api.Color'
          icons:
            type: array
            items:
              $ref: '#/definitions/spaces-api.Icon'
  spaces-api.Page:
    title: Page
    type: object
    properties:
      page:
        title: Page
        description: Page model represents a complete page as returned from the database
        type: object
        properties:
          LinkedInstallation:
            $ref: '#/definitions/spaces-api.LinkedInstallation'
          banner:
            $ref: '#/definitions/spaces-api.Banner'
          breadcrumb:
            $ref: '#/definitions/spaces-api.SpacePages'
          changeMessage:
            type: string
          content:
            type: string
          contentRevision:
            type: integer
          createdAt:
            type: string
            format: date-time
          createdBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          deletedAt:
            type: string
            format: date-time
          deletedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          draftVersion:
            type: integer
          id:
            type: integer
          isFullWidth:
            type: boolean
          isHomePage:
            type: boolean
          isPrivate:
            type: boolean
          isPublished:
            type: boolean
          isRequiredReading:
            type: boolean
          meta:
            $ref: '#/definitions/spaces-api.PageMeta'
          order:
            type: integer
          parentId:
            type: integer
          publicShare:
            $ref: '#/definitions/spaces-api.LinkedPublicShare'
          reactions:
            $ref: '#/definitions/spaces-api.ReactionsMeta'
          readerInlineCommentsEnabled:
            type: boolean
          slug:
            type: string
          space:
            $ref: '#/definitions/spaces-api.LinkedSpace'
          state:
            type: string
          summary:
            type: string
          tags:
            type: array
            items:
              $ref: '#/definitions/spaces-api.Tag'
          title:
            type: string
          updatedAt:
            type: string
            format: date-time
          updatedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.PageCreate:
    title: PageCreate
    type: object
    properties:
      page:
        title: PageCreate
        description: PageCreate is used to add a Page.
        type: object
        properties:
          changeMessage:
            type: string
          content:
            type: string
          isFullWidth:
            type: boolean
          isMinorChange:
            type: boolean
          isPublish:
            type: boolean
          isRequiredReading:
            type: boolean
          parentId:
            type: integer
          readerInlineCommentsEnabled:
            type: boolean
          slug:
            type: string
          tags:
            type: array
            items:
              $ref: '#/definitions/spaces-api.Tag'
          templateUsedID:
            type: integer
          title:
            type: string
  spaces-api.PageDuplicate:
    title: PageDuplicate
    type: object
    properties:
      page:
        title: PageDuplicate
        type: object
        properties:
          parentId:
            type: integer
          readerInlineCommentsEnabled:
            type: boolean
          slug:
            type: string
          title:
            type: string
  spaces-api.PageMeta:
    title: PageMeta
    description: PageMeta contains metrics relating to the page.
    type: object
    properties:
      timeToRead:
        type: integer
      wordCount:
        type: integer
  spaces-api.PagePermission:
    title: PagePermission
    type: object
    properties:
      pagepermission:
        title: PagePermission
        description: |-
          PagePermission is a single permission for a Page.
          Pages can be limited by Role such that only editors of
          a Space can access the page or by User/Company.
          User/Company limiting is not currently supported but
          will be implemented depending on user feedback and
          requirements.
        type: object
        properties:
          createdAt:
            type: string
            format: date-time
          createdBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          deletedAt:
            type: string
            format: date-time
          deletedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          id:
            description: ID is a unique identifier for a PagePermission.
            type: integer
          page:
            $ref: '#/definitions/spaces-api.LinkedPage'
          requester:
            $ref: '#/definitions/spaces-api.LinkedResource'
          role:
            description: 'Role if set, is the role level that has access to this page.'
            type: string
            enum:
              - edit
          updatedAt:
            type: string
            format: date-time
          updatedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.PagePermissionCreate:
    title: PagePermissionCreate
    type: object
    properties:
      pagepermission:
        title: PagePermissionCreate
        description: PagePermissionCreate adds a new PagePermission to the data store.
        type: object
        properties:
          requester:
            $ref: '#/definitions/spaces-api.PagePermissionRequester'
          role:
            description: |-
              Role will be an optional field but for the initial version
              this is the only required field it's presence will be enforced.
            type: string
  spaces-api.PagePermissionRequester:
    title: PagePermissionRequester
    description: |-
      PagePermissionRequester is a strongly typed requester object
      used to create a new permission for a user, company or in future, team.

      Only purpose of this is to document the allowed enums for API docs as
      read is not supported as a level currently
    type: object
    properties:
      id:
        description: 'ID the id of the entity to create a permission against ie userID, companyID.'
        type: integer
      meta:
        $ref: '#/definitions/spaces-api.PermissionLevel'
      type:
        description: Type
        type: string
        enum:
          - users
          - companies
  spaces-api.PageUpdate:
    title: PageUpdate
    type: object
    properties:
      page:
        title: PageUpdate
        description: PageUpdate is used to update a page.
        type: object
        properties:
          banner:
            $ref: '#/definitions/spaces-api.BannerUpdate'
          changeMessage:
            type: string
          content:
            type: string
          draftVersion:
            type: integer
          isFullWidth:
            type: boolean
          isMinorChange:
            type: boolean
          isPublish:
            type: boolean
          isRequiredReading:
            type: boolean
          parentId:
            type: integer
          readerInlineCommentsEnabled:
            type: boolean
          slug:
            type: string
          spaceId:
            type: integer
          tags:
            type: array
            items:
              $ref: '#/definitions/spaces-api.Tag'
          templateUsedID:
            type: integer
          title:
            type: string
  spaces-api.Permission:
    title: Permission
    type: object
    properties:
      permissions:
        type: array
        items:
          title: Permission
          description: Permission is the full permission record from the DB
          type: object
          properties:
            LinkedInstallation:
              $ref: '#/definitions/spaces-api.LinkedInstallation'
            createdAt:
              type: string
              format: date-time
            createdBy:
              $ref: '#/definitions/spaces-api.LinkedUser'
            deletedAt:
              type: string
              format: date-time
            deletedBy:
              $ref: '#/definitions/spaces-api.LinkedUser'
            id:
              type: integer
            requester:
              $ref: '#/definitions/spaces-api.LinkedResource'
            space:
              $ref: '#/definitions/spaces-api.LinkedSpace'
            updatedAt:
              type: string
              format: date-time
            updatedBy:
              $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.PermissionCreateItem:
    title: PermissionCreateItem
    type: object
    properties:
      permissions:
        type: array
        items:
          title: PermissionCreateItem
          description: |-
            PermissionCreateItem is an individual permission Request
            {schema: ../doc/PermissionCreateList.yml}
          type: object
          properties:
            requester:
              $ref: '#/definitions/spaces-api.PermissionRequester'
  spaces-api.PermissionIDArgs:
    title: PermissionIDArgs
    description: PermissionIDArgs contains args required to operate on individual objects.
    type: object
    properties:
      InstallationID:
        type: integer
      ObjectID:
        type: integer
      UserID:
        type: integer
  spaces-api.PermissionLevel:
    title: PermissionLevel
    description: PermissionLevel is the level to set an entity permission to
    type: object
    properties:
      level:
        description: Level
        type: string
        enum:
          - edit
          - read
  spaces-api.PermissionRequester:
    title: PermissionRequester
    description: |-
      PermissionRequester is a strongly typed requester object
      used to create a new permission for a user, company or in future, team.
    type: object
    properties:
      id:
        description: 'ID the id of the entity to create a permission against ie userID, companyID.'
        type: integer
      meta:
        $ref: '#/definitions/spaces-api.PermissionLevel'
      type:
        description: Type
        type: string
        enum:
          - users
          - companies
  spaces-api.PermissionUpdate:
    title: PermissionUpdate
    type: object
    properties:
      permission:
        title: PermissionUpdate
        description: PermissionUpdate represents the range of options available to update a permission
        type: object
        properties:
          level:
            type: string
  spaces-api.PluginState:
    title: PluginState
    type: object
    properties:
      pluginstate:
        title: PluginState
        description: PluginState persists state for a plugin instance on a Space Page
        type: object
        properties:
          LinkedInstallation:
            $ref: '#/definitions/spaces-api.LinkedInstallation'
          createdAt:
            type: string
            format: date-time
          createdBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          data:
            description: 'Data contains the plugin json data, this should be sent as a JSON blob'
            type: string
          deletedAt:
            type: string
            format: date-time
          deletedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          id:
            description: PluginStateID is a unique identifier for a PluginState.
            type: integer
          page:
            $ref: '#/definitions/spaces-api.LinkedPage'
          updatedAt:
            type: string
            format: date-time
          updatedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.PluginStateCreate:
    title: PluginStateCreate
    type: object
    properties:
      pluginstate:
        title: PluginStateCreate
        description: PluginStateCreate adds a new PluginState to the data store.
        type: object
        properties:
          data:
            type: string
  spaces-api.PluginStateUpdate:
    title: PluginStateUpdate
    type: object
    properties:
      pluginstate:
        title: PluginStateUpdate
        description: |-
          PluginStateUpdate is used for partial updates to a PluginState record.
          As many or few fields can be supplied and only those supplied will be updated in the store.
        type: object
        properties:
          data:
            type: string
  spaces-api.ProjectsCreateStatusErr:
    title: ProjectsCreateStatusErr
    type: object
    properties:
      MESSAGE:
        type: string
      STATUS:
        type: string
  spaces-api.ProjectsCreateStatusOK:
    title: ProjectsCreateStatusOK
    type: object
    properties:
      STATUS:
        type: string
      id:
        type: string
  spaces-api.ProjectsRoles:
    title: ProjectsRoles
    description: ProjectsRoles used to represent the roles the current user has within projects
    type: object
    properties:
      isAdmin:
        type: boolean
  spaces-api.ProjectsStatus:
    title: ProjectsStatus
    description: ProjectsStatus is the response from projects.
    type: object
    properties:
      STATUS:
        type: string
  spaces-api.PublicShare:
    title: PublicShare
    type: object
    properties:
      sharing:
        title: PublicShare
        description: |-
          PublicShare contains the sharing information and scopes for an Object indicating if the object
          is currently shared and to whom.
        type: object
        properties:
          createdAt:
            type: string
            format: date-time
          createdBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          deletedAt:
            type: string
            format: date-time
          deletedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          id:
            description: ID is a unique identifier for a PublicShare.
            type: integer
          page:
            $ref: '#/definitions/spaces-api.LinkedResource'
          scopes:
            description: AccessControlList is the list of scopes with their access level.
            type: array
            items:
              $ref: '#/definitions/spaces-api.Scope'
          state:
            description: State.
            type: string
            enum:
              - enabled
              - disabled
          updatedAt:
            type: string
            format: date-time
          updatedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.PublicShareUpdate:
    title: PublicShareUpdate
    type: object
    properties:
      sharing:
        title: PublicShareUpdate
        description: PublicShareUpdate is used to switch the public sharing on or off for an object.
        type: object
        properties:
          state:
            description: State.
            type: string
            enum:
              - enabled
              - disabled
  spaces-api.ReactionType:
    title: ReactionType
    type: object
    properties:
      reactionTypes:
        type: array
        items:
          title: ReactionType
          description: ReactionType represents a type of reaction
          type: object
          properties:
            id:
              description: ID is a unique identifier for a reaction type
              type: integer
            shortCode:
              description: ShortCode is the text representation of the reaction type
              type: string
            unicode:
              description: Unicode is the unicode representation of the reaction type
              type: string
  spaces-api.ReactionUpdate:
    title: ReactionUpdate
    type: object
    properties:
      reaction:
        title: ReactionUpdate
        description: ReactionUpdate represents the incoming payload in the request to update a reaction against a resource
        type: object
        properties:
          reactionType:
            description: |-
              ReactionTypeID is the global identifier for the type of reaction the user is performing.
              If empty the user is removing their previous reaction
            type: integer
  spaces-api.Reactions:
    title: Reactions
    type: object
    properties:
      reaction:
        title: Reactions
        description: Reactions represents the response from fetching reactions data
        type: object
        properties:
          ReactionsUsers:
            description: ReactionsUsers is a map of user lists by reaction type
            type: object
            # Invalid ref
            # additionalProperties:
            #   $ref: '#/definitions/spaces-api.ReactionsUsers'
  spaces-api.ReactionsByType:
    title: ReactionsByType
    type: object
    properties:
      reaction:
        title: ReactionsByType
        description: Reactions represents the response from fetching reactions data for a specific reaction type
        type: object
        properties:
          ReactionsUsers:
            description: LinkedUsers is the list of users who have reacted
            type: array
            items:
              $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.ReactionsMeta:
    title: ReactionsMeta
    description: |-
      Reactions meta is used as part of the response data when fetching a list of reactions. It holds the count
      for each reaction type and the current user's 'reaction type' ID
    type: object
    properties:
      counts:
        description: Counts is a mapping between 'reaction type' IDs and a count of users who have left that reaction
        type: object
      userReactionId:
        description: |-
          UserReactionID is the unique identifier for the 'reaction type' the user has left. It is empty if the
          current user has removed their reaction/hasn't left one yet
        type: integer
  spaces-api.Read:
    title: Read
    type: object
    properties:
      requiredReading:
        title: Read
        description: Read is a level of reading for a resource by a user.
        type: object
        properties:
          latestVersion:
            description: LatestVersion is the latest version number of the page.
            type: integer
          readVersion:
            description: 'Revision is the version the user has last read, null if user hasn''t read any version.'
            type: integer
          state:
            description: State.
            type: string
            enum:
              - read
              - unread
              - lapsed
  spaces-api.ReadUpdate:
    title: ReadUpdate
    type: object
    properties:
      requiredReading:
        title: ReadUpdate
        description: ReadUpdate is used to update a users read status.
        type: object
        properties:
          readVersion:
            description: Revision is the version of the document the user has read/unread.
            type: integer
          state:
            description: State.
            type: string
            enum:
              - read
              - unread
  spaces-api.ReadingItem:
    title: ReadingItem
    type: object
    properties:
      reading:
        type: array
        items:
          title: ReadingItem
          description: ReadingItem is a page that is to be read
          type: object
          properties:
            installationId:
              type: integer
            pageCreatedAt:
              type: string
              format: date-time
            pageCreatedBy:
              $ref: '#/definitions/spaces-api.LinkedUser'
            pageDeletedAt:
              type: string
              format: date-time
            pageDeletedBy:
              $ref: '#/definitions/spaces-api.LinkedUser'
            pageId:
              type: integer
            pageSlug:
              type: string
            pageTitle:
              type: string
            pageUpdatedAt:
              type: string
              format: date-time
            pageUpdatedBy:
              $ref: '#/definitions/spaces-api.LinkedUser'
            revision:
              type: integer
            space:
              $ref: '#/definitions/spaces-api.LinkedSpace'
            state:
              type: string
  spaces-api.RequiredCompany:
    title: RequiredCompany
    description: RequiredCompany represents a company that is assigned as page a required reading
    type: object
    properties:
      company:
        $ref: '#/definitions/spaces-api.LinkedResource'
      users:
        type: array
        items:
          $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.RequiredPageUsers:
    title: RequiredPageUsers
    type: object
    properties:
      requiredReading:
        title: RequiredPageUsers
        description: RequiredPageUsers is a list of users who have/haven't read a page
        type: object
        properties:
          read:
            type: array
            items:
              $ref: '#/definitions/spaces-api.RequiredUserRead'
          unread:
            type: array
            items:
              $ref: '#/definitions/spaces-api.RequiredUserUnread'
  spaces-api.RequiredUserRead:
    title: RequiredUserRead
    description: RequiredUserRead is a list is user who read a page
    type: object
    properties:
      readDate:
        type: string
        format: date-time
      user:
        $ref: '#/definitions/spaces-api.LinkedUser'
      version:
        type: integer
  spaces-api.RequiredUserUnread:
    title: RequiredUserUnread
    description: RequiredUserUnread is a list of users who have not read a page
    type: object
    properties:
      user:
        $ref: '#/definitions/spaces-api.LinkedUser'
      version:
        type: integer
  spaces-api.Scope:
    title: Scope
    description: Scope defines a single access level.
    type: object
    properties:
      createdAt:
        type: string
        format: date-time
      createdBy:
        $ref: '#/definitions/spaces-api.LinkedUser'
      deletedAt:
        type: string
        format: date-time
      deletedBy:
        $ref: '#/definitions/spaces-api.LinkedUser'
      id:
        description: ID is an individual scopes identifier
        type: integer
      name:
        description: 'Name is the specific scope value, could be an email address for example.'
        type: string
      role:
        description: Role.
        type: string
        enum:
          - read
      scopeType:
        description: ScopeType.
        type: string
        enum:
          - anyone
          - invite
      sharingURL:
        description: SharingURL is the individual tokenised URL for this scope.
        type: string
      state:
        description: State
        type: string
        enum:
          - enabled
          - disabled
      token:
        description: Token contains the unique sharing token for this scope.
        type: string
      updatedAt:
        type: string
        format: date-time
      updatedBy:
        $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.ScopeCreate:
    title: ScopeCreate
    type: object
    properties:
      sharing:
        type: array
        items:
          title: ScopeCreate
          description: |-
            ScopeCreate is an individual createable scope - it is a stripped version
            of the main Scope object.
          type: object
          properties:
            Role:
              description: Role.
              type: string
              enum:
                - read
            message:
              type: string
            name:
              description: 'Name is the specific scope value, could be an email address for example.'
              type: string
            scopeType:
              description: ScopeType.
              type: string
              enum:
                - anyone
                - invite
  spaces-api.ScopeUpdate:
    title: ScopeUpdate
    type: object
    properties:
      sharing:
        title: ScopeUpdate
        description: |-
          ScopeUpdate allows an individual scope to be updated. This
          exposes only updateable fields. Anything else submitted is ignored.
        type: object
        properties:
          state:
            description: State.
            type: string
            enum:
              - enabled
              - disabled
  spaces-api.SearchPage:
    title: SearchPage
    description: SearchPage is the search results for a page search
    type: object
    properties:
      matched:
        type: object
      pageId:
        type: integer
      slug:
        type: string
      space:
        $ref: '#/definitions/spaces-api.SearchPageSpace'
      tags:
        type: array
        items:
          $ref: '#/definitions/spaces-api.ShortTag'
      title:
        type: string
  spaces-api.SearchPageSpace:
    title: SearchPageSpace
    description: SearchPageSpace is the paged section of the search result
    type: object
    properties:
      id:
        type: integer
      type:
        type: string
  spaces-api.SearchResponse:
    title: SearchResponse
    description: SearchResponse is a wrapper for search results.
    type: object
    properties:
      included:
        $ref: '#/definitions/spaces-api.SearchSpaceWrapper'
      results:
        type: array
        items:
          $ref: '#/definitions/spaces-api.SearchPage'
      totalResults:
        type: integer
  spaces-api.SearchSpaceWrapper:
    title: SearchSpaceWrapper
    description: SearchSpaceWrapper is the wrapper for search results
    type: object
    properties:
      spaces:
        type: object
        additionalProperties:
          $ref: '#/definitions/spaces-api.Space'
  spaces-api.ShortTag:
    title: ShortTag
    description: 'ShortTag represents tags in a search response e.g. with colour, name'
    type: object
    properties:
      color:
        type: string
      name:
        type: string
      tagId:
        type: integer
  spaces-api.Space:
    title: Space
    description: Space model represents a complete Space as returned from the database
    type: object
    properties:
      LinkedCategory:
        $ref: '#/definitions/spaces-api.LinkedCategory'
      banner:
        type: string
      bannerX:
        type: number
      bannerY:
        type: number
      code:
        type: string
      collaborators:
        type: array
        items:
          $ref: '#/definitions/spaces-api.SpaceCollaborator'
      collaboratorsCount:
        type: integer
      createdAt:
        type: string
        format: date-time
      createdBy:
        $ref: '#/definitions/spaces-api.LinkedUser'
      deletedAt:
        type: string
        format: date-time
      deletedBy:
        $ref: '#/definitions/spaces-api.LinkedUser'
      homepage:
        $ref: '#/definitions/spaces-api.LinkedPage'
      icon:
        type: string
      id:
        type: integer
      projectId:
        type: integer
      purpose:
        type: string
      spaceColor:
        type: string
      state:
        type: string
      title:
        type: string
      updatedAt:
        type: string
        format: date-time
      updatedBy:
        $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.SpaceCollaborator:
    title: SpaceCollaborator
    description: SpaceCollaborator is a list of users who have contributed to a Space.
    type: object
    properties:
      id:
        type: integer
      meta:
        type: object
      type:
        type: string
  spaces-api.SpaceContents:
    title: SpaceContents
    type: object
    properties:
      pages:
        title: SpaceContents
        description: |-
          SpaceContents contains the home page which is the root element in
          the Space Page tree view. It contains two sub trees, the Pages -
          pages that are not private. It also contains any Private pages that the user
          has access to.
        type: object
        properties:
          pages:
            $ref: '#/definitions/spaces-api.SpacePages'
          private:
            type: array
            items:
              $ref: '#/definitions/spaces-api.SpacePages'
  spaces-api.SpaceCreate:
    title: SpaceCreate
    type: object
    properties:
      space:
        title: SpaceCreate
        description: SpaceCreate represents only the info required to create a new space
        type: object
        properties:
          categoryId:
            type: integer
          code:
            type: string
          icon:
            type: string
          projectId:
            description: LinkedProject links a space to a Project
            type: integer
          protected:
            type: boolean
          purpose:
            type: string
          spaceColor:
            description: 'Color and Icon names come in request, controller then maps to ID''s.'
            type: string
          title:
            type: string
  spaces-api.SpaceOwner:
    title: SpaceOwner
    type: object
    properties:
      owner:
        title: SpaceOwner
        description: |-
          SpaceOwner returns information on the owning user
          as well as users with 'full' permissions to the space
        type: object
        properties:
          space:
            $ref: '#/definitions/spaces-api.LinkedSpace'
          user:
            $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.SpacePages:
    title: SpacePages
    type: object
    properties:
      trash:
        type: array
        items:
          title: SpacePages
          description: SpacePages contains a tree of pages nested under their parents.
          type: object
          properties:
            childPages:
              type: array
              items:
                title: SpacePages
                description: SpacePages contains a tree of pages nested under their parents.
                type: object
                properties:
                  id:
                    type: integer
                  slug:
                    type: string
                  title:
                    type: string
                  updatedAt:
                    type: string
                    format: date-time
            id:
              type: integer
            slug:
              type: string
            title:
              type: string
            updatedAt:
              type: string
              format: date-time
  spaces-api.SpaceUpdate:
    title: SpaceUpdate
    type: object
    properties:
      space:
        title: SpaceUpdate
        description: SpaceUpdate represents a PATCH request to update a Space where only fields that are changing will be sent
        type: object
        properties:
          categoryId:
            type: integer
          code:
            type: string
          icon:
            type: string
          projectId:
            type: integer
          purpose:
            type: string
          spaceColor:
            type: string
          state:
            type: string
          title:
            type: string
  spaces-api.Spaces:
    title: Spaces
    type: object
    properties:
      spaces:
        title: Spaces
        description: Spaces is a paged space response object.
        type: object
        properties:
          Spaces:
            type: array
            items:
              $ref: '#/definitions/spaces-api.Space'
  spaces-api.Stats:
    title: Stats
    type: object
    properties:
      stats:
        title: Stats
        description: Stats represents the page statistics for an installation
        type: object
        properties:
          maxPages:
            type: integer
          pageCount:
            description: PageCount is the number of active pages within an Installation.
            type: integer
          usingProFeature:
            type: boolean
  spaces-api.Subscription:
    title: Subscription
    type: object
    properties:
      subscription:
        title: Subscription
        description: Subscription contains core info on a spaces subscription
        type: object
        properties:
          billingAddress:
            $ref: '#/definitions/spaces-api.SubscriptionAddress'
          billingInfo:
            $ref: '#/definitions/spaces-api.SubscriptionBilling'
          cancelledAt:
            type: string
            format: date-time
          cancelledBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          currentUsers:
            type: integer
          inGracePeriod:
            type: boolean
          isPaid:
            type: boolean
          paidUntil:
            type: string
            format: date-time
          paidUsers:
            type: integer
          pricePlanId:
            type: integer
          trialUntil:
            type: string
            format: date-time
  spaces-api.SubscriptionAddress:
    title: SubscriptionAddress
    description: SubscriptionAddress contains address data for sending billing requests.
    type: object
    properties:
      city:
        type: string
      country:
        type: string
      state:
        type: string
      streetAddress1:
        type: string
      streetAddress2:
        type: string
      vatNumber:
        type: string
      zip:
        type: string
  spaces-api.SubscriptionBilling:
    title: SubscriptionBilling
    description: |-
      SubscriptionBilling returns core information on
      billing an installation
    type: object
    properties:
      billingAmount:
        $ref: '#/definitions/decimal.Decimal'
      billingCurrency:
        type: string
      billingPeriod:
        type: string
      contactEmail:
        type: string
      contactPhone:
        type: string
      contactPhoneCountryPrefix:
        type: string
      nextBillingDate:
        type: string
        format: date-time
  spaces-api.SubscriptionTrial:
    title: SubscriptionTrial
    type: object
    properties:
      trial:
        title: SubscriptionTrial
        description: SubscriptionTrial will return some cut down subscription info for trial periods.
        type: object
        properties:
          currentUsers:
            type: integer
          daysLeft:
            type: integer
          isInGracePeriod:
            type: boolean
          isInTrial:
            type: boolean
          paymentMethod:
            type: string
          planUsers:
            type: integer
          trialUntil:
            type: string
            format: date-time
  spaces-api.Tag:
    title: Tag
    type: object
    properties:
      tag:
        title: Tag
        description: Tag is the full model struct for tags. It is the object sent to us from the client for the creation of a tag/s.
        type: object
        properties:
          color:
            description: Color - string containing a hex color for the tag this is returned in the same format
            type: string
          createdAt:
            type: string
            format: date-time
          createdBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          deletedAt:
            type: string
            format: date-time
          deletedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          id:
            type: integer
          name:
            description: Name - string value for the tag name
            type: string
          pageCount:
            description: PageCount is the number of pages that a given tag is currently being used on
            type: integer
          updatedAt:
            type: string
            format: date-time
          updatedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.TagUpdate:
    title: TagUpdate
    type: object
    properties:
      tag:
        title: TagUpdate
        description: |-
          TagUpdate is used when updating a tag. The TagId to be updated is taken from the API endpoint PATCH
          and the args to be updated name and color are sent in the body.
        type: object
        properties:
          color:
            type: string
          id:
            type: integer
          name:
            type: string
  spaces-api.Template:
    title: Template
    type: object
    properties:
      template:
        title: Template
        description: |-
          Template is a single template for a page.
          Any user is able to create a template from a page and this will be available within their own installation.
        type: object
        properties:
          content:
            description: Content is the given content for a Template page.
            type: string
          contentRevision:
            description: ContentRevision is the version number for a Template. This is incremented each time a change is made.
            type: integer
          createdAt:
            type: string
            format: date-time
          createdBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          deletedAt:
            type: string
            format: date-time
          deletedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          description:
            description: Description is the user entered description of what the template is used for.
            type: string
          iconURL:
            description: IconURL contains the URL link to the S3 for the template icon
            type: string
          id:
            description: ID is a unique identifier for a Template.
            type: integer
          isFullWidth:
            description: IsFullWidth is a flag indicating if template is in full width
            type: boolean
          name:
            description: Name is the given name for a Template.
            type: string
          state:
            description: State.
            type: string
            enum:
              - active
              - deleted
          templateCount:
            description: TemplateCount is a count of the times the template has been used to create a page.
            type: integer
          templateLastUsed:
            description: TemplateLastUsed is the last time a template has been used to create a page.
            type: string
            format: date-time
          updatedAt:
            type: string
            format: date-time
          updatedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
  spaces-api.TemplateCreate:
    title: TemplateCreate
    type: object
    properties:
      template:
        title: TemplateCreate
        description: TemplateCreate adds a new Template to the data store.
        type: object
        properties:
          content:
            description: Content is the given content for a Template page.
            type: string
          description:
            description: Description is the user entered description of what the template is used for.
            type: string
          iconURL:
            description: IconURL contains the URL link to the S3 for the template icon
            type: string
          isFullWidth:
            description: IsFullWidth is a flag indicating if template is in full width
            type: boolean
          name:
            description: Name is the given name for a Template.
            type: string
          pageID:
            type: integer
          spaceID:
            type: integer
  spaces-api.TemplateUpdate:
    title: TemplateUpdate
    type: object
    properties:
      template:
        title: TemplateUpdate
        description: |-
          TemplateUpdate is used for partial updates to a Template record.
          As many or few fields can be supplied and only those supplied will be updated in the store.
        type: object
        properties:
          content:
            description: Content is the given content for a Template page.
            type: string
          description:
            description: Description is the user entered description of what the template is used for.
            type: string
          iconURL:
            description: IconURL contains the URL link to the S3 for the template icon
            type: string
          isFullWidth:
            description: IsFullWidth is a flag indicating if template is in full width
            type: boolean
          name:
            description: Name is the given name for a Template.
            type: string
  spaces-api.Templates:
    title: Templates
    description: Templates is the paged response for listing Templates.
    type: object
    properties:
      # Invalid ref
      # meta:
      #   $ref: '#/definitions/api.PagingResponse'
      templates:
        description: Templates is the paged list.
        type: array
        items:
          $ref: '#/definitions/spaces-api.Template'
  spaces-api.UnreadNotifications:
    title: UnreadNotifications
    type: object
    properties:
      notification:
        title: UnreadNotifications
        description: UnreadNotifications defines the response for a notification unread request
        type: object
        properties:
          unread:
            type: integer
  spaces-api.User:
    title: User
    type: object
    properties:
      user:
        title: User
        description: User is the full user model with details of maintainers.
        type: object
        properties:
          LinkedCompany:
            $ref: '#/definitions/spaces-api.LinkedCompany'
          LinkedInstallation:
            $ref: '#/definitions/spaces-api.LinkedInstallation'
          avatar:
            type: string
          createdAt:
            type: string
            format: date-time
          createdBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          deletedAt:
            type: string
            format: date-time
          deletedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          email:
            type: string
          firstname:
            type: string
          id:
            type: integer
          isAdmin:
            type: boolean
          isOnboarded:
            type: boolean
          lastname:
            type: string
          preferences:
            $ref: '#/definitions/spaces-api.UserPreferences'
          state:
            type: string
          updatedAt:
            type: string
            format: date-time
          updatedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          userType:
            type: string
  spaces-api.UserPermission:
    title: UserPermission
    type: object
    properties:
      permission:
        title: UserPermission
        description: UserPermission is the level of permission a user has for an object.
        type: object
        properties:
          level:
            type: string
  spaces-api.UserPreferences:
    title: UserPreferences
    description: UserPreferences provide the preferences for a user.
    type: object
    properties:
      emailEnabled:
        type: boolean
      showOnboardingHelp:
        type: boolean
      welcomeTextEnabled:
        type: boolean
  spaces-api.UserSpacePermission:
    title: UserSpacePermission
    type: object
    properties:
      permissions:
        type: array
        items:
          title: UserSpacePermission
          description: UserSpacePermission is the representation of a users permission level for a space
          type: object
          properties:
            level:
              type: string
            space:
              $ref: '#/definitions/spaces-api.LinkedSpace'
  spaces-api.UserUpdate:
    title: UserUpdate
    type: object
    properties:
      user:
        title: UserUpdate
        description: UserUpdate is the transformed projects user with updatable fields for the spaces data store
        type: object
        properties:
          enabled:
            type: boolean
          id:
            type: integer
          isOnboarded:
            type: boolean
  spaces-api.Webhook:
    title: Webhook
    type: object
    properties:
      webhook:
        title: Webhook
        description: Webhook represents a single Webhook with 1 or many linked events.
        type: object
        properties:
          createdAt:
            type: string
            format: date-time
          createdBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          deletedAt:
            type: string
            format: date-time
          deletedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          events:
            type: array
            items:
              $ref: '#/definitions/spaces-api.LinkedResource'
          id:
            type: integer
          isActive:
            type: boolean
          latestRequest:
            $ref: '#/definitions/spaces-api.LinkedResource'
          token:
            type: string
          updatedAt:
            type: string
            format: date-time
          updatedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          url:
            type: string
  spaces-api.WebhookCreate:
    title: WebhookCreate
    type: object
    properties:
      webhook:
        title: WebhookCreate
        description: WebhookCreate represents an object to use when creating a new webhook.
        type: object
        properties:
          events:
            description: Events represents a to-many events relationship
            type: array
            items:
              $ref: '#/definitions/spaces-api.LinkedResource'
          token:
            description: Token is thr auth token if expected by your URL
            type: string
          url:
            description: URL to call
            type: string
  spaces-api.WebhookEvent:
    title: WebhookEvent
    type: object
    properties:
      webhook-event:
        type: array
        items:
          title: WebhookEvent
          description: WebhookEvent represents a WebhookEvent
          type: object
          properties:
            id:
              type: integer
            key:
              type: string
  spaces-api.WebhookRequestResponse:
    title: WebhookRequestResponse
    type: object
    properties:
      webhook-request:
        title: WebhookRequestResponse
        description: WebhookRequestResponse represents a WebhookRequestResponse object.
        type: object
        properties:
          createdAt:
            type: string
            format: date-time
          createdBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          deletedAt:
            type: string
            format: date-time
          deletedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          event:
            $ref: '#/definitions/spaces-api.LinkedResource'
          id:
            description: ID is the unique id given to a WebhookRequest
            type: integer
          requestBody:
            description: Request body as a JSON string
            type: string
          requestHeaders:
            description: Request headers as a JSON string
            type: string
          responseBody:
            description: Response body as a JSON string
            type: string
          responseHeaders:
            description: Response headers as a JSON string
            type: string
          responseStatus:
            description: HTTP status code of the response
            type: integer
          status:
            description: Status of the request.
            type: string
            enum:
              - success
              - error
          updatedAt:
            type: string
            format: date-time
          updatedBy:
            $ref: '#/definitions/spaces-api.LinkedUser'
          url:
            description: The URL the request was made to.
            type: string
          uuid:
            description: Universal unique identifier of the event that triggered the request.
            type: string
          webhook:
            $ref: '#/definitions/spaces-api.LinkedResource'
  spaces-api.WebhookRequests:
    title: WebhookRequests
    type: object
    properties:
      webhook-requests:
        title: WebhookRequests
        description: WebhookRequests is a paged space response object.
        type: object
        properties:
          WebhookRequests:
            type: array
            items:
              $ref: '#/definitions/spaces-api.WebhookRequestResponse'
          # Invalid ref
          # meta:
          #   $ref: '#/definitions/api.PagingResponse'
  spaces-api.WebhookUpdate:
    title: WebhookUpdate
    type: object
    properties:
      webhook:
        title: WebhookUpdate
        description: WebhookUpdate represents an object to use when updating a webhook.
        type: object
        properties:
          events:
            description: Events represents a to-many events relationship
            type: array
            items:
              $ref: '#/definitions/spaces-api.LinkedResource'
          id:
            description: ID is the ID of the webhook to update
            type: integer
          isActive:
            description: IsActive shows whether the webhook is active or disabled
            type: boolean
          token:
            description: Token is the auth token if expected by your URL
            type: string
          url:
            description: URL to call
            type: string
securityDefinitions:
  API Key - 1:
    name: API Key
    type: apiKey
    in: query
