---
title: "Asynchronous process"
source: https://dev.pageseeder.com/api/usage/asynchronous_process.html
description: "Asynchronous processes in PageSeeder services handle large data operations by returning HTTP 202 and creating threads that write results to logs. Thread status progresses through transitory states (initialised, inprogress, error, warning) to final states (completed, failed, cancelled). Multiple APIs manage threads at server or group levels."
last_updated: 2026-09-08T14:07:08+10:00
tokens: ~632
---

# Asynchronous process

When there is a lot of data to process, some services don’t return the results directly but start an asynchronous process (or thread). The thread writes results to a [log](../../reference/folders_and_files/state_folder/logs.md) which can be accessed at another time.

> **Note:** When a service starts a thread, it returns an HTTP code `202` Accepted instead of `200` OK.

## XML returned

When a thread is started, the service output includes the following thread XML:

```xml
<thread id="[thread id]"
        name="[thread name]"
        username="[username of user starting thread]"
        groupid="[ID of group if applicable or -1]"
        status="[initialised|
                 inprogress|
                 error|
                 warning|
                 cancelled|
                 failed|
                 completed]">
  [<message>[explanation or error]</message>]
  [thread specific XML]
</thread>
```

For example:

```xml
<thread id="349f4fbcd872d514751f7809acf4d888"
        name="Moving thread for group test-local5"
        username="jjones"
        groupid="240"
        status="initialised">
  <message>Finding URIs</message>
</thread>
```

The statuses `error`  and `warning` are only *transitory states –* the thread always terminates only with one of `completed`, `failed`, or `cancelled` which are *final states*. This is because there might be several errors or warnings. Threads that include warnings usually result in a `completed` state and errors in a `failed` state.

## Thread services

The API includes several services to work with threads.

|  | Server (Administrators) | Group (Contributors and higher) |
| --- | --- | --- |
| List threads | [/threads](../services/list-server-threads_get.md) | [/groups/\{group\}/threads](../services/list-group-threads_get.md) |
| View progress | [/threads/\{thread\}/progress](../services/get-thread-progress_get.md) | [/groups/\{group\}/threads/\{thread\}/progress](../services/get-group-thread-progress_get.md) |
| Get logs | [/threads/\{thread\}/logs](../services/get-thread-logs_get.md) | [/groups/\{group\}/threads/\{thread\}/logs](../services/get-group-thread-logs_get.md) |
| Cancel a thread | [/threads/\{thread\}/cancel](../services/cancel-thread_post.md) | [/groups/\{group\}/threads/\{thread\}/cancel](../services/cancel-group-thread_post.md) |

Services at the server level can only invoked by administrators. 

Services at group level can be invoked by any member of the group with the role of  contributor or manager.

