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

# \<thread\>

## Summary

A process thread in PageSeeder.

## Usage context

| Permitted content | `<message>`, thread specific XML |
| --- | --- |
| Permitted parent | `<threads>` |

## Attributes

This element includes the following attributes:

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| id | `xs:string` | yes | The ID of the thread |
| name | `xs:string` | yes | The human friendly name of the thread |
| username | `xs:string` | no | The username of the user who started the thread |
| groupid | `xs:long` | no | The ID of the context group |
| status | `enum` | no | The thread status |

### `@groupid`

The ID of the group where the thread was launched, some threads are server wide so this attribute is optional.

### `@id`

The PageSeeder identifier for the thread. It can be used to specify a thread in a request to PageSeeder.

### `@name`

A thread name, describing what the thread does.

### `@status`

The current status of the thread, only specified if the thread has been started. The value is one of the following:

- `initialised`
- `inprogress`
- `error`
- `warning`
- `cancelled`
- `completed`
- `failed`

A thread is considered as finished if its status is `completed`, `cancelled` or `failed`.

### `@username`

The username of the member who owns the thread, it is optional as some threads are launched by PageSeeder.

## Examples

```lang-xml

<thread id="9aa2ac4f69e4bbce00501f7f411eb761"
        name="Moving thread for group dev-group"
        username="bjones"
        groupid="42"
        status="completed">
  <message>Successfully moved 237 files/folders
  </message>
  <progress total="474" current="474"/>
</thread>
<thread id="f4851a942a5d95fec02c132d00cc5a3a"
        name="Validation thread for group dev-group"
        username="asmith"
        groupid="135"
        status="inprogress">
  <message>Document /ps/dev/group/documents/pages/hr/pg143_hires.jpg
           is valid.
  </message>
  <progress total="709" current="636"/>
</thread>
```

## Schema

```lang-xml

<xs:element name="thread" type="thread"/>

<xs:complexType name="thread" mixed="true">
  <xs:sequence>
    <xs:any minOccurs="0"
            maxOccurs="unbounded"
            processContents="skip"/>
  </xs:sequence>
  <xs:attribute name="id"       type="xs:string" use="required"/>
  <xs:attribute name="name"     type="xs:string" use="required"/>
  <xs:attribute name="username" type="xs:string" /> 
  <xs:attribute name="groupid"  type="xs:long" /> 
  <xs:attribute name="status"   type="thread-status" />
</xs:complexType>

<xs:simpleType name="thread-status">
  <xs:restriction base="xs:string">
    <xs:enumeration value="initialised" />
    <xs:enumeration value="inprogress" />
    <xs:enumeration value="cancelled" />
    <xs:enumeration value="warning" />
    <xs:enumeration value="error" />
    <xs:enumeration value="failed" />
    <xs:enumeration value="completed" />
  </xs:restriction>
</xs:simpleType>
```

 

 

## Compatibility

No change since initial API release.

