---
title: "Element <webevent>"
source: https://dev.pageseeder.com/api/elements/element_webevent.html
description: "API Element reference for <webevent>"
last_updated: 2026-08-07T17:09:54+10:00
tokens: ~2613
---

# \<webevent\>

## Summary

This element describes a single event included in the payload sent to the client for a configured [Webhook](../../reference/glossary/webhook.md).

Multiple events can happen within a short period of time and event notification are posted asynchronously, that is why PageSeeder sends a payload that includes multiple events to the client app:

```lang-xml
<webevents>
  <webhook id="[id]" [name="[name]"] />
  <!-- Web events are listed here -->
</webevents>
```

## Usage context

| Permitted content | [\<comment\>](element_comment.md) [\<group\>](element_group.md) [\<groupfolder\>](element_groupfolder.md) [\<properties\>](element_properties.md) [\<member\>](element_member.md) [\<membership\>](element_membership.md) [\<project\>](element_project.md) [\<publication\>](../../psml/elements/element-publication.md) [\<task\>](element_task.md) [\<uri\>](element_uri.md) [\<webhook\>](element_webhook.md) [\<workflow\>](element_workflow.md) |
| --- | --- |
| Permitted parent | `<webevents>`  |

### Minimal

When the object type of a webhook is set to `minimal`, only the identifiers are included in the object elements. Otherwise, the entire object element is included. The minimal representation of the each object is as follows:

```xml
<comment     id="" />
<group       id="" name="" />
<groupfolder id="" path="" />
<properties />
<member      id="" username="" [email=""] />
<membership  id="" />
<project     id="" name="" />
<publication id="" />
<task        id="" />
<uri         id="" path="" [docid=""] />
<webhook     id="" [name=""] />
<workflow    id="" />
```

> **Note:** All the `@id` attributes have type `xs:long` except for `publication/@id` which has the pattern `[a-zA-Z0-9-_]+` and `properties` which has no `@id` attribute.

## Attributes

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| datetime | `xs:datetime` | yes | Date time of event occurring |
| id | `xs:string`  | yes | Generated from object ID and followed by the nano time  |
| type | `enum` | yes | Type of object and action |

### `@datetime`

The date and time of event occurring in ISO 8601 format, precision is second.

### `@id`

The ID of the Web event is constructed as `[object id].[nano time]`. For example, when an event affects member ID 123, the returned id might be `123.1098767567452`.

### `@type`

The type of event is constructed as `[object].[action]`. For example, when a URI is edited, the returned type is `uri.modified`.

#### Objects / action table

|  | archived | created | deleted | modified | unarchived | ping | started | updated |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| comment | group | group | group | group | group |  |  |  |
| group | group | project | group | group | group |  |  |  |
| groupfolder | group | group | group | group |  |  |  |  |
| groupproperties |  |  |  | group |  |  |  |  |
| member |  | host | host | host |  |  |  |  |
| membership |  | group | group | group |  |  |  |  |
| project | project | host | project | project |  |  |  |  |
| publication |  | group | group | group |  |  |  |  |
| server |  |  |  |  |  |  | host |  |
| task |  |  |  |  |  |  |  | group |
| uri | group | group | group | group |  |  |  |  |
| webhook |  |  |  |  |  | tools |  |  |
| workflow |  |  |  |  |  |  |  | group |

> **Note:** A uri/comment/task/workflow move between groups and a group/project rename produce a `deleted` and possible `created` (and `modified` for uri or `updated` for task/workflow) event with the relevant groups for each. A task/workflow deleted will produce an `updated` event with an empty `<task>/<workflow>` element.

##### Legend

- tools — admin event
- group — group or project events
- project — project events
- host — server events

## Examples

The general format for a single Web event is as follows:

```lang-xml
<webevent id="[object id].[nano time]"
          datetime="[datetime]"
          type="[object].[action]">
    <event>
      <group id="" name="">
      [<group .../> ...]
    </event>
    <webhook|uri|comment|task|workflow|membership|member|...
             id=""
             [name="[group name]"]
             [docid=""] [path=""]
             [username=""]
             [email=""]
             [...]>
        [...]
    </...>
  </webevent>
```

The object representation depends on the webhook configuration. When `minimal` is chosen, only the identifiers are included. Otherwise, the entire object is included.

The `group` and `project` elements are only included when the event is related to a group or project.

### Server started

The following is sent when the server starts, if the webhook is configured to receive server events. The minimal and basic formats are identical in this case and there is no object element.

#### XML

```lang-xml
<webevent id="0.3082697494261400"
          datetime="2022-10-12T11:35:15+11:00"
          type="server.started" />
```

#### JSON

```lang-json
{
  "id":"0.3082697494261400",
  "datetime":"2022-10-12T11:35:15+11:00",
  "type":"server.started"
}
```

### Ping

The following is sent when the webhook is created or when the [ping service](../services/webhook-ping-GET.md) is used. The following shows minimal format. If the webhook is configured to receive the basic object type, the complete [\<webhook\> element](element_webhook.md) is included.

#### XML

```lang-xml
<webevent id="123.3082710362553300"
          datetime="2022-10-12T11:35:15+11:00"
          type="webhook.ping">
  <webhook id="123" name="Webhook Demo"/>
</webevent>
```



#### JSON

```lang-json
{
  "id":"123.3082710362553300",
  "datetime":"2022-10-12T11:35:27+11:00",
  "type":"webhook.ping",
  "webhook":{"id":123,"name":"Webhook Demo"}
}
```

### Comment modified

The following is sent when a comment is modified. The following shows minimal format. If the webhook is configured to receive the basic object type, the complete [\<comment\> element](element_comment.md) is included.

#### XML

```lang-xml
<webevent id="676267.3082850428909000"
          datetime="2022-10-12T11:37:48+11:00"
          type="comment.modified">
  <event>
    <group id="4" name="sample-demo"/>
  </event>
  <comment id="676267"/>
</webevent>
```

#### JSON

```lang-json
{
  "id":"676267.3082850428909000",
  "datetime":"2022-10-12T11:37:48+11:00",
  "type":"comment.modified",
  "event":[{"id":4,"name":"sample-demo"}],
  "comment":{"id":676267}
}
```

### PSML document modified

The following is sent when a PSML document is modified. The following shows minimal format. If the webhook is configured to receive the basic object type, the complete [\<uri\> element](element_uri.md) is included.

#### XML

```lang-xml
<webevent id="4.3092366211880300" 
          datetime="2022-10-12T14:16:23+11:00" 
          type="uri.modified">
  <event>
    <group id="4" name="sample-demo"/>
  </event>
  <uri id="4" path="/ps/sample/demo/index2.psml" />
</webevent>
```

#### JSON

```lang-json
{
  "id":"4.3092366211880300",
  "datetime":"2022-10-12T14:16:23+11:00",
  "type":"uri.modified",
  "event":[{"id":4,"name":"sample-demo"}],
  "uri":{"id":4,"path":"/ps/sample/demo/index2.psml"}
}
```

### Publication modified

The following is sent when a PSML document within a publication is modified. The following shows the `basic` format. Lists of URIs can be included under the following elements depending on the change to the publication `<added>`, `<modified>`, `<removed>`, `<deleted>`.

#### XML

```lang-xml
<webevent id="4693949.1533067556515800"
          datetime="2022-11-01T12:17:35+11:00"
          type="publication.modified">
    <event>
      <group id="4" name="sample-demos"/>
    </event>
    <publication id="sample-colour"
                 hostid="1"
                 rooturiid="897830"
                 title="Colour"
                 defaultgroupid="4"
                 type="default">
      <added>
        <uri id="897831" scheme="http" ...>
          <displaytitle>Yellow</displaytitle>
        </uri>
        <uri id="897832" scheme="http" ...>
          <displaytitle>Green</displaytitle>
        </uri>
      </added>
      <modified>
        <uri id="897830" scheme="http" ...>
          <displaytitle>Colour</displaytitle>
        </uri>
      </modified>
    </publication>
  </webevent>
```

#### JSON

```lang-json
{
  "id": "4693949.1533067556515800",
  "datetime": "2022-11-01T12:17:35+11:00",
  "type": "publication.modified",
  "event": [{"id": 4, "name": "sample-demos"}],
  "publication": {
    "id": "sample-colour",
    "hostid": 1,
    "rooturiid": 897830,
    "title": "Colour",
    "defaultgroupid": 4,
    "type": "default",
    "added": [
      {
        "id": 897831,
        "scheme": "http",
        "displaytitle": "Yellow",
        ...
      },
      {
        "id": 897832,
        "scheme": "http",
        "displaytitle": "Green",
        ...
      }
    ],
    "modified": [
      {
        "id": 897830,
        "scheme": "http",
        "displaytitle": "Colour",
        ...
      }
    ]
  }
}
```

> **Note:** The same URI might appear to be added more than once to the same publication depending on the state of the internal publication cache.

## Schema

### XML Schema

```lang-xml
<xs:element name="webevent">
  <xs:sequence>
    <xs:element ref="event" />
    <xs:choice minOccurs="1" maxOccurs="1">
      <xs:element ref="comment"/>
      <xs:element ref="group"/>
      <xs:element ref="groupfolder"/>
      <xs:element ref="properties"/>
      <xs:element ref="member"/>
      <xs:element ref="membership"/>
      <xs:element ref="project"/>
      <xs:element ref="publication"/>
      <xs:element ref="task"/>
      <xs:element ref="uri"/>
      <xs:element ref="webhook"/>
      <xs:element ref="workflow"/>
    </xs:choice>
  </xs:sequence>
  <xs:attribute name="datetime" type="xs:dateTime" />
  <xs:attribute name="id" type="xs:string" />
  <xs:attribute name="type" type="xs:string" />
</xs:element>
```

### Relax Schema

```lang-relax
element webevent {
  attribute datetime { xs:dateTime },
  attribute id { xs:string },
  attribute type { xs:string },
  element event,
  (comment | group | groupfolder | properties |
   member | membership | project | publication |
   task | uri | webhook | workflow)
}
```

## Compatibility

Webhooks were introduced in version 5.9500.

Events added in subsequent versions:

- `publication.*` events introduced in version 5.9800 
- `server.started` event introduced in version 5.9900

