> For a complete page index of the Captain API documentation, fetch https://docs.captain.dev/llms.txt?excludeSpec=true

# List Event Types

GET https://api.filesearch.dev/v2/webhooks/event-types

List the five job events with a description, the payload schema version and a JSON Schema (draft 7) for each payload. Each schema carries an example payload under `examples`, the same body the test endpoint sends.

Every indexing job sends exactly one of these events when it reaches its final status. See the [Webhooks](/guides/webhooks) guide.

Reference: https://docs.runcaptain.com/reference/webhooks/event-types

## Response

### 200

Successful Response

- `event_types` (list of WebhookEventType, required)

## Errors

### 401 Unauthorized Error

Missing or invalid API key.

- `error` (string, required) — Error kind. `HTTP_ERROR` for errors raised by the route.
- `message` (string, required) — What went wrong.
- `path` (string, required) — The request path.
- `status_code` (integer, optional) — The HTTP status code.

### 429 Too Many Requests Error

`Too many webhook management requests. Try again shortly.` Retry after the `Retry-After` header.

- `error` (string, required) — Error kind. `HTTP_ERROR` for errors raised by the route.
- `message` (string, required) — What went wrong.
- `path` (string, required) — The request path.
- `status_code` (integer, optional) — The HTTP status code.

## Types

### WebhookEventType

- `name` (enum, required)
  - Allowed values: `job.completed`, `job.completed_with_errors`, `job.failed`, `job.timed_out`, `job.cancelled`
- `description` (string, required)
- `schema_version` (string, required) — Payload schema version. Currently `1`.
- `schema` (map from string to any, required) — JSON Schema (draft 7) of the event payload, with an example under `examples`.

## Examples

**Response**

```json
{
  "event_types": [
    {
      "name": "job.completed",
      "description": "An indexing job finished and every file was indexed or skipped.",
      "schema_version": "1",
      "schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "job.completed",
        "description": "An indexing job finished and every file was indexed or skipped.",
        "type": "object",
        "required": [
          "id",
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "evt_<job_id>; stable per job."
          },
          "type": {
            "type": "string",
            "const": "job.completed"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "required": [
              "job_id",
              "status",
              "source",
              "environment",
              "files",
              "test",
              "url"
            ],
            "properties": {
              "job_id": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "const": "completed"
              },
              "source": {
                "type": "string",
                "enum": [
                  "api",
                  "sync"
                ]
              },
              "job_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "collection_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "collection_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "environment": {
                "type": "string"
              },
              "sync_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "completed_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "files": {
                "type": "object",
                "required": [
                  "total",
                  "indexed",
                  "failed",
                  "skipped"
                ],
                "properties": {
                  "total": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "indexed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "failed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "skipped": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "error_code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Why the job did not fully succeed. Known values: all_files_failed, execution_failed, timed_out, embedding_stalled. Also set on job.completed_with_errors (embedding_stalled). New values may be added."
              },
              "test": {
                "type": "boolean"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        },
        "examples": [
          {
            "id": "evt_00000000-0000-4000-8000-000000000000",
            "type": "job.completed",
            "timestamp": "2026-01-01T00:05:00Z",
            "data": {
              "job_id": "00000000-0000-4000-8000-000000000000",
              "status": "completed",
              "source": "api",
              "job_type": "index_s3_directory",
              "collection_id": "00000000-0000-4000-8000-000000000001",
              "collection_name": "example-collection",
              "environment": "production",
              "sync_id": null,
              "created_at": "2026-01-01T00:00:00Z",
              "completed_at": "2026-01-01T00:05:00Z",
              "files": {
                "total": 25,
                "indexed": 25,
                "failed": 0,
                "skipped": 0
              },
              "error_code": null,
              "test": true,
              "url": "https://api.filesearch.dev/v2/jobs/00000000-0000-4000-8000-000000000000"
            }
          }
        ]
      }
    },
    {
      "name": "job.completed_with_errors",
      "description": "An indexing job finished and at least one file failed.",
      "schema_version": "1",
      "schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "job.completed_with_errors",
        "description": "An indexing job finished and at least one file failed.",
        "type": "object",
        "required": [
          "id",
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "evt_<job_id>; stable per job."
          },
          "type": {
            "type": "string",
            "const": "job.completed_with_errors"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "required": [
              "job_id",
              "status",
              "source",
              "environment",
              "files",
              "test",
              "url"
            ],
            "properties": {
              "job_id": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "const": "completed_with_errors"
              },
              "source": {
                "type": "string",
                "enum": [
                  "api",
                  "sync"
                ]
              },
              "job_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "collection_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "collection_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "environment": {
                "type": "string"
              },
              "sync_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "completed_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "files": {
                "type": "object",
                "required": [
                  "total",
                  "indexed",
                  "failed",
                  "skipped"
                ],
                "properties": {
                  "total": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "indexed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "failed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "skipped": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "error_code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Why the job did not fully succeed. Known values: all_files_failed, execution_failed, timed_out, embedding_stalled. Also set on job.completed_with_errors (embedding_stalled). New values may be added."
              },
              "test": {
                "type": "boolean"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        },
        "examples": [
          {
            "id": "evt_00000000-0000-4000-8000-000000000000",
            "type": "job.completed_with_errors",
            "timestamp": "2026-01-01T00:05:00Z",
            "data": {
              "job_id": "00000000-0000-4000-8000-000000000000",
              "status": "completed_with_errors",
              "source": "api",
              "job_type": "index_s3_directory",
              "collection_id": "00000000-0000-4000-8000-000000000001",
              "collection_name": "example-collection",
              "environment": "production",
              "sync_id": null,
              "created_at": "2026-01-01T00:00:00Z",
              "completed_at": "2026-01-01T00:05:00Z",
              "files": {
                "total": 25,
                "indexed": 23,
                "failed": 2,
                "skipped": 0
              },
              "error_code": null,
              "test": true,
              "url": "https://api.filesearch.dev/v2/jobs/00000000-0000-4000-8000-000000000000"
            }
          }
        ]
      }
    },
    {
      "name": "job.failed",
      "description": "An indexing job failed. Files that finished before the failure stay indexed.",
      "schema_version": "1",
      "schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "job.failed",
        "description": "An indexing job failed. Files that finished before the failure stay indexed.",
        "type": "object",
        "required": [
          "id",
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "evt_<job_id>; stable per job."
          },
          "type": {
            "type": "string",
            "const": "job.failed"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "required": [
              "job_id",
              "status",
              "source",
              "environment",
              "files",
              "test",
              "url"
            ],
            "properties": {
              "job_id": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "const": "failed"
              },
              "source": {
                "type": "string",
                "enum": [
                  "api",
                  "sync"
                ]
              },
              "job_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "collection_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "collection_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "environment": {
                "type": "string"
              },
              "sync_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "completed_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "files": {
                "type": "object",
                "required": [
                  "total",
                  "indexed",
                  "failed",
                  "skipped"
                ],
                "properties": {
                  "total": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "indexed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "failed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "skipped": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "error_code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Why the job did not fully succeed. Known values: all_files_failed, execution_failed, timed_out, embedding_stalled. Also set on job.completed_with_errors (embedding_stalled). New values may be added."
              },
              "test": {
                "type": "boolean"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        },
        "examples": [
          {
            "id": "evt_00000000-0000-4000-8000-000000000000",
            "type": "job.failed",
            "timestamp": "2026-01-01T00:05:00Z",
            "data": {
              "job_id": "00000000-0000-4000-8000-000000000000",
              "status": "failed",
              "source": "api",
              "job_type": "index_s3_directory",
              "collection_id": "00000000-0000-4000-8000-000000000001",
              "collection_name": "example-collection",
              "environment": "production",
              "sync_id": null,
              "created_at": "2026-01-01T00:00:00Z",
              "completed_at": "2026-01-01T00:05:00Z",
              "files": {
                "total": 25,
                "indexed": 0,
                "failed": 25,
                "skipped": 0
              },
              "error_code": "all_files_failed",
              "test": true,
              "url": "https://api.filesearch.dev/v2/jobs/00000000-0000-4000-8000-000000000000"
            }
          }
        ]
      }
    },
    {
      "name": "job.timed_out",
      "description": "An indexing job ran past its time limit.",
      "schema_version": "1",
      "schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "job.timed_out",
        "description": "An indexing job ran past its time limit.",
        "type": "object",
        "required": [
          "id",
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "evt_<job_id>; stable per job."
          },
          "type": {
            "type": "string",
            "const": "job.timed_out"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "required": [
              "job_id",
              "status",
              "source",
              "environment",
              "files",
              "test",
              "url"
            ],
            "properties": {
              "job_id": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "const": "timed_out"
              },
              "source": {
                "type": "string",
                "enum": [
                  "api",
                  "sync"
                ]
              },
              "job_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "collection_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "collection_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "environment": {
                "type": "string"
              },
              "sync_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "completed_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "files": {
                "type": "object",
                "required": [
                  "total",
                  "indexed",
                  "failed",
                  "skipped"
                ],
                "properties": {
                  "total": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "indexed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "failed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "skipped": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "error_code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Why the job did not fully succeed. Known values: all_files_failed, execution_failed, timed_out, embedding_stalled. Also set on job.completed_with_errors (embedding_stalled). New values may be added."
              },
              "test": {
                "type": "boolean"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        },
        "examples": [
          {
            "id": "evt_00000000-0000-4000-8000-000000000000",
            "type": "job.timed_out",
            "timestamp": "2026-01-01T00:05:00Z",
            "data": {
              "job_id": "00000000-0000-4000-8000-000000000000",
              "status": "timed_out",
              "source": "api",
              "job_type": "index_s3_directory",
              "collection_id": "00000000-0000-4000-8000-000000000001",
              "collection_name": "example-collection",
              "environment": "production",
              "sync_id": null,
              "created_at": "2026-01-01T00:00:00Z",
              "completed_at": "2026-01-01T00:05:00Z",
              "files": {
                "total": 25,
                "indexed": 0,
                "failed": 0,
                "skipped": 25
              },
              "error_code": "timed_out",
              "test": true,
              "url": "https://api.filesearch.dev/v2/jobs/00000000-0000-4000-8000-000000000000"
            }
          }
        ]
      }
    },
    {
      "name": "job.cancelled",
      "description": "An indexing job was cancelled.",
      "schema_version": "1",
      "schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "job.cancelled",
        "description": "An indexing job was cancelled.",
        "type": "object",
        "required": [
          "id",
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "evt_<job_id>; stable per job."
          },
          "type": {
            "type": "string",
            "const": "job.cancelled"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "required": [
              "job_id",
              "status",
              "source",
              "environment",
              "files",
              "test",
              "url"
            ],
            "properties": {
              "job_id": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "const": "cancelled"
              },
              "source": {
                "type": "string",
                "enum": [
                  "api",
                  "sync"
                ]
              },
              "job_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "collection_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "collection_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "environment": {
                "type": "string"
              },
              "sync_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "completed_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "files": {
                "type": "object",
                "required": [
                  "total",
                  "indexed",
                  "failed",
                  "skipped"
                ],
                "properties": {
                  "total": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "indexed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "failed": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "skipped": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "error_code": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Why the job did not fully succeed. Known values: all_files_failed, execution_failed, timed_out, embedding_stalled. Also set on job.completed_with_errors (embedding_stalled). New values may be added."
              },
              "test": {
                "type": "boolean"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        },
        "examples": [
          {
            "id": "evt_00000000-0000-4000-8000-000000000000",
            "type": "job.cancelled",
            "timestamp": "2026-01-01T00:05:00Z",
            "data": {
              "job_id": "00000000-0000-4000-8000-000000000000",
              "status": "cancelled",
              "source": "api",
              "job_type": "index_s3_directory",
              "collection_id": "00000000-0000-4000-8000-000000000001",
              "collection_name": "example-collection",
              "environment": "production",
              "sync_id": null,
              "created_at": "2026-01-01T00:00:00Z",
              "completed_at": "2026-01-01T00:05:00Z",
              "files": {
                "total": 25,
                "indexed": 0,
                "failed": 0,
                "skipped": 25
              },
              "error_code": null,
              "test": true,
              "url": "https://api.filesearch.dev/v2/jobs/00000000-0000-4000-8000-000000000000"
            }
          }
        ]
      }
    }
  ]
}
```

**SDK Code**

```python Python
import requests

BASE_URL = "https://api.filesearch.dev"
API_KEY = "your_api_key"

response = requests.get(
    f"{BASE_URL}/v2/webhooks/event-types",
    headers={"Authorization": f"Bearer {API_KEY}"},
    timeout=30.0,
)
response.raise_for_status()
data = response.json()
for event_type in data["event_types"]:
    print(f"{event_type['name']}: {event_type['description']}")

```

```typescript TypeScript
const BASE_URL = "https://api.filesearch.dev";
const API_KEY = "your_api_key";

const response = await fetch(`${BASE_URL}/v2/webhooks/event-types`, {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${API_KEY}`,
  },
});
if (!response.ok) throw new Error(`Request failed: ${response.status} ${await response.text()}`);
const data = await response.json();
for (const eventType of data.event_types as { name: string; description: string }[]) {
  console.log(`${eventType.name}: ${eventType.description}`);
}

```