openapi: 3.0.1
servers:
  - url: https://api.hubapi.com/
info:
  description: Create custom workflow actions
  title: Custom Workflow Actions
  version: v4
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_developers.hubspot.com_hubfs_assets_hubspot.com_buzz_HubSpotOpenGraph.png
  x-origin:
    - format: openapi
      url: https://api.hubspot.com/api-catalog-public/v1/apis/automation/v4/actions
      version: "3.0"
  x-providerName: hubapi.com
  x-serviceName: automation
tags:
  - description: Operations to configure custom workflow actions.
    name: Definitions
  - description: Operations to configure the functions associated with custom workflow actions.
    name: Functions
  - description: Operations to retrieve the revisions for custom workflow actions.
    name: Revisions
  - description: Operations to complete callbacks for custom workflow actions.
    name: Callbacks
paths:
  /automation/v4/actions/callbacks/complete:
    post:
      description: Completes the given action callbacks.
      operationId: post-/automation/v4/actions/callbacks/complete_completeBatch
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BatchInputCallbackCompletionBatchRequest"
        description: The result of the completed action.
        required: true
      responses:
        "204":
          content: {}
          description: No content
        default:
          $ref: "#/components/responses/Error"
      security:
        - oauth2_legacy:
            - automation
        - hapikey: []
        - private_apps_legacy: []
      summary: Complete a batch of callbacks
      tags:
        - Callbacks
  "/automation/v4/actions/callbacks/{callbackId}/complete":
    post:
      description: Completes the given action callback.
      operationId: post-/automation/v4/actions/callbacks/{callbackId}/complete_complete
      parameters:
        - description: The ID of the target app.
          explode: false
          in: path
          name: callbackId
          required: true
          schema:
            type: string
          style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CallbackCompletionRequest"
        description: The result of the completed action.
        required: true
      responses:
        "204":
          content: {}
          description: No content
        default:
          $ref: "#/components/responses/Error"
      security:
        - oauth2_legacy:
            - automation
        - hapikey: []
        - private_apps_legacy: []
      summary: Complete a callback
      tags:
        - Callbacks
  "/automation/v4/actions/{appId}":
    get:
      description: Returns a list of all custom workflow actions.
      operationId: get-/automation/v4/actions/{appId}_getPage
      parameters:
        - description: Maximum number of results per page.
          explode: true
          in: query
          name: limit
          required: false
          schema:
            format: int32
            type: integer
          style: form
        - description: The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.
          explode: true
          in: query
          name: after
          required: false
          schema:
            type: string
          style: form
        - description: Whether to include archived custom actions.
          explode: true
          in: query
          name: archived
          required: false
          schema:
            default: false
            type: boolean
          style: form
        - explode: false
          in: path
          name: appId
          required: true
          schema:
            format: int32
            type: integer
          style: simple
      responses:
        "200":
          content:
            application/json:
              example:
                paging:
                  next:
                    after: b3B0aW9uXzEy
                results:
                  - actionUrl: https://example.com/custom-workflow-action
                    functions:
                      - functionType: PRE_ACTION_EXECUTION
                      - functionType: PRE_FETCH_OPTIONS
                        id: widgetSize
                    id: "1"
                    inputFieldDependencies:
                      - controllingFieldName: widgetSize
                        dependencyType: SINGLE_FIELD
                        dependentFieldNames:
                          - widgetName
                          - widgetColor
                    inputFields:
                      - required: true
                        supportedValueTypes:
                          - OBJECT_PROPERTY
                        typeDefinition:
                          fieldType: text
                          name: widgetName
                          type: string
                      - required: false
                        supportedValueTypes:
                          - STATIC_VALUE
                        typeDefinition:
                          fieldType: enumeration
                          name: widgetColor
                          options:
                            - label: Blue
                              value: blue
                            - label: Red
                              value: red
                          type: string
                      - required: false
                        supportedValueTypes:
                          - STATIC_VALUE
                        typeDefinition:
                          fieldType: enumeration
                          name: widgetSize
                          optionsUrl: https://example.com/widget-sizes
                          type: string
                    labels:
                      en:
                        actionCardContent: Create new widget {{ widgetName }}
                        actionDescription: This action will create a new widget in our system. So cool!
                        actionName: Create new widget
                        inputFieldDescriptions:
                          widgetColor: This is the color that will be used to paint the widget.
                          widgetName: Enter the full widget name. I support <a href="https://hubspot.com">links</a> too.
                        inputFieldLabels:
                          widgetColor: Widget Color
                          widgetName: Widget Name
                          widgetSize: Widget Size
                    objectRequestOptions:
                      properties:
                        - firstname
                        - lastname
                        - preferred_widget
                    objectTypes:
                      - CONTACT
                      - COMPANY
                    published: true
                    revisionId: "1"
                  - actionUrl: https://example.com/custom-workflow-action-2
                    id: "2"
                    published: false
                    revisionId: "1"
              schema:
                $ref: "#/components/schemas/CollectionResponseExtensionActionDefinitionForwardPaging"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - developer_hapikey: []
      summary: Get all custom actions
      tags:
        - Definitions
    post:
      description: Creates a new custom workflow action.
      operationId: post-/automation/v4/actions/{appId}_create
      parameters:
        - explode: false
          in: path
          name: appId
          required: true
          schema:
            format: int32
            type: integer
          style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ExtensionActionDefinitionInput"
        description: The custom workflow action to create.
        required: true
      responses:
        "201":
          content:
            application/json:
              example:
                actionUrl: https://example.com/custom-workflow-action
                functions:
                  - functionType: PRE_ACTION_EXECUTION
                  - functionType: PRE_FETCH_OPTIONS
                    id: widgetSize
                id: "1"
                inputFieldDependencies:
                  - controllingFieldName: widgetSize
                    dependencyType: SINGLE_FIELD
                    dependentFieldNames:
                      - widgetName
                      - widgetColor
                inputFields:
                  - required: true
                    supportedValueTypes:
                      - OBJECT_PROPERTY
                    typeDefinition:
                      fieldType: text
                      name: widgetName
                      type: string
                  - required: false
                    supportedValueTypes:
                      - STATIC_VALUE
                    typeDefinition:
                      fieldType: enumeration
                      name: widgetColor
                      options:
                        - label: Blue
                          value: blue
                        - label: Red
                          value: red
                      type: string
                  - required: false
                    supportedValueTypes:
                      - STATIC_VALUE
                    typeDefinition:
                      fieldType: enumeration
                      name: widgetSize
                      optionsUrl: https://example.com/widget-sizes
                      type: string
                labels:
                  en:
                    actionCardContent: Create new widget {{ widgetName }}
                    actionDescription: This action will create a new widget in our system. So cool!
                    actionName: Create new widget
                    inputFieldDescriptions:
                      widgetColor: This is the color that will be used to paint the widget.
                      widgetName: Enter the full widget name. I support <a href="https://hubspot.com">links</a> too.
                    inputFieldLabels:
                      widgetColor: Widget Color
                      widgetName: Widget Name
                      widgetSize: Widget Size
                objectRequestOptions:
                  properties:
                    - firstname
                    - lastname
                    - preferred_widget
                objectTypes:
                  - CONTACT
                  - COMPANY
                published: true
                revisionId: "1"
              schema:
                $ref: "#/components/schemas/ExtensionActionDefinition"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - developer_hapikey: []
      summary: Create new custom action
      tags:
        - Definitions
  "/automation/v4/actions/{appId}/{definitionId}":
    delete:
      description: Archives a single custom workflow action with the specified ID. Workflows that currently use this custom action will stop attempting to execute the action, and all future executions will be marked as a failure.
      operationId: delete-/automation/v4/actions/{appId}/{definitionId}_archive
      parameters:
        - description: The ID of the custom workflow action.
          explode: false
          in: path
          name: definitionId
          required: true
          schema:
            type: string
          style: simple
        - explode: false
          in: path
          name: appId
          required: true
          schema:
            format: int32
            type: integer
          style: simple
      responses:
        "204":
          content: {}
          description: No content
        default:
          $ref: "#/components/responses/Error"
      security:
        - developer_hapikey: []
      summary: Archive a custom action
      tags:
        - Definitions
    get:
      description: Returns a single custom workflow action with the specified ID.
      operationId: get-/automation/v4/actions/{appId}/{definitionId}_getById
      parameters:
        - description: The ID of the custom workflow action.
          explode: false
          in: path
          name: definitionId
          required: true
          schema:
            type: string
          style: simple
        - description: Whether to include archived custom actions.
          explode: true
          in: query
          name: archived
          required: false
          schema:
            default: false
            type: boolean
          style: form
        - explode: false
          in: path
          name: appId
          required: true
          schema:
            format: int32
            type: integer
          style: simple
      responses:
        "200":
          content:
            application/json:
              example:
                actionUrl: https://example.com/custom-workflow-action
                functions:
                  - functionType: PRE_ACTION_EXECUTION
                  - functionType: PRE_FETCH_OPTIONS
                    id: widgetSize
                id: "1"
                inputFieldDependencies:
                  - controllingFieldName: widgetSize
                    dependencyType: SINGLE_FIELD
                    dependentFieldNames:
                      - widgetName
                      - widgetColor
                inputFields:
                  - required: true
                    supportedValueTypes:
                      - OBJECT_PROPERTY
                    typeDefinition:
                      fieldType: text
                      name: widgetName
                      type: string
                  - required: false
                    supportedValueTypes:
                      - STATIC_VALUE
                    typeDefinition:
                      fieldType: enumeration
                      name: widgetColor
                      options:
                        - label: Blue
                          value: blue
                        - label: Red
                          value: red
                      type: string
                  - required: false
                    supportedValueTypes:
                      - STATIC_VALUE
                    typeDefinition:
                      fieldType: enumeration
                      name: widgetSize
                      optionsUrl: https://example.com/widget-sizes
                      type: string
                labels:
                  en:
                    actionCardContent: Create new widget {{ widgetName }}
                    actionDescription: This action will create a new widget in our system. So cool!
                    actionName: Create new widget
                    inputFieldDescriptions:
                      widgetColor: This is the color that will be used to paint the widget.
                      widgetName: Enter the full widget name. I support <a href="https://hubspot.com">links</a> too.
                    inputFieldLabels:
                      widgetColor: Widget Color
                      widgetName: Widget Name
                      widgetSize: Widget Size
                objectRequestOptions:
                  properties:
                    - firstname
                    - lastname
                    - preferred_widget
                objectTypes:
                  - CONTACT
                  - COMPANY
                published: true
                revisionId: "1"
              schema:
                $ref: "#/components/schemas/ExtensionActionDefinition"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - developer_hapikey: []
      summary: Get a custom action
      tags:
        - Definitions
    patch:
      description: Updates a custom workflow action with new values for the specified fields.
      operationId: patch-/automation/v4/actions/{appId}/{definitionId}_update
      parameters:
        - description: The ID of the custom workflow action.
          explode: false
          in: path
          name: definitionId
          required: true
          schema:
            type: string
          style: simple
        - explode: false
          in: path
          name: appId
          required: true
          schema:
            format: int32
            type: integer
          style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ExtensionActionDefinitionPatch"
        description: The custom workflow action fields to be updated.
        required: true
      responses:
        "200":
          content:
            application/json:
              example:
                actionUrl: https://example.com/custom-workflow-action
                functions:
                  - functionType: PRE_ACTION_EXECUTION
                  - functionType: PRE_FETCH_OPTIONS
                    id: widgetSize
                id: "1"
                inputFieldDependencies:
                  - controllingFieldName: widgetSize
                    dependencyType: SINGLE_FIELD
                    dependentFieldNames:
                      - widgetName
                      - widgetColor
                inputFields:
                  - required: true
                    supportedValueTypes:
                      - OBJECT_PROPERTY
                    typeDefinition:
                      fieldType: text
                      name: widgetName
                      type: string
                  - required: false
                    supportedValueTypes:
                      - STATIC_VALUE
                    typeDefinition:
                      fieldType: enumeration
                      name: widgetColor
                      options:
                        - label: Blue
                          value: blue
                        - label: Red
                          value: red
                        - label: Green
                          value: green
                      type: string
                  - required: false
                    supportedValueTypes:
                      - STATIC_VALUE
                    typeDefinition:
                      fieldType: enumeration
                      name: widgetSize
                      optionsUrl: https://example.com/widget-sizes
                      type: string
                labels:
                  en:
                    actionCardContent: Create new widget {{ widgetName }}
                    actionDescription: This action will create a new widget in our system. So cool!
                    actionName: Create new widget
                    inputFieldDescriptions:
                      widgetColor: This is the color that will be used to paint the widget.
                      widgetName: Enter the full widget name. I support <a href="https://hubspot.com">links</a> too.
                    inputFieldLabels:
                      widgetColor: Widget Color
                      widgetName: Widget Name
                      widgetSize: Widget Size
                objectRequestOptions:
                  properties:
                    - firstname
                    - lastname
                    - preferred_widget
                objectTypes:
                  - CONTACT
                  - COMPANY
                published: true
                revisionId: "1"
              schema:
                $ref: "#/components/schemas/ExtensionActionDefinition"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - developer_hapikey: []
      summary: Update a custom action
      tags:
        - Definitions
  "/automation/v4/actions/{appId}/{definitionId}/functions":
    get:
      description: Returns a list of all functions that are associated with the given custom workflow action.
      operationId: get-/automation/v4/actions/{appId}/{definitionId}/functions_getPage
      parameters:
        - description: The ID of the custom workflow action.
          explode: false
          in: path
          name: definitionId
          required: true
          schema:
            type: string
          style: simple
        - explode: false
          in: path
          name: appId
          required: true
          schema:
            format: int32
            type: integer
          style: simple
      responses:
        "200":
          content:
            application/json:
              example:
                paging:
                  next:
                    after: b3B0aW9uXzEy
                results:
                  - functionType: PRE_ACTION_EXECUTION
                  - functionType: PRE_FETCH_OPTIONS
                    id: widgetSize
              schema:
                $ref: "#/components/schemas/CollectionResponseActionFunctionIdentifierNoPaging"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - developer_hapikey: []
      summary: Get all custom action functions
      tags:
        - Functions
  "/automation/v4/actions/{appId}/{definitionId}/functions/{functionType}":
    delete:
      description: Delete a function for a custom workflow action. This will remove the function itself as well as removing the association between the function and the custom action. This can't be undone.
      operationId: delete-/automation/v4/actions/{appId}/{definitionId}/functions/{functionType}_archiveByFunctionType
      parameters:
        - description: The ID of the custom workflow action.
          explode: false
          in: path
          name: definitionId
          required: true
          schema:
            type: string
          style: simple
        - description: The type of function. This determines when the function will be called.
          explode: false
          in: path
          name: functionType
          required: true
          schema:
            enum:
              - PRE_ACTION_EXECUTION
              - PRE_FETCH_OPTIONS
              - POST_FETCH_OPTIONS
            type: string
          style: simple
        - explode: false
          in: path
          name: appId
          required: true
          schema:
            format: int32
            type: integer
          style: simple
      responses:
        "204":
          content: {}
          description: No content
        default:
          $ref: "#/components/responses/Error"
      security:
        - developer_hapikey: []
      summary: Delete a custom action function
      tags:
        - Functions
    get:
      description: Returns the given function for a custom workflow action.
      operationId: get-/automation/v4/actions/{appId}/{definitionId}/functions/{functionType}_getByFunctionType
      parameters:
        - description: The ID of the custom workflow action.
          explode: false
          in: path
          name: definitionId
          required: true
          schema:
            type: string
          style: simple
        - description: The type of function. This determines when the function will be called.
          explode: false
          in: path
          name: functionType
          required: true
          schema:
            enum:
              - PRE_ACTION_EXECUTION
              - PRE_FETCH_OPTIONS
              - POST_FETCH_OPTIONS
            type: string
          style: simple
        - explode: false
          in: path
          name: appId
          required: true
          schema:
            format: int32
            type: integer
          style: simple
      responses:
        "200":
          content:
            application/json:
              example:
                functionSource: |-
                  exports.main = (event, callback) => { return callback(transformRequest(event)); };
                  function transformRequest(request) { return { webhookUrl: request.webhookUrl, body: JSON.stringify(request.body), httpMethod: "POST" } }
                functionType: PRE_ACTION_EXECUTION
              schema:
                $ref: "#/components/schemas/ActionFunction"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - developer_hapikey: []
      summary: Get a custom action function
      tags:
        - Functions
    put:
      description: Creates or replaces a function for a custom workflow action.
      operationId: put-/automation/v4/actions/{appId}/{definitionId}/functions/{functionType}_createOrReplaceByFunctionType
      parameters:
        - description: The ID of the custom workflow action.
          explode: false
          in: path
          name: definitionId
          required: true
          schema:
            type: string
          style: simple
        - description: The type of function. This determines when the function will be called.
          explode: false
          in: path
          name: functionType
          required: true
          schema:
            enum:
              - PRE_ACTION_EXECUTION
              - PRE_FETCH_OPTIONS
              - POST_FETCH_OPTIONS
            type: string
          style: simple
        - explode: false
          in: path
          name: appId
          required: true
          schema:
            format: int32
            type: integer
          style: simple
      requestBody:
        content:
          text/plain:
            schema:
              type: string
        description: The function source code. Must be valid JavaScript code.
        required: true
      responses:
        "200":
          content:
            application/json:
              example:
                functionType: PRE_ACTION_EXECUTION
              schema:
                $ref: "#/components/schemas/ActionFunctionIdentifier"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - developer_hapikey: []
      summary: Create or replace a custom action function
      tags:
        - Functions
  "/automation/v4/actions/{appId}/{definitionId}/functions/{functionType}/{functionId}":
    delete:
      description: Delete a function for a custom workflow action. This will remove the function itself as well as removing the association between the function and the custom action. This can't be undone.
      operationId: delete-/automation/v4/actions/{appId}/{definitionId}/functions/{functionType}/{functionId}_archive
      parameters:
        - description: The ID of the custom workflow action
          explode: false
          in: path
          name: definitionId
          required: true
          schema:
            type: string
          style: simple
        - description: The type of function. This determines when the function will be called.
          explode: false
          in: path
          name: functionType
          required: true
          schema:
            enum:
              - PRE_ACTION_EXECUTION
              - PRE_FETCH_OPTIONS
              - POST_FETCH_OPTIONS
            type: string
          style: simple
        - description: The ID qualifier for the function. This is used to specify which input field a function is associated with for `PRE_FETCH_OPTIONS` and `POST_FETCH_OPTIONS` function types.
          explode: false
          in: path
          name: functionId
          required: true
          schema:
            type: string
          style: simple
        - explode: false
          in: path
          name: appId
          required: true
          schema:
            format: int32
            type: integer
          style: simple
      responses:
        "204":
          content: {}
          description: No content
        default:
          $ref: "#/components/responses/Error"
      security:
        - developer_hapikey: []
      summary: Delete a custom action function
      tags:
        - Functions
    get:
      description: Returns the given function for a custom workflow action.
      operationId: get-/automation/v4/actions/{appId}/{definitionId}/functions/{functionType}/{functionId}_getById
      parameters:
        - description: The ID of the custom workflow action.
          explode: false
          in: path
          name: definitionId
          required: true
          schema:
            type: string
          style: simple
        - description: The type of function. This determines when the function will be called.
          explode: false
          in: path
          name: functionType
          required: true
          schema:
            enum:
              - PRE_ACTION_EXECUTION
              - PRE_FETCH_OPTIONS
              - POST_FETCH_OPTIONS
            type: string
          style: simple
        - description: The ID qualifier for the function. This is used to specify which input field a function is associated with for `PRE_FETCH_OPTIONS` and `POST_FETCH_OPTIONS` function types.
          explode: false
          in: path
          name: functionId
          required: true
          schema:
            type: string
          style: simple
        - explode: false
          in: path
          name: appId
          required: true
          schema:
            format: int32
            type: integer
          style: simple
      responses:
        "200":
          content:
            application/json:
              example:
                functionSource: |-
                  exports.main = (event, callback) => { return callback(transformRequest(event)); };
                  function transformRequest(request) { return { webhookUrl: request.webhookUrl, body: JSON.stringify(request.body), httpMethod: "POST" } }
                functionType: PRE_FETCH_OPTIONS
                id: widgetSize
              schema:
                $ref: "#/components/schemas/ActionFunction"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - developer_hapikey: []
      summary: Get a custom action function
      tags:
        - Functions
    put:
      description: Creates or replaces a function for a custom workflow action.
      operationId: put-/automation/v4/actions/{appId}/{definitionId}/functions/{functionType}/{functionId}_createOrReplace
      parameters:
        - description: The ID of the custom workflow action.
          explode: false
          in: path
          name: definitionId
          required: true
          schema:
            type: string
          style: simple
        - description: The type of function. This determines when the function will be called.
          explode: false
          in: path
          name: functionType
          required: true
          schema:
            enum:
              - PRE_ACTION_EXECUTION
              - PRE_FETCH_OPTIONS
              - POST_FETCH_OPTIONS
            type: string
          style: simple
        - description: The ID qualifier for the function. This is used to specify which input field a function is associated with for `PRE_FETCH_OPTIONS` and `POST_FETCH_OPTIONS` function types.
          explode: false
          in: path
          name: functionId
          required: true
          schema:
            type: string
          style: simple
        - explode: false
          in: path
          name: appId
          required: true
          schema:
            format: int32
            type: integer
          style: simple
      requestBody:
        content:
          text/plain:
            schema:
              type: string
        description: The function source code. Must be valid JavaScript code.
        required: true
      responses:
        "200":
          content:
            application/json:
              example:
                functionType: PRE_FETCH_OPTIONS
                id: widgetSize
              schema:
                $ref: "#/components/schemas/ActionFunctionIdentifier"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - developer_hapikey: []
      summary: Create or replace a custom action function
      tags:
        - Functions
  "/automation/v4/actions/{appId}/{definitionId}/revisions":
    get:
      description: Returns a list of revisions for a custom workflow action.
      operationId: get-/automation/v4/actions/{appId}/{definitionId}/revisions_getPage
      parameters:
        - description: The ID of the custom workflow action
          explode: false
          in: path
          name: definitionId
          required: true
          schema:
            type: string
          style: simple
        - description: Maximum number of results per page.
          explode: true
          in: query
          name: limit
          required: false
          schema:
            format: int32
            type: integer
          style: form
        - description: The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.
          explode: true
          in: query
          name: after
          required: false
          schema:
            type: string
          style: form
        - explode: false
          in: path
          name: appId
          required: true
          schema:
            format: int32
            type: integer
          style: simple
      responses:
        "200":
          content:
            application/json:
              example:
                paging:
                  next:
                    after: b3B0aW9uXzEy
                results:
                  - definition:
                      actionUrl: https://example.com/custom-workflow-action
                      functions:
                        - functionType: PRE_ACTION_EXECUTION
                        - functionType: PRE_FETCH_OPTIONS
                          id: widgetSize
                      id: "1"
                      inputFieldDependencies:
                        - controllingFieldName: widgetSize
                          dependencyType: SINGLE_FIELD
                          dependentFieldNames:
                            - widgetName
                            - widgetColor
                      inputFields:
                        - required: true
                          supportedValueTypes:
                            - OBJECT_PROPERTY
                          typeDefinition:
                            fieldType: text
                            name: widgetName
                            type: string
                        - required: false
                          supportedValueTypes:
                            - STATIC_VALUE
                          typeDefinition:
                            fieldType: enumeration
                            name: widgetColor
                            options:
                              - label: Blue
                                value: blue
                              - label: Red
                                value: red
                            type: string
                        - required: false
                          supportedValueTypes:
                            - STATIC_VALUE
                          typeDefinition:
                            fieldType: enumeration
                            name: widgetSize
                            optionsUrl: https://example.com/widget-sizes
                            type: string
                      labels:
                        en:
                          actionCardContent: Create new widget {{ widgetName }}
                          actionDescription: This action will create a new widget in our system. So cool!
                          actionName: Create new widget
                          inputFieldDescriptions:
                            widgetColor: This is the color that will be used to paint the widget.
                            widgetName: Enter the full widget name. I support <a href="https://hubspot.com">links</a> too.
                          inputFieldLabels:
                            widgetColor: Widget Color
                            widgetName: Widget Name
                            widgetSize: Widget Size
                      objectRequestOptions:
                        properties:
                          - firstname
                          - lastname
                          - preferred_widget
                      objectTypes:
                        - CONTACT
                        - COMPANY
                      published: true
                      revisionId: "1"
                    id: "1"
                    insertedAt: 2020-04-30T00:00:00
                    revisionId: "1"
                  - definition:
                      actionUrl: https://example.com/custom-workflow-action-2
                      id: "2"
                      published: false
                      revisionId: "1"
                    id: "2"
                    insertedAt: 2020-04-30T00:00:00
                    revisionId: "1"
              schema:
                $ref: "#/components/schemas/CollectionResponseActionRevisionForwardPaging"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - developer_hapikey: []
      summary: Get all revisions for a custom action
      tags:
        - Revisions
  "/automation/v4/actions/{appId}/{definitionId}/revisions/{revisionId}":
    get:
      description: Returns the given version of a custom workflow action.
      operationId: get-/automation/v4/actions/{appId}/{definitionId}/revisions/{revisionId}_getById
      parameters:
        - description: The ID of the custom workflow action.
          explode: false
          in: path
          name: definitionId
          required: true
          schema:
            type: string
          style: simple
        - description: The version of the custom workflow action.
          explode: false
          in: path
          name: revisionId
          required: true
          schema:
            type: string
          style: simple
        - explode: false
          in: path
          name: appId
          required: true
          schema:
            format: int32
            type: integer
          style: simple
      responses:
        "200":
          content:
            application/json:
              example:
                definition:
                  actionUrl: https://example.com/custom-workflow-action
                  functions:
                    - functionType: PRE_ACTION_EXECUTION
                    - functionType: PRE_FETCH_OPTIONS
                      id: widgetSize
                  id: "1"
                  inputFieldDependencies:
                    - controllingFieldName: widgetSize
                      dependencyType: SINGLE_FIELD
                      dependentFieldNames:
                        - widgetName
                        - widgetColor
                  inputFields:
                    - required: true
                      supportedValueTypes:
                        - OBJECT_PROPERTY
                      typeDefinition:
                        fieldType: text
                        name: widgetName
                        type: string
                    - required: false
                      supportedValueTypes:
                        - STATIC_VALUE
                      typeDefinition:
                        fieldType: enumeration
                        name: widgetColor
                        options:
                          - label: Blue
                            value: blue
                          - label: Red
                            value: red
                        type: string
                    - required: false
                      supportedValueTypes:
                        - STATIC_VALUE
                      typeDefinition:
                        fieldType: enumeration
                        name: widgetSize
                        optionsUrl: https://example.com/widget-sizes
                        type: string
                  labels:
                    en:
                      actionCardContent: Create new widget {{ widgetName }}
                      actionDescription: This action will create a new widget in our system. So cool!
                      actionName: Create new widget
                      inputFieldDescriptions:
                        widgetColor: This is the color that will be used to paint the widget.
                        widgetName: Enter the full widget name. I support <a href="https://hubspot.com">links</a> too.
                      inputFieldLabels:
                        widgetColor: Widget Color
                        widgetName: Widget Name
                        widgetSize: Widget Size
                  objectRequestOptions:
                    properties:
                      - firstname
                      - lastname
                      - preferred_widget
                  objectTypes:
                    - CONTACT
                    - COMPANY
                  published: true
                  revisionId: "1"
                id: "1"
                insertedAt: 2020-04-30T00:00:00
                revisionId: "1"
              schema:
                $ref: "#/components/schemas/ActionRevision"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - developer_hapikey: []
      summary: Get a revision for a custom action
      tags:
        - Revisions
components:
  responses:
    Error:
      content:
        "*/*":
          schema:
            $ref: "#/components/schemas/Error"
      description: An error occurred.
  schemas:
    ActionFunction:
      description: A serverless function associated with this custom workflow action.
      properties:
        functionSource:
          description: The function source code.
          type: string
        functionType:
          description: The type of function. This determines when the function will be called.
          enum:
            - PRE_ACTION_EXECUTION
            - PRE_FETCH_OPTIONS
            - POST_FETCH_OPTIONS
          type: string
        id:
          description: The ID qualifier for the function. This is used to specify which input field a function is associated with for `PRE_FETCH_OPTIONS` and `POST_FETCH_OPTIONS` function types.
          type: string
      required:
        - functionSource
        - functionType
      type: object
    ActionFunctionIdentifier:
      description: A serverless function associated with this custom workflow action.
      properties:
        functionType:
          description: The type of function. This determines when the function will be called.
          enum:
            - PRE_ACTION_EXECUTION
            - PRE_FETCH_OPTIONS
            - POST_FETCH_OPTIONS
          type: string
        id:
          description: The ID qualifier for the function. This is used to specify which input field a function is associated with for `PRE_FETCH_OPTIONS` and `POST_FETCH_OPTIONS` function types.
          type: string
      required:
        - functionType
      type: object
    ActionLabels:
      description: User-facing labels for this custom workflow action.
      properties:
        actionCardContent:
          description: The label to be displayed in the action card of the workflow editor once this custom action has been added to a workflow.
          type: string
        actionDescription:
          description: A description for this custom action. This will show up in the action editor along with the input fields.
          type: string
        actionName:
          description: The name of this custom action. This is what will show up when users are selecting an action in the workflows app.
          type: string
        appDisplayName:
          description: The name to be displayed at the top of the action editor in the workflows app.
          type: string
        inputFieldDescriptions:
          additionalProperties:
            type: string
          description: A map of input field names to descriptions for the fields. These will show up as tooltips when users are editing your action.
          type: object
        inputFieldLabels:
          additionalProperties:
            type: string
          description: A map of input field names to the user-facing labels.
          type: object
      required:
        - actionName
      type: object
    ActionRevision:
      description: A revision of this custom action.
      properties:
        createdAt:
          description: The date the revision was created.
          format: date-time
          type: string
        definition:
          $ref: "#/components/schemas/ExtensionActionDefinition"
        id:
          type: string
        revisionId:
          description: The version number of the custom action.
          type: string
      required:
        - createdAt
        - definition
        - id
        - revisionId
      type: object
    BatchInputCallbackCompletionBatchRequest:
      properties:
        inputs:
          items:
            $ref: "#/components/schemas/CallbackCompletionBatchRequest"
          type: array
      required:
        - inputs
      type: object
    CallbackCompletionBatchRequest:
      description: Any information to send back to Workflows when completing an action callback as part of a batch request.
      example:
        callbackId: ap-123-123-123-0
        outputFields:
          hs_execution_state: SUCCESS
      properties:
        callbackId:
          description: The ID of the callback to complete.
          type: string
        outputFields:
          additionalProperties:
            type: string
          description: A map of action output names and values.
          type: object
      required:
        - callbackId
        - outputFields
      type: object
    CallbackCompletionRequest:
      description: Any information to send back to Workflows when completing an action callback.
      example:
        outputFields:
          hs_execution_state: SUCCESS
      properties:
        outputFields:
          additionalProperties:
            type: string
          description: A map of action output names and values.
          type: object
      required:
        - outputFields
      type: object
    CollectionResponseActionFunctionIdentifierNoPaging:
      properties:
        results:
          items:
            $ref: "#/components/schemas/ActionFunctionIdentifier"
          type: array
      required:
        - results
      type: object
    CollectionResponseActionRevisionForwardPaging:
      properties:
        paging:
          $ref: "#/components/schemas/ForwardPaging"
        results:
          items:
            $ref: "#/components/schemas/ActionRevision"
          type: array
      required:
        - results
      type: object
    CollectionResponseExtensionActionDefinitionForwardPaging:
      properties:
        paging:
          $ref: "#/components/schemas/ForwardPaging"
        results:
          items:
            $ref: "#/components/schemas/ExtensionActionDefinition"
          type: array
      required:
        - results
      type: object
    ConditionalSingleFieldDependency:
      properties:
        controllingFieldName:
          type: string
        controllingFieldValue:
          type: string
        dependencyType:
          default: CONDITIONAL_SINGLE_FIELD
          enum:
            - CONDITIONAL_SINGLE_FIELD
          type: string
        dependentFieldNames:
          items:
            type: string
          type: array
      required:
        - controllingFieldName
        - controllingFieldValue
        - dependencyType
        - dependentFieldNames
      title: CONDITIONAL_SINGLE_FIELD
      type: object
    Error:
      example:
        category: VALIDATION_ERROR
        correlationId: aeb5f871-7f07-4993-9211-075dc63e7cbf
        links:
          knowledge-base: https://www.hubspot.com/products/service/knowledge-base
        message: Invalid input (details will vary based on the error)
      properties:
        category:
          description: The error category
          type: string
        context:
          additionalProperties:
            items:
              type: string
            type: array
          description: Context about the error condition
          example:
            invalidPropertyName:
              - propertyValue
            missingScopes:
              - scope1
              - scope2
          type: object
        correlationId:
          description: A unique identifier for the request. Include this value with any error reports or support tickets
          example: aeb5f871-7f07-4993-9211-075dc63e7cbf
          format: uuid
          type: string
        errors:
          description: further information about the error
          items:
            $ref: "#/components/schemas/ErrorDetail"
          type: array
        links:
          additionalProperties:
            type: string
          description: A map of link names to associated URIs containing documentation about the error or recommended remediation steps
          type: object
        message:
          description: A human readable message describing the error along with remediation steps where appropriate
          example: An error occurred
          type: string
        subCategory:
          description: A specific category that contains more specific detail about the error
          type: string
      required:
        - category
        - correlationId
        - message
      type: object
    ErrorDetail:
      properties:
        code:
          description: The status code associated with the error detail
          type: string
        context:
          additionalProperties:
            items:
              type: string
            type: array
          description: Context about the error condition
          example:
            missingScopes:
              - scope1
              - scope2
          type: object
        in:
          description: The name of the field or parameter in which the error was found.
          type: string
        message:
          description: A human readable message describing the error along with remediation steps where appropriate
          type: string
        subCategory:
          description: A specific category that contains more specific detail about the error
          type: string
      required:
        - message
      type: object
    ExtensionActionDefinition:
      description: Configuration for custom workflow action.
      properties:
        actionUrl:
          description: The URL that will accept an HTTPS request each time workflows executes the custom action.
          type: string
        archivedAt:
          description: The date that this custom action was archived, if the custom action is archived.
          format: int64
          type: integer
        functions:
          description: A list of functions associated with the custom workflow action.
          items:
            $ref: "#/components/schemas/ActionFunctionIdentifier"
          type: array
        id:
          description: The ID of the custom action.
          type: string
        inputFieldDependencies:
          description: A list of dependencies between the input fields. These configure when the input fields should be visible.
          items:
            oneOf:
              - $ref: "#/components/schemas/SingleFieldDependency"
              - $ref: "#/components/schemas/ConditionalSingleFieldDependency"
          type: array
        inputFields:
          description: The list of input fields to display in this custom action.
          items:
            $ref: "#/components/schemas/InputFieldDefinition"
          type: array
        labels:
          additionalProperties:
            $ref: "#/components/schemas/ActionLabels"
          description: The user-facing labels for the custom action.
          type: object
        objectRequestOptions:
          $ref: "#/components/schemas/ObjectRequestOptions"
        objectTypes:
          description: The object types that this custom action supports.
          items:
            type: string
          type: array
        published:
          description: Whether this custom action is published to customers.
          type: boolean
        revisionId:
          type: string
      required:
        - actionUrl
        - functions
        - id
        - inputFields
        - labels
        - objectTypes
        - published
        - revisionId
      type: object
    ExtensionActionDefinitionInput:
      description: State of custom workflow action to be created.
      properties:
        actionUrl:
          description: The URL that will accept an HTTPS request each time workflows executes the custom action.
          type: string
        archivedAt:
          description: The date that this custom action was archived, if the custom action is archived.
          format: int64
          type: integer
        functions:
          description: A list of functions associated with the custom workflow action.
          items:
            $ref: "#/components/schemas/ActionFunction"
          type: array
        inputFieldDependencies:
          description: A list of dependencies between the input fields. These configure when the input fields should be visible.
          items:
            oneOf:
              - $ref: "#/components/schemas/SingleFieldDependency"
              - $ref: "#/components/schemas/ConditionalSingleFieldDependency"
          type: array
        inputFields:
          description: The list of input fields to display in this custom action.
          items:
            $ref: "#/components/schemas/InputFieldDefinition"
          type: array
        labels:
          additionalProperties:
            $ref: "#/components/schemas/ActionLabels"
          description: The user-facing labels for the custom action.
          type: object
        objectRequestOptions:
          $ref: "#/components/schemas/ObjectRequestOptions"
        objectTypes:
          description: The object types that this custom action supports.
          items:
            type: string
          type: array
        published:
          description: Whether this custom action is published to customers.
          type: boolean
      required:
        - actionUrl
        - functions
        - inputFields
        - labels
        - objectTypes
        - published
      type: object
    ExtensionActionDefinitionPatch:
      description: Fields on custom workflow action to be updated.
      properties:
        actionUrl:
          description: The URL that will accept an HTTPS request each time workflows executes the custom action.
          type: string
        inputFieldDependencies:
          description: A list of dependencies between the input fields. These configure when the input fields should be visible.
          items:
            oneOf:
              - $ref: "#/components/schemas/SingleFieldDependency"
              - $ref: "#/components/schemas/ConditionalSingleFieldDependency"
          type: array
        inputFields:
          description: The list of input fields to display in this custom action.
          items:
            $ref: "#/components/schemas/InputFieldDefinition"
          type: array
        labels:
          additionalProperties:
            $ref: "#/components/schemas/ActionLabels"
          description: The user-facing labels for the custom action.
          type: object
        objectRequestOptions:
          $ref: "#/components/schemas/ObjectRequestOptions"
        objectTypes:
          description: The object types that this custom action supports.
          items:
            type: string
          type: array
        published:
          description: Whether this custom action is published to customers.
          type: boolean
      type: object
    FieldTypeDefinition:
      description: The data type expected by an input field.
      properties:
        fieldType:
          description: Controls how the field appears in HubSpot.
          enum:
            - booleancheckbox
            - checkbox
            - date
            - file
            - number
            - phonenumber
            - radio
            - select
            - text
            - textarea
            - calculation_equation
            - calculation_rollup
            - calculation_score
            - calculation_read_time
            - unknown
          type: string
        name:
          description: The input field name.
          type: string
        options:
          description: A list of valid options for the field value.
          items:
            $ref: "#/components/schemas/Option"
          type: array
        optionsUrl:
          description: A URL that will accept HTTPS requests when the valid options for the field are fetched.
          type: string
        referencedObjectType:
          description: This can be set to `OWNER` if the field should contain a HubSpot owner value.
          enum:
            - CONTACT
            - COMPANY
            - DEAL
            - ENGAGEMENT
            - TICKET
            - OWNER
            - PRODUCT
            - LINE_ITEM
            - BET_DELIVERABLE_SERVICE
            - CONTENT
            - CONVERSATION
            - BET_ALERT
            - PORTAL
            - QUOTE
            - FORM_SUBMISSION_INBOUNDDB
            - QUOTA
            - UNSUBSCRIBE
            - COMMUNICATION
            - FEEDBACK_SUBMISSION
            - ATTRIBUTION
            - SALESFORCE_SYNC_ERROR
            - RESTORABLE_CRM_OBJECT
            - HUB
            - LANDING_PAGE
            - PRODUCT_OR_FOLDER
            - TASK
            - FORM
            - MARKETING_EMAIL
            - AD_ACCOUNT
            - AD_CAMPAIGN
            - AD_GROUP
            - AD
            - KEYWORD
            - CAMPAIGN
            - SOCIAL_CHANNEL
            - SOCIAL_POST
            - SITE_PAGE
            - BLOG_POST
            - IMPORT
            - EXPORT
            - CTA
            - TASK_TEMPLATE
            - AUTOMATION_PLATFORM_FLOW
            - OBJECT_LIST
            - NOTE
            - MEETING_EVENT
            - CALL
            - EMAIL
            - PUBLISHING_TASK
            - CONVERSATION_SESSION
            - CONTACT_CREATE_ATTRIBUTION
            - INVOICE
            - MARKETING_EVENT
            - CONVERSATION_INBOX
            - CHATFLOW
            - MEDIA_BRIDGE
            - SEQUENCE
            - SEQUENCE_STEP
            - FORECAST
            - SNIPPET
            - TEMPLATE
            - UNKNOWN
          type: string
        type:
          description: The data type of the field.
          enum:
            - string
            - number
            - bool
            - datetime
            - enumeration
            - date
            - phone_number
            - currency_number
            - json
            - object_coordinates
          type: string
      required:
        - name
        - options
        - type
      type: object
    ForwardPaging:
      properties:
        next:
          $ref: "#/components/schemas/NextPage"
      type: object
    InputFieldDefinition:
      description: Configuration for an input field on the custom action
      properties:
        isRequired:
          description: Whether the field is required for the custom action to be valid
          type: boolean
        supportedValueTypes:
          description: Controls what kind of input a customer can use to specify the field value. Must contain exactly one of `STATIC_VALUE` or `OBJECT_PROPERTY`. If `STATIC_VALUE`, the customer will be able to choose a value when configuring the custom action; if `OBJECT_PROPERTY`, the customer will be able to choose a property from the enrolled workflow object that the field value will be copied from. In the future we may support more than one input control type here.
          items:
            enum:
              - STATIC_VALUE
              - OBJECT_PROPERTY
              - FIELD_DATA
            type: string
          type: array
        typeDefinition:
          $ref: "#/components/schemas/FieldTypeDefinition"
      required:
        - isRequired
        - typeDefinition
      type: object
    NextPage:
      properties:
        after:
          type: string
        link:
          type: string
      required:
        - after
      type: object
    ObjectRequestOptions:
      description: Configures what properties of the enrolled CRM object are included in the action execution request
      properties:
        properties:
          description: A list of properties of the CRM object to include with the request to the `actionUrl`.
          items:
            type: string
          type: array
      required:
        - properties
      type: object
    Option:
      description: An option for a field value.
      properties:
        description:
          type: string
        displayOrder:
          format: int32
          type: integer
        doubleData:
          type: number
        hidden:
          type: boolean
        label:
          description: The user-facing label for the option.
          type: string
        readOnly:
          type: boolean
        value:
          description: The internal value for the option. This is what will be included in the execution request to the `actionUrl`.
          type: string
      required:
        - description
        - displayOrder
        - doubleData
        - hidden
        - label
        - readOnly
        - value
      type: object
    SingleFieldDependency:
      properties:
        controllingFieldName:
          type: string
        dependencyType:
          default: SINGLE_FIELD
          enum:
            - SINGLE_FIELD
          type: string
        dependentFieldNames:
          items:
            type: string
          type: array
      required:
        - controllingFieldName
        - dependencyType
        - dependentFieldNames
      title: SINGLE_FIELD
      type: object
  securitySchemes:
    developer_hapikey:
      in: query
      name: hapikey
      type: apiKey
    hapikey:
      in: query
      name: hapikey
      type: apiKey
    oauth2_legacy:
      flows:
        authorizationCode:
          authorizationUrl: https://app.hubspot.com/oauth/authorize
          scopes:
            automation: Read from and write to my Workflows
          tokenUrl: https://api.hubapi.com/oauth/v1/token
      type: oauth2
    private_apps_legacy:
      in: header
      name: private-app-legacy
      type: apiKey
x-hubspot-available-client-libraries:
  - PHP
  - Node
  - Python
  - Ruby
