> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Liferay Webhook Setup Guide

> Configure Liferay to deliver events to StackOne.

## Prerequisites

Before continuing, you should have already completed the following for this connector:

<Steps>
  <Step title="Configure the Connector">
    Enable the connector and set up its connector profile in your project. See <a href="/guides/explore-connectors">Managing Connectors</a>.

    <Columns cols={2}>
      <Card title="Connector Profile" href="/connectors/liferay/guides/connector-profile/oauth-2-0" icon="https://stackone-logos.com/api/liferay/filled/png" horizontal>
        Liferay - OAuth 2.0
      </Card>

      <Card title="Connector Profile" href="/connectors/liferay/guides/connector-profile/oauth-2-0-client-credentials" icon="https://stackone-logos.com/api/liferay/filled/png" horizontal>
        Liferay - OAuth 2.0 - Client Credentials
      </Card>
    </Columns>
  </Step>

  <Step title="Link an Account">
    Connect an account using <a href="/guides/embedding-stackone-hub">StackOne Hub</a> or <a href="/guides/auth-link">Auth Link</a>.

    <Columns cols={2}>
      <Card title="Link Account" href="/connectors/liferay/guides/link-account/oauth-2-0" icon="https://stackone-logos.com/api/liferay/filled/png" horizontal>
        Liferay - OAuth 2.0
      </Card>

      <Card title="Link Account" href="/connectors/liferay/guides/link-account/oauth-2-0-client-credentials" icon="https://stackone-logos.com/api/liferay/filled/png" horizontal>
        Liferay - OAuth 2.0 - Client Credentials
      </Card>
    </Columns>
  </Step>
</Steps>

<section data-guide-section data-guide-scopes="">
  <h2>Subscribe via the StackOne dashboard</h2>

  <p>This connector uses <strong>Programmatic Webhooks</strong>. Liferay delivers events through webhook-type Object Actions on its User, Account, and Organization system objects. When you enable webhook events for a connected Liferay account, StackOne automatically registers one object action per enabled event via Liferay's Object Admin REST API, each pointing at your StackOne callback URL — only the events you enable are registered in Liferay.</p>

  <Steps>
    <Step title="Enable the Object Admin REST scope">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>In Liferay, open <strong>Control Panel</strong> > <strong>Security</strong> > <strong>OAuth2 Administration</strong>, edit the StackOne application, and on the <strong>Scopes</strong> tab enable `Liferay.Object.Admin.REST.everything` alongside the other connector scopes. Reconnect the account afterwards so the new scope is granted.</p>

        <ul>
          <li>The connected user must be allowed to manage Objects — object action registration is an administrative operation.</li>
        </ul>
      </div>
    </Step>

    <Step title="Select event subscriptions in the dashboard">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>In the StackOne dashboard, open the Liferay connector profile and enable the webhook events you want delivered downstream. See the <strong>Available Webhook Events</strong> section below for the full list.</p>
      </div>
    </Step>

    <Step title="Registration on subscribe">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>When webhook events are enabled (or the event selection changes), StackOne registers the object actions on your behalf using the connected account's credentials. In Liferay they appear on each system object's <strong>Actions</strong> tab (Control Panel > <strong>Objects</strong>) with names starting with `stackone` (for example `stackoneUserCreated`).</p>

        <ul>
          <li>Liferay requires action names to be unique per object — if a previous registration was not cleaned up, remove any stale `stackone*` actions from the Actions tab before subscribing again.</li>
        </ul>
      </div>
    </Step>

    <Step title="Verify delivery">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Trigger a matching change in Liferay (for example, create a test user) and confirm the event reaches your downstream consumer.</p>

        <ul>
          <li>Liferay posts each event as a JSON payload; StackOne responds with `200 OK` automatically.</li>
          <li>Failed deliveries are not retried — Liferay marks the object action's last execution as failed (visible on the Actions tab).</li>
        </ul>
      </div>
    </Step>

    <Step title="Unsubscribe">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Changing your event selection automatically registers object actions for newly enabled events and deletes the ones for disabled events. Disconnecting the account deletes all StackOne-managed object actions, stopping deliveries.</p>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Available Webhook Events</h2>

  <p>The following Liferay events can be enabled. Each enabled event is registered as its own webhook object action in Liferay; disabled events are not registered at all.</p>

  <Steps>
    <Step title="User events">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Events on the User system object.</p>

        <ul>
          <li><strong>User Created</strong> (`L_USER:onAfterAdd`) — Fired when a user account is added</li>
          <li><strong>User Updated</strong> (`L_USER:onAfterUpdate`) — Fired when a user account is modified (including activity-driven changes such as lastLoginDate on sign-in)</li>
          <li><strong>User Deleted</strong> (`L_USER:onAfterDelete`) — Fired when a user account is removed</li>
        </ul>
      </div>
    </Step>

    <Step title="Account events">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Events on the Account (AccountEntry) system object.</p>

        <ul>
          <li><strong>Account Created</strong> (`L_ACCOUNT:onAfterAdd`) — Fired when an account is added</li>
          <li><strong>Account Updated</strong> (`L_ACCOUNT:onAfterUpdate`) — Fired when an account is modified</li>
          <li><strong>Account Deleted</strong> (`L_ACCOUNT:onAfterDelete`) — Fired when an account is removed</li>
        </ul>
      </div>
    </Step>

    <Step title="Organization events">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Events on the Organization system object.</p>

        <ul>
          <li><strong>Organization Created</strong> (`L_ORGANIZATION:onAfterAdd`) — Fired when an organization is added</li>
          <li><strong>Organization Updated</strong> (`L_ORGANIZATION:onAfterUpdate`) — Fired when an organization is modified</li>
          <li><strong>Organization Deleted</strong> (`L_ORGANIZATION:onAfterDelete`) — Fired when an organization is removed</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Delivery format</h2>

  <p>Details of how Liferay delivers events to StackOne.</p>

  <Steps>
    <Step title="JSON payloads">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Liferay delivers each event as an HTTP POST with a JSON body containing the trigger in `objectActionTriggerKey` (`onAfterAdd`, `onAfterUpdate`, or `onAfterDelete`), the entity's raw attributes under `model<Entity>` (for example `modelUser`), the headless REST representation under `modelDTO<Type>` (for example `modelDTOAccount`), the pre-change state under `original<Entity>`/`originalDTO<Type>` for updates and deletes, and the acting user in `userId`/`userName`.</p>
      </div>
    </Step>
  </Steps>
</section>

## Verify

Your Connector should now be able to receive and process events. Try triggering an event and you should see an Event appear in the Connector logs.
