Vanilla Forums Features API

The Features API from Vanilla Forums — 2 operation(s) for features.

OpenAPI Specification

vanilla-forums-features-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  description: API access to your community.
  title: Vanilla Addons Features API
  version: '2.0'
servers:
- url: https://open.vanillaforums.com/api/v2
tags:
- name: Features
paths:
  /features:
    get:
      summary: List plan and usage feature settings.
      description: 'Returns lightweight settings for all registered plan and usage features.

        Usage fields (`isInUse`, `currentCount`) are omitted unless `expand=usage` is requested.

        '
      tags:
      - Features
      operationId: listFeatures
      parameters:
      - name: enabled
        in: query
        description: 'Filter features by whether they are in use on the site.

          Only applied when `expand` includes `usage`.

          '
        schema:
          type: boolean
      - description: 'Expand associated records using one or more valid field names. A value of "all" will expand all expandable fields.

          '
        in: query
        name: expand
        schema:
          items:
            enum:
            - usage
            - all
            type: string
          type: array
        style: form
      - name: fields
        in: query
        style: form
        description: Only return fields with these keys from the output. Use dot notation for nested fields.
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PlanFeature'
        '401':
          $ref: '#/components/responses/PermissionError'
      x-addon: dashboard
  /features/{featureID}:
    parameters:
    - name: featureID
      in: path
      required: true
      description: Unique identifier for the feature.
      schema:
        $ref: '#/components/schemas/PlanFeatureID'
      x-addon: dashboard
    get:
      summary: Get plan or usage feature settings.
      description: 'Returns settings for a single registered feature.

        Usage fields (`isInUse`, `currentCount`) are omitted unless `expand=usage` is requested.

        '
      tags:
      - Features
      operationId: getFeature
      parameters:
      - description: 'Expand associated records using one or more valid field names. A value of "all" will expand all expandable fields.

          '
        in: query
        name: expand
        schema:
          items:
            enum:
            - usage
            - all
            type: string
          type: array
        style: form
      - name: fields
        in: query
        style: form
        description: Only return fields with these keys from the output. Use dot notation for nested fields.
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanFeature'
        '401':
          $ref: '#/components/responses/PermissionError'
        '404':
          $ref: '#/components/responses/NotFound'
      x-addon: dashboard
components:
  responses:
    NotFound:
      description: The record does not exist or was not found.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: More information about the error.
              status:
                type: number
                description: The HTTP status code for the error.
                format: int32
            required:
            - message
          example:
            status: 404
            message: Page Not Found
      x-addon: dashboard
    PermissionError:
      description: Permission denied.
      content:
        application/json:
          schema:
            type: object
            required:
            - message
            - status
            - permissions
            properties:
              message:
                type: string
                description: A message that tells you the permissions you need.
                example: Permission denied.
              status:
                type: integer
                description: The HTTP status code for the error.
                format: int32
                example: 403
              permissions:
                description: The permissions the requesting user is missing.
                type: array
                items:
                  type: string
              recordIDs:
                description: The recordIDs the user didn't have permission on.
                type: array
                items:
                  type: integer
          example:
            status: 403
            message: Permission Problem
            permissions:
            - Vanilla.Discussions.Edit
            - Vanilla.Community.Manage
            recordIDs:
            - 2425
            - 1342
      x-addon: dashboard
  schemas:
    PlanFeatureID:
      type: string
      description: Unique identifier for a registered plan or usage feature.
      enum:
      - AIConversations
      - AISuggestions
      - AuditLogs
      - AutomationRules
      - Badges
      - EmailDigest
      - AutomatedEmails
      - Events
      - FederatedSearch
      - Groups
      - InterestsContent
      - KnowledgeBases
      - SSOConnections
      - SentimentAnalysis
      - Subcommunities
      - UploadFileSizeBytes
      - VanillaAnalytics
      - Webhooks
      - WidgetBuilder
      x-addon: dashboard
    EnumPlanFeature:
      allOf:
      - $ref: '#/components/schemas/PlanFeatureBase'
      - type: object
        properties:
          type:
            type: string
            enum:
            - enum
          isAvailable:
            type: boolean
            description: Enum plan features are always available.
          value:
            type: string
            description: Current enum value for the plan tier.
        required:
        - value
      x-addon: dashboard
    RetentionPlanFeature:
      allOf:
      - $ref: '#/components/schemas/PlanFeatureBase'
      - type: object
        properties:
          type:
            type: string
            enum:
            - retention
          isAvailable:
            type: boolean
            description: Whether the feature is allowed at the current plan level.
          retainForTimespan:
            type: string
            description: Maximum queryable retention timespan at the current plan level.
          retainFromDate:
            type: string
            format: date-time
            nullable: true
            description: Earliest date allowed in API/UI queries for this feature.
        required:
        - isAvailable
        - retainForTimespan
      x-addon: dashboard
    BooleanPlanFeature:
      allOf:
      - $ref: '#/components/schemas/PlanFeatureBase'
      - type: object
        properties:
          type:
            type: string
            enum:
            - boolean
          isAvailable:
            type: boolean
            description: Whether the feature is allowed at the current plan level.
        required:
        - isAvailable
      x-addon: dashboard
    PlanFeature:
      oneOf:
      - $ref: '#/components/schemas/BooleanPlanFeature'
      - $ref: '#/components/schemas/LimitPlanFeature'
      - $ref: '#/components/schemas/RetentionPlanFeature'
      - $ref: '#/components/schemas/EnumPlanFeature'
      - $ref: '#/components/schemas/UsageFeature'
      discriminator:
        propertyName: type
        mapping:
          boolean: '#/components/schemas/BooleanPlanFeature'
          limit: '#/components/schemas/LimitPlanFeature'
          retention: '#/components/schemas/RetentionPlanFeature'
          enum: '#/components/schemas/EnumPlanFeature'
          usage: '#/components/schemas/UsageFeature'
      x-addon: dashboard
    PlanFeatureType:
      type: string
      enum:
      - boolean
      - limit
      - retention
      - enum
      - usage
      x-addon: dashboard
    LimitPlanFeature:
      allOf:
      - $ref: '#/components/schemas/PlanFeatureBase'
      - type: object
        properties:
          type:
            type: string
            enum:
            - limit
          isAvailable:
            type: boolean
            description: Whether the feature is allowed at the current plan level. A limit of `0` is not available.
          limitAvailable:
            $ref: '#/components/schemas/LimitAvailable'
        required:
        - isAvailable
        - limitAvailable
      x-addon: dashboard
    UsageFeature:
      allOf:
      - $ref: '#/components/schemas/PlanFeatureBase'
      - type: object
        properties:
          type:
            type: string
            enum:
            - usage
      x-addon: dashboard
    LimitAvailable:
      oneOf:
      - type: integer
        minimum: 0
      - type: string
        enum:
        - infinity
      description: Maximum allowed count at the current plan level. The string `infinity` means unlimited.
      x-addon: dashboard
    PlanFeatureBase:
      type: object
      properties:
        featureID:
          $ref: '#/components/schemas/PlanFeatureID'
        type:
          $ref: '#/components/schemas/PlanFeatureType'
        configKey:
          type: string
          description: Primary configuration key for this feature.
        isInUse:
          type: boolean
          description: Whether the feature is in use on the site. Only present when `expand=usage`.
        currentCount:
          type: integer
          description: Current usage count for limit features. Only present when `expand=usage`.
      required:
      - featureID
      - type
      - configKey
      x-addon: dashboard
x-resourceEvents:
  emailTemplates:
    x-feature: Feature.emailTemplates.Enabled
    name: Email Template
    type: emailTemplate
  notification:
    x-addon: dashboard
    name: Notification
    type: notification
  reaction:
    name: Reaction
    type: reaction
  user:
    x-addon: dashboard
    name: User
    type: user
  comment:
    x-addon: vanilla
    name: Comment
    type: comment
  discussion:
    x-addon: vanilla
    name: Discussion
    type: discussion
  escalation:
    x-addon: vanilla
    name: Escalation
    type: cmdEscalation
  report:
    x-addon: vanilla
    name: Report
    type: report
  userNote:
    x-addon: warnings2
    name: User Note
    type: userNote
x-aliases:
  AssetOut:
    type:
      description: The type of the asset.
      type: string
    url:
      type: string
      description: Absolute URL of the asset.
    content-type:
      description: The content-type of the asset.
      type: string
      example: application/json
  StringAssetOut:
    type:
      description: The type of the asset.
      type: string
    url:
      type: string
      description: Absolute URL of the asset.
    content-type:
      description: The content-type of the asset.
      type: string
      example: application/json
    data:
      type: string
      description: Contents of the asset. May require an expand parameter to retreive.
    '200':
      content:
        application/json:
          schema:
            description: Contents of an asset.
            type: object
            properties:
              type:
                description: The type of the asset.
                type: string
                example: html
                enum:
                - html
                - css
                - js
              data:
                type: string
                example: <header>Hello Footer<footer />
                description: Contents of the asset. May require an expand parameter to retreive.
              content-type:
                description: The content-type of the asset.
                type: string
                example: text/html
              url:
                type: string
                description: Absolute URL of the resource.
                example: https://site.com/api/v2/themes/:themeID/assets/:assetName.ext?v=faasdf42d
      description: Success
  ThemeSlug:
    description: Unique theme slug.
    in: path
    name: themeID
    required: true
    schema:
      type: string
  AssetNotFound:
    description: JavaScript could not be found.
    content:
      application/json:
        schema:
          type: object
          properties:
            description:
              description: Verbose description of the error.
              nullable: true
              type: string
            message:
              description: Short description of the error.
              type: string
            status:
              description: Status code of the error response.
              type: integer
          required:
          - description
          - message
          - status
  ThemeIDParam:
    description: Unique themeID.
    in: path
    name: themeID
    required: true
    schema:
      type: integer
  StringAssetIn:
    description: An asset to be inserted.
    type: object
    properties:
      type:
        description: The type of the asset.
        type: string
        example: html
        enum:
        - html
        - css
        - js
      data:
        type: string
        example: <header>Hello Footer<footer />
        description: Contents of the asset. May require an expand parameter to retreive.
  JsonAssetIn:
    description: An asset to be inserted.
    type: object
    properties:
      type:
        type: string
        example: json
      data:
        type: object
        description: JSON content of the asset.
        example:
          global:
            mainColors:
              primary: '#5cc530'
  JsonAssetOut:
    '200':
      content:
        application/json:
          schema:
            type: object
            properties:
              type:
                type: string
                example: json
              data:
                type: object
                description: JSON content of the asset.
                example:
                  global:
                    mainColors:
                      primary: '#5cc530'
              content-type:
                description: The content-type of the asset.
                type: string
                example: application/json
              url:
                type: string
                description: Absolute URL of the resource.
                example: https://site.com/api/v2/themes/:themeID/assets/:assetName.ext?v=faasdf42d
      description: Success
  DeleteAsset:
    parameters:
    - description: Unique themeID.
      in: path
      name: themeID
      required: true
      schema:
        type: integer
    responses:
      '204':
        description: Success
    tags:
    - Theme Assets
    summary: Delete theme asset.
  StringPutAsset:
    parameters:
    - description: Unique themeID.
      in: path
      name: themeID
      required: true
      schema:
        type: integer
    requestBody:
      required: true
      content:
        application/json:
          schema:
            description: An asset to be inserted.
            type: object
            properties:
              type:
                description: The type of the asset.
                type: string
                example: html
                enum:
                - html
                - css
                - js
              data:
                type: string
                example: <header>Hello Footer<footer />
                description: Contents of the asset. May require an expand parameter to retreive.
    responses:
      '200':
        content:
          application/json:
            schema:
              description: Contents of an asset.
              type: object
              properties:
                type:
                  description: The type of the asset.
                  type: string
                  example: html
                  enum:
                  - html
                  - css
                  - js
                data:
                  type: string
                  example: <header>Hello Footer<footer />
                  description: Contents of the asset. May require an expand parameter to retreive.
                content-type:
                  description: The content-type of the asset.
                  type: string
                  example: text/html
                url:
                  type: string
                  description: Absolute URL of the resource.
                  example: https://site.com/api/v2/themes/:themeID/assets/:assetName.ext?v=faasdf42d
        description: Success
    tags:
    - Theme Assets
    summary: Set theme asset or replace if already exists.
  HtmlPutAssetContentType:
    parameters:
    - description: Unique themeID.
      in: path
      name: themeID
      required: true
      schema:
        type: integer
    requestBody:
      required: true
      content:
        text/html:
          schema:
            type: string
            description: HTML contents.
            example: <div>Hello HTML Asset!</div>
    responses:
      '200':
        content:
          text/html:
            schema:
              type: string
              description: HTML contents.
              example: <div>Hello HTML Asset!</div>
        description: Success
    tags:
    - Theme Assets
    summary: Set theme asset or replace if already exists.
  JsPutAssetContentType:
    parameters:
    - description: Unique themeID.
      in: path
      name: themeID
      required: true
      schema:
        type: integer
    requestBody:
      required: true
      content:
        application/javascript:
          schema:
            type: string
            description: HTML contents.
            example: console.log('Hello Javascript')
    responses:
      '200':
        content:
          application/javascript:
            schema:
              type: string
              description: HTML contents.
              example: console.log('Hello Javascript')
        description: Success
    tags:
    - Theme Assets
    summary: Set theme asset or replace if already exists.
  CssPutAssetContentType:
    parameters:
    - description: Unique themeID.
      in: path
      name: themeID
      required: true
      schema:
        type: integer
    requestBody:
      required: true
      content:
        text/css:
          schema:
            type: string
            description: HTML contents.
            example: ".class {\n   color: orange;\n}\n"
    responses:
      '200':
        content:
          text/css:
            schema:
              type: string
              description: HTML contents.
              example: ".class {\n   color: orange;\n}\n"
        description: Success
    tags:
    - Theme Assets
    summary: Set theme asset or replace if already exists.
  JsonPutAsset:
    parameters:
    - description: Unique themeID.
      in: path
      name: themeID
      required: true
      schema:
        type: integer
    requestBody:
      required: true
      content:
        application/json:
          schema:
            description: An asset to be inserted.
            type: object
            properties:
              type:
                type: string
                example: json
              data:
                type: object
                description: JSON content of the asset.
                example:
                  global:
                    mainColors:
                      primary: '#5cc530'
    responses:
      '200':
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  example: json
                data:
                  type: object
                  description: JSON content of the asset.
                  example:
                    global:
                      mainColors:
                        primary: '#5cc530'
                content-type:
                  description: The content-type of the asset.
                  type: string
                  example: application/json
                url:
                  type: string
                  description: Absolute URL of the resource.
                  example: https://site.com/api/v2/themes/:themeID/assets/:assetName.ext?v=faasdf42d
        description: Success
    tags:
    - Theme Assets
    summary: Set theme asset or replace if already exists.
  JsonPutAssetContentType:
    parameters:
    - description: Unique themeID.
      in: path
      name: themeID
      required: true
      schema:
        type: integer
    requestBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            description: JSON contents of the asset.
            example:
              hello:
                json:
                  asset: true
    responses:
      '200':
        content:
          application/json:
            schema:
              type: object
              description: JSON contents of the asset.
              example:
                hello:
                  json:
                    asset: true
        description: Success
    tags:
    - Theme Assets
    summary: Set theme asset or replace if already exists.