Formbricks Action Classes API

Define code and no-code actions that trigger in-product surveys.

OpenAPI Specification

formbricks-action-classes-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Formbricks Action Classes API
  description: REST API for Formbricks, the open-source experience management and survey platform. The Management API (paths under /v1/management and /v2/management) requires a personal API key passed in the x-api-key header and gives full access to surveys, responses, contacts, contact attribute keys, action classes, webhooks, and account info. The Public Client API (/v1/client/{environmentId}) is unauthenticated and is used by survey front-ends to create displays and responses.
  termsOfService: https://formbricks.com/terms
  contact:
    name: Formbricks
    url: https://formbricks.com
  license:
    name: AGPL-3.0
    url: https://github.com/formbricks/formbricks/blob/main/LICENSE
  version: '2.0'
servers:
- url: https://app.formbricks.com/api
  description: Formbricks Cloud
tags:
- name: Action Classes
  description: Define code and no-code actions that trigger in-product surveys.
paths:
  /v1/management/action-classes:
    get:
      operationId: getActionClasses
      tags:
      - Action Classes
      summary: List action classes
      security:
      - apiKeyAuth: []
      responses:
        '200':
          description: A list of action classes.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ActionClass'
    post:
      operationId: createActionClass
      tags:
      - Action Classes
      summary: Create an action class
      security:
      - apiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActionClassInput'
      responses:
        '201':
          description: The created action class.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ActionClass'
  /v1/management/action-classes/{id}:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
    delete:
      operationId: deleteActionClass
      tags:
      - Action Classes
      summary: Delete an action class
      security:
      - apiKeyAuth: []
      responses:
        '200':
          description: The deleted action class.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ActionClass'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    ActionClass:
      type: object
      properties:
        id:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        name:
          type: string
        description:
          type: string
          nullable: true
        type:
          type: string
          enum:
          - code
          - noCode
        environmentId:
          type: string
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          additionalProperties: true
    ActionClassInput:
      type: object
      required:
      - name
      - type
      - environmentId
      properties:
        name:
          type: string
        description:
          type: string
        type:
          type: string
          enum:
          - code
          - noCode
        environmentId:
          type: string
  responses:
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Personal API key generated in Formbricks under Settings > API Keys.