# setSubscriptions

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /json-rpc/system/subscriptions/subscribe:
    post:
      summary: setSubscriptions
      deprecated: false
      description: >-
        During a serverinfo request the caller can optionally subscribe to
        updates, either to specific parts or all available data.

        These updates will be pushed whenever a server-side data change occurs,
        without the need for the caller to poll.
      tags:
        - Hyperion API/Controls/Operational Controls
        - Websocket
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                command:
                  type: string
                  description: The type of command to execute.
                  title: ''
                  enum:
                    - serverinfo
                  x-apidog-enum:
                    - value: serverinfo
                      name: ''
                      description: ''
                subcommand:
                  type: string
                  description: The type of sub-command to execute.
                  title: ''
                  enum:
                    - subscribe
                    - unsubscribe
                  x-apidog-enum:
                    - value: subscribe
                      name: ''
                      description: ''
                    - value: unsubscribe
                      name: ''
                      description: ''
                instance:
                  description: Instance index (0-254) to which the command applies.
                  $ref: '#/components/schemas/instance%20-%20single'
                subscribe:
                  type: array
                  items:
                    type: string
                  uniqueItems: true
                  description: An empty list is applied to all subscriptions
                tan:
                  type: integer
                  minimum: 0
                  examples:
                    - 4711
                  description: Transaction number for tracking requests and responses.
              x-apidog-orders:
                - command
                - subcommand
                - instance
                - subscribe
                - 01JVHARBC5KH9YQ6YNQ1TTGE9W
              required:
                - command
                - subcommand
                - subscribe
              x-apidog-refs:
                01JVHARBC5KH9YQ6YNQ1TTGE9W:
                  $ref: '#/components/schemas/tan'
              x-apidog-ignore-properties:
                - tan
            examples:
              '1':
                value:
                  command: serverinfo
                  subscribe:
                    - components-update
                  tan: 4711
                summary: Info & Subscribe
                description: Subscribe to component updates and get all server information.
              '2':
                value:
                  command: serverinfo
                  subcommand: subscribe
                  subscribe: []
                  tan: 4711
                summary: Subscribe All
                description: Subscribe to all updates possible.
              '3':
                value:
                  command: serverinfo
                  subcommand: unsubscribe
                  subscribe:
                    - components-update
                  tan: 4711
                summary: Unsubscribe
                description: Unsubscribe to "components-update" events.
              '4':
                value:
                  command: serverinfo
                  subcommand: unsubscribe
                  subscribe: []
                  tan: 4711
                summary: Unsubscribe all
                description: Unsubscribe to all current subscriptions in place.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  command:
                    type: string
                    description: The command executed
                  subcommand:
                    type: string
                    description: The sub-command executed
                  success:
                    type: boolean
                    description: Result, if the request excuted successfully
                  info:
                    type: object
                    properties: {}
                    x-apidog-orders: []
                    description: Information requested
                    additionalProperties: true
                    x-apidog-ignore-properties: []
                  error:
                    type: string
                    description: Reason why a request did not execute successfully
                  errorData:
                    type: array
                    items:
                      type: object
                      properties:
                        description:
                          type: string
                      x-apidog-orders:
                        - description
                      x-apidog-ignore-properties: []
                    description: Detailed error explaination
                  tan:
                    type: integer
                    description: Request's transaction number
                x-apidog-orders:
                  - 01JV5M76DZ4M3GA4AD8Y4G69AP
                required:
                  - command
                  - success
                  - tan
                x-apidog-refs:
                  01JV5M76DZ4M3GA4AD8Y4G69AP:
                    $ref: '#/components/schemas/response'
                x-apidog-ignore-properties:
                  - command
                  - subcommand
                  - success
                  - info
                  - error
                  - errorData
                  - tan
              examples:
                '1':
                  summary: Success
                  value:
                    command: serverinfo-subscribe
                    info: {}
                    success: true
                    tan: 4711
                '2':
                  summary: Exception
                  value:
                    command: serverinfo-subscribe
                    error: Invalid params
                    errorData:
                      - description: No subscriptions provided
                    success: false
                    tan: 4711
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: Hyperion API/Controls/Operational Controls
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/894413/apis/api-17016242-run
components:
  schemas:
    instance - single:
      type: integer
      minimum: 0
      maximum: 254
      description: Instance index (0-254) to which the command applies.
      x-apidog-folder: ''
    tan:
      type: object
      properties:
        tan:
          type: integer
          minimum: 0
          examples:
            - 4711
          description: Transaction number for tracking requests and responses.
      x-apidog-orders:
        - tan
      title: tan
      x-apidog-folder: ''
      x-apidog-ignore-properties: []
    response:
      type: object
      properties:
        command:
          type: string
          description: The command executed
        subcommand:
          type: string
          description: The sub-command executed
        success:
          type: boolean
          description: Result, if the request excuted successfully
        info:
          type: object
          properties: {}
          x-apidog-orders: []
          description: Information requested
          additionalProperties: true
          x-apidog-ignore-properties: []
        error:
          type: string
          description: Reason why a request did not execute successfully
        errorData:
          type: array
          items:
            type: object
            properties:
              description:
                type: string
            x-apidog-orders:
              - description
            x-apidog-ignore-properties: []
          description: Detailed error explaination
        tan:
          type: integer
          description: Request's transaction number
      required:
        - command
        - success
        - tan
      x-apidog-orders:
        - command
        - subcommand
        - success
        - info
        - error
        - errorData
        - tan
      x-apidog-folder: ''
      x-apidog-ignore-properties: []
  securitySchemes: {}
servers:
  - url: http://{{host}}:8090
    description: Develop Env
  - url: https://{{host}}:8092
    description: Testing Env
security: []

```
