Build Your First Integration

From zero knowledge to live humanitarian data in about ten minutes — the mental model, your first authenticated request, and two real queries.

This is the front door. If you’ve never touched the CLEAR API before, read this page top to bottom. By the end you’ll understand how the data is shaped and you’ll have pulled real records with your own API key. Everything else in these docs — the Queries, Mutations, and Types reference — is there to look things up after you understand the shape of the system.

1. The mental model

CLEAR is a five-tier graph. Source observations flow in at the bottom and are progressively grouped, classified, and escalated into human-readable advisories. Almost every query you write touches one of these five tiers:

TierWhat it represents
LocationThe administrative hierarchy — country → state → district → point. Everything else hangs off this tree.
SignalA single source observation ingested from a source (ACLED, GDACS) or filed manually by a field officer. Upstream payloads are stored internally and are not returned on this type.
EventA cluster of related signals, classified by disaster type and bound to a district — or to a state or country when its signals couldn’t be placed more precisely.
AlertA published advisory raised from a severe event and delivered to subscribed users.
CrisisA user-curated aggregation of related events, enriched by an LLM with a summary, forward scenarios, and a needs analysis.

Two things to internalise. First, the tiers build upward: a Signal links to the Event it belongs to, which links to any Alert raised from it. Second, everything is geolocated — signals, events, and alerts all reference the Location hierarchy. That’s why the “by location” queries are the most powerful way to slice the data.

One staging area sits in front of tier 2. The ground staging tier holds staged Signals — messages ingested from ground sources such as WhatsApp groups (GroundMessage) — grouped into threads (GroundThread). A thread is a cluster of staged Signals with a correction lifecycle; when a reviewer approves a thread for publication, it is promoted and becomes a Signal. Nothing enters the signals graph from a ground source without passing that review gate.

New to GraphQL? You send one POST request to /graphql with a query naming exactly the fields you want, and you get back exactly those fields — no over-fetching, no guessing at response shapes. The GraphQL Sandbox autocompletes every field as you type, which is the fastest way to explore.

2. Get set up

You need an account and an API key. Both live in the Developer Portal.

1

Create an account

Sign up at the Developer Portal. It takes about ten seconds.

2

Generate an API key

In the portal, open API Keys and create one. Copy it immediately — the full key is shown only once.

Treat your key like a password. Keep it in an environment variable or secrets manager — never in client-side code or version control.

3. Your first request

The me query is the simplest authenticated call: it returns the account your key belongs to. Run it first to confirm your key works before you touch real data. Replace YOUR_API_KEY with the key you just generated:

curl -X POST https://api.clearinitiative.io/graphql \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"{ me { id email role } }"}'

A successful response echoes your own user back:

{
  "data": {
    "me": {
      "id": "aBc123XyZ",
      "email": "you@example.com",
      "role": "viewer"
    }
  }
}

If me comes back null, your key isn’t being read — double-check the Authorization header and that the key hasn’t been revoked in the portal.

4. Pull real data

Now something useful. Locations are the backbone of the graph, so start there: this lists every country CLEAR tracks (hierarchy level 0), with each one’s id, name, and resident population.

curl -X POST https://api.clearinitiative.io/graphql \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"{ locations(level: 0) { id name population } }"}'

You’ll get back an array of Location objects. Grab the id of a country that interests you — you’ll feed it into the next query.

level walks the hierarchy: 0 = country, 1 = state, 2 = district, 4 = point (a named place or coordinates), filed under the smallest area that contains it — usually a district, but a state or the country near borders and coastlines. There is no level 3. Pass a country’s id to location(id: …) and request children to drill down a level at a time.

5. Slice by location

This is where it gets powerful. eventsByLocation returns every event whose origin, destination, or general location falls within a location and all of its descendants — so one country id gives you everything happening anywhere inside that country. Drop in the id from the previous step:

curl -X POST https://api.clearinitiative.io/graphql \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"query($loc: String!) { eventsByLocation(locationId: $loc) { id title severity types generalLocation { name level } } }","variables":{"loc":"YOUR_LOCATION_ID"}}'

Each Event comes back with a severity from 1 (low) to 5 (severe), its disaster-type types tags, and the place it’s bound to. From any event you can follow the graph further — ask for its signals to see the source observations underneath (title, location, severity — not the upstream source payload), or its alerts to see what was escalated from it.

How precise is a location?

Sources differ in what they tell CLEAR about place, so check level before treating a location as exact.

The source sendsThe location you get
Coordinates (ACLED, GDACS)A point (level 4) under the smallest area containing it: usually a district, sometimes a state or the country, or none outside every boundary
Text only (for example, X posts)The district, state, or country the text supports; a point when a named place is confirmed inside that area (pointType: "landmark-geocoded")
Only a countryThe country (level 0)

Two consequences. A …ByLocation query for a district doesn’t return items placed only at its state, so query the state when you need everything in an area. And a signal from a text-only source has no location until CLEAR’s pipeline places it, usually within minutes of arriving.

The plain events, signals, and alerts lists are scoped to a team. If you’re not an admin, pass a teamId for a team you belong to (find yours via the myTeams query). The …ByLocation queries shown here have no such requirement, which is why they’re the easiest place to start.

Where to go next

You now know the shape of the graph and how to authenticate, query, and slice by location. From here:

  • Browse the full Queries and Types reference below — it’s auto-generated from the live schema, so it’s always current.
  • Open the GraphQL Sandbox to build queries interactively with field autocomplete.
  • Read the Authentication section for the browser/cookie flow if you’re building a web app rather than a server integration.
  • Manage your keys anytime in the Developer Portal.

Introduction

Welcome to the CLEAR API - your gateway to humanitarian intelligence.

The CLEAR API gives you programmatic access to signals, events, alerts, data sources, and geographic location data through a single GraphQL endpoint. Whether you’re building a monitoring dashboard, integrating alerts into your workflow, or analysing humanitarian patterns, this API has you covered.

Everything here is accessible via GraphQL at /graphql. You send a query describing exactly the data you want, and you get back precisely that — nothing more, nothing less.

What You Can Do

FeatureDescription
SignalsQuery verified source observations with location links and metadata. Upstream source payloads are not returned.
EventsBrowse grouped signals forming coherent narratives, with location, population, and type data.
EstimatesRead an Event’s figures in the CLEAR Domain Ontology’s shape — one of seven metrics, with method, attribution, bounds and both time axes. Corrections supersede; nothing is overwritten.
AlertsView events escalated for notification, delivered to subscribed users.
Data SourcesDiscover the external data feeds (ACLED, FEWS NET, social media monitors) that supply signals.
LocationsQuery a hierarchical geographic tree — countries, states, cities — with PostGIS geometry.
Disaster TypesLook up disaster classifications with GLIDE numbers.
Feature FlagsCheck runtime feature toggles to adapt your application’s behaviour.
API KeysCreate and manage personal API keys for server-to-server authentication.
TasksRequest an Event enrichment (today a web search, whose Worker proposes signals — CaseProposals — for analysts to accept or reject; one Task per source kind) and, as a Worker with the worker role, claim, heartbeat, complete or fail Tasks over GraphQL alone.

Quick Start

Go from zero to your first API response in three steps.

1

Create an account

Head to the Developer Portal and sign up. It takes about ten seconds.

2

Generate an API key

In the portal, go to API Keys and create one. Copy it immediately — you won’t see it again.

3

Make your first query

Send a request with your key in the Authorization header:

curl -X POST https://api.clearinitiative.io/graphql \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"{ me { id email } }"}'

Want to explore interactively? Open the GraphQL Sandbox to browse the full schema, autocomplete queries, and test requests in your browser.

Authentication

Two ways to authenticate, depending on your use case.

API Keys (server-to-server)

Pass your key as a Bearer token in the Authorization header:

Authorization: Bearer sk_live_your_key_here
Never expose API keys in client-side code or version control. Store them in environment variables or a secrets manager.

Session Cookies (browser apps)

Sign in via the REST auth API. The session cookie is set automatically and sent with subsequent requests:

// Sign in
const res = await fetch('/api/auth/sign-in/email', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  credentials: 'include',
  body: JSON.stringify({ email: 'you@example.com', password: '...' }),
});

// Then query (cookie sent automatically)
const data = await fetch('/graphql', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  credentials: 'include',
  body: JSON.stringify({ query: '{ me { id email } }' }),
});

Health & Readiness

Two unauthenticated probes tell you whether the API is up and whether it can reach its database. They answer different questions — pick the one that matches what you are monitoring.

GET /health — liveness

Returns 200 {"status":"ok"} whenever the process is running and serving requests. It checks nothing else, so it stays green during a database outage. This is the probe the container orchestrator uses to decide whether to restart the API; tying it to the database would restart-loop a healthy process while the fault lies elsewhere.

curl -i https://api.clearinitiative.io/health

GET /health/ready — readiness

Runs SELECT 1 against Postgres with a two-second timeout. Returns 200 when the database answers, 503 when it does not:

// 200 — ready to serve DB-backed queries
{"status":"ok","db":"ok"}

// 503 — process is up, database is not
{"status":"degraded","db":"unreachable","error":"database probe timed out after 2000ms"}

Point uptime monitors and integration health checks at this one. If /health is 200 and /health/ready is 503, the API is reachable and the database is the problem — not the other way round. The error field carries the driver message with connection details redacted.

Queries

NameReturnsDescription
me User Returns the currently authenticated user, or null if not signed in.
users [User!]! List all users.
user User Look up a user by ID.
id: String!
alerts [Alert!]! List alerts. Requires authentication. Admins may omit teamId to list all; non-admins must provide a teamId for a team they belong to.
status: AlertStatusteamId: StringincludeDummy: Boolean
alert Alert Look up an alert by ID. Requires authentication. Non-admins can only access alerts within their team scope.
id: String!
apiSignalSourceGrants [ApiSignalSourceGrant!]! Data sources opened to one API-only developer. Admin only.
userId: String!
signals [Signal!]! List signals. Requires authentication. includeDummy defaults to false.
teamId: StringincludeDummy: Boolean
signal Signal Look up a signal by ID. Requires authentication. Non-admins can only access signals within their team scope.
id: String!
signalsByLocation [Signal!]! List signals by location. Returns all signals whose origin, destination, or general location is within the given location (including descendants).
locationId: String!
signalLocationChallenges [SignalLocationChallenge!]! Signal Location challenges by status (for map dual-pin rendering). Team-scoped like signals when teamId is given (challenges whose Signal is in the team's area). status is "consideration" (open, the default), "accepted", "corrected", "declined" or "superseded".
teamId: Stringstatus: String
signalLocationChallengesToDecide [SignalLocationChallenge!]! Open Location challenges the caller can decide, newest first: for a team admin, those filed for the teams they administer (or just teamId, one of them); for a platform admin, all of them (or just teamId's). The caller's own are included. At most `first` (default and maximum 200).
teamId: String — Only this team's challenges.first: Int — Max rows to return (1 to 200, default 200).
unresolvedPlaceNames UnresolvedPlaceNamesPage! The unresolved place-name queue: place names that geocoding could not place inside a Signal's area (ADR-0019). Open rows come first, then the rows with the most Signals. Auth: a platform admin reads every row; a team admin reads the rows whose state is inside the areas of the teams they administer (a row with no state needs a team that covers the whole country). Other roles get FORBIDDEN.
status: UnresolvedPlaceNameStatus — Only rows in this state. Omit for every state, open rows first.countryCode: String — Only rows of this country (ISO-3166-1 alpha-2).areaLocationId: String — Only rows of this area. A country keeps all its rows. A state, or a place under a state, keeps the rows of that state.first: Int — Max rows to return (1 to 200, default 50).offset: Int — Rows to skip (default 0).
placeNameSuggestions [PlaceNameSuggestion!]! Places a queued name can mean, for a decider: up to 5 GeoNames candidates and up to 5 CLEAR districts or landmarks with a similar name, in one country. Candidates inside `withinLocationId` come first, then the most similar, then the nearest. Computed on each call. Auth: a platform admin or a team admin.
name: String! — The name as written (Latin script).nameAr: String — The Arabic spelling, when known. Matched exactly.countryCode: String! — ISO-3166-1 alpha-2 (SD, VE, AF).withinLocationId: String — The row's state, or another area. Sets `insideArea` and `distanceKm`.
placeAliases PlaceAliasesPage! The place alias list (ADR-0019): the spellings CLEAR maps to its own locations, newest first. Auth: a platform admin or a team admin. Every decider reads every alias; `canEdit` says which ones the caller may change.
countryCode: String — Only aliases of this country (ISO-3166-1 alpha-2).search: String — Matches the spelling (normalised, or as shown) or the target's name.scopeLocationId: String — Only aliases with this scope.source: PlaceAliasSourcefirst: Int — Max rows to return (1 to 200, default 50).after: String — The `endCursor` of the page before.
locationPlacement Location The existing admin area a point falls in (district, else state, else country), or null when it is outside the areas CLEAR covers. Lets a client show where a corrected point would be placed before filing it.
lat: Float! — Latitude of the point, -90 to 90.lng: Float! — Longitude of the point, -180 to 180.
pendingSignals [Signal!]! Signals awaiting their first grouping (status = NEW, not retracted, not yet linked to any event), oldest-first — the Dagster event-driven drain. `source` filters by DataSource name (e.g. "acled"); `first` caps the batch (default 100, max 500). Admin/pipeline only.
first: Intsource: String
pendingRecomputes [Signal!]! Signals whose events must be re-aggregated: status NEEDS_RECOMPUTE, or NEW but already linked to an event. Includes retracted rows, since removing them from event totals is the work. Oldest-first; `first` caps the batch (default 100, max 500). Admin/pipeline only.
first: Int
eventMembers [Signal!]! An event's live (non-retracted) member signals, newest first. Uncapped unless `first` is given. Admin/pipeline only.
eventId: String!first: Int
events [Event!]! List events. Requires authentication. includeDummy defaults to false.
teamId: StringincludeDummy: BooleanlastSignalSince: DateTimelimit: Int
event Event Look up an event by ID. Requires authentication. Non-admins can only access events within their team scope.
id: String!
publicEvent PublicEvent Resolve a public share-link to its cached event snapshot. No auth - the (eventId, token) pair from the URL is the gate, and the snapshot only contains the safe fields enumerated on `PublicEvent`. Returns null when the Redis cache has no entry for that pair (link expired, revoked, or evicted under memory pressure - caller treats all three the same).
eventId: String!token: String!
existingPublicEventLink CreatePublicEventLinkResult Look up the most recently-minted public share link for an event, if one still exists in the cache. The Share modal calls this on open so it can reuse an existing link rather than minting a fresh token every time. Returns null when no live link exists - the caller then mints one via `createPublicEventLink`. Requires `requireContentReader` (admin / member); pending users are blocked.
eventId: String!
eventsPendingAlert [Event!]! Events awaiting an alert (severity >= minSeverity AND no alert row yet AND a signal within the last `maxAgeHours` AND at least one NRC-relevant type — events whose types are all out-of-interest never alert, so they are not queued), oldest-first by the event's earliest-signal timestamp — the Dagster alert-stage queue. `first` caps the batch (default 100, max 500); `minSeverity` floors the severity (default 4); `maxAgeHours` bounds staleness on the latest signal's real-world time so the historical backlog / backdated backfill never alerts (default 48; 0 disables). Admin/pipeline only.
first: IntminSeverity: IntmaxAgeHours: Int
eventsByLocation [Event!]! List events by location. Returns all events whose origin, destination, or general location is within the given location (including descendants).
locationId: String!
alertsByLocation [Alert!]! List alerts by location. Returns all alerts whose event's location is within the given location (including descendants).
locationId: String!status: AlertStatus
dataSources [DataSource!]! List all data sources.
dataSource DataSource Look up a data source by ID.
id: String!
locations [Location!]! List locations, optionally filtered by hierarchy level (0 = country, 1 = state, etc.) and scoped to part of the hierarchy. `within` keeps only locations that are one of the given IDs or descend from one, so `locations(level: 2, within: [stateId])` returns that state's districts. Omitted or empty means no scope.
level: Intwithin: [String!]
location Location Look up a location by ID.
id: String!
notifications [Notification!]! List notifications, optionally filtered by status.
status: NotificationStatus
notification Notification Look up a notification by ID.
id: String!
featureFlags [FeatureFlag!]! List all feature flags.
featureFlag FeatureFlag Look up a feature flag by its unique key.
key: String!
disasterTypes [DisasterType!]! List all disaster type classifications (flat list of level-3 rows).
disasterType DisasterType Look up a disaster type by ID.
id: String!
disasterTypeHierarchy [DisasterLevel1!]! List disaster types grouped into the 3-level hierarchy (level1 > level2 > level3).
locationMetadata [LocationMetadata!]! List metadata entries for a location, optionally filtered by type. By default only the CURRENT value is returned (validTo is null). Pass current: false to include the full history.
locationId: String!type: Stringcurrent: Boolean
allLocationMetadata [LocationMetadata!]! List every locationMetadata entry of a given type across all locations. By default only current values. Pass current: false for the full history.
type: String!current: Boolean
locationMetadataHistory [LocationMetadata!]! History of a (location, type) pair - newest first. Includes the current row plus every superseded one.
locationId: String!type: String!
myApiKeys [ApiKey!]! List all API keys belonging to the authenticated user. Requires authentication.
conversation Conversation A CLEAR Agent Conversation by id: your own, or anyone's for a platform admin (read-only, and logged as `conversation.admin_read`). Null if no Conversation has that id; FORBIDDEN if it belongs to another user. Approved users only.
id: String!
myConversations [Conversation!]! Your CLEAR Agent Conversations, most recently active first. Approved users only.
first: Int — Max rows to return (1–100, default 20).after: String — The `cursor` of the last Conversation on the previous page. Omit for the first page.
conversationMessagesByIds [ConversationMessage!]! Messages from your own Conversations by id (at most 200), oldest first. Ids you don't own are left out. The CLEAR Agent's memory uses this to resolve messages it knows only by id. Approved users only.
ids: [String!]!
myAgentBudget AgentBudget! Your daily CLEAR Agent budget: the limit, what you've spent since UTC midnight, and when it resets. Approved users only.
myAgentWorkingMemory AgentWorkingMemory Your CLEAR Agent working memory, or null if the Agent hasn't saved any. Approved users only.
userConversations [Conversation!]! Admin audit: one user's Conversations, most recently active first. Read-only; each call is logged as `conversation.admin_read`. Admin only.
userId: String!first: Int — Max rows to return (1–100, default 20).after: String — The `cursor` of the last Conversation on the previous page.
myOrganisations [Organisation!]! List organisations the authenticated user belongs to.
organisation Organisation Look up an organisation by ID. Requires membership or global admin.
id: String!
myTeams [Team!]! List teams the authenticated user belongs to.
team Team Look up a team by ID. Requires membership or global admin.
id: String!
pendingInvites [Invitation!]! List pending invitations for an organisation. Requires org admin.
organisationId: String!
invitationByToken InvitationInfo Look up an invitation by token (public - used on accept-invite page).
token: String!
myAlertSubscriptions [AlertSubscription!]! List the authenticated user's alert subscriptions.
alertSubscriptionsByLocation [AlertSubscription!]! List all alert subscriptions for a location (admin only).
locationId: String!
crises [Crisis!]! List all crises.
crisis Crisis Look up a crisis by ID.
id: String!
pendingCrises [Crisis!]! Crises awaiting enrichment (enrichmentStatus = PENDING), oldest-first — the Dagster enrichment drain. `first` caps the batch (default 100, max 500). Admin/pipeline only.
first: Int
alertsPage AlertsPage! Paginated alerts feed with severity / location / type / date filters and explicit ordering. Use this instead of `alerts(...)` when the UI needs pages or a totalCount.
input: AlertsPageInput
eventsPage EventsPage! Paginated events feed (same filter shape as alertsPage, plus event-only options). Honours teamId as a location-scope filter.
input: EventsPageInput
signalsPage SignalsPage! Paginated signals feed with source-based filtering.
input: SignalsPageInput
entityStats EntityStats! Cross-entity stats query - returns a total plus optional buckets grouped by type / severity / day / week / month. Filter shape mirrors the page queries so a "current view" can compute its own counts.
input: EntityStatsInput!
nominatimCacheEntry NominatimCacheEntry Look up a cached Nominatim geocoder response by query hash. Returns null when the entry is missing or expired (admin/pipeline only).
queryHash: String!
activityLogs [ActivityLog!]! Paginated activity log. Admin only. Newest first.
filter: ActivityLogFilterInputlimit: Intoffset: Int
activityStats ActivityStats! Aggregated activity counts + per-user + per-day breakdown for the admin dashboard. Admin only. Default window: last 30 days.
from: DateTimeto: DateTime
agentUsageStats AgentUsageStats! CLEAR Agent usage aggregates (turns, distinct users, cost, tokens, and turns by route) from usage metadata only; message content is never read. Admin only. Default window: last 30 days.
from: DateTimeto: DateTime
nrcActivityExport String! Monthly NRC aggregate export as CSV: one row per month, organisation, team and team role, with distinct active users, action count, Agent turns and Agent cost. Global admins are excluded and groups with fewer than 5 distinct people are left out. Admin only. Default window: the last 12 calendar months (UTC).
from: DateTimeto: DateTime
userEngagement UserEngagementMetrics! Point-in-time user-engagement summary: DAU, WAU, MAU, and the DAU/MAU stickiness ratio. Derived from auth.login activity. Admin only. `asOf` defaults to NOW(); pass a historical timestamp to compute as-of that date.
asOf: DateTime
dauSeries [DauPoint!]! Daily Active Users time series - one point per UTC date in the window. Admin only. Days with zero logins are omitted; the dashboard can backfill them client-side when plotting.
from: DateTime!to: DateTime!
mauSeries [MauPoint!]! Monthly Active Users time series - one point per UTC calendar month in the window. Admin only.
from: DateTime!to: DateTime!
detectionMetrics DetectionMetrics! Time to detection: how soon after an Event's onset CLEAR received its first ingested Signal, in whole days, over a range (default: the last 12 ISO weeks) and optionally one location. Counts only. Admin only. Refuses an inverted range or one over 364 days with BAD_USER_INPUT. See `DetectionMetrics` and ADR-0011.
input: DetectionMetricsInput
locationPrecisionMetrics LocationPrecisionMetrics! Location precision: how finely CLEAR placed the Signals it ingested, by the level of each Signal's location (none, country, state, district, point), per source and ISO week of the instant it was located, over a range (default: the last 12 ISO weeks), optionally one location and some sources. Counts only. Admin only. Refuses an inverted range or one over 364 days with BAD_USER_INPUT. See `LocationPrecisionMetrics` and ADR-0012.
input: LocationPrecisionMetricsInput
agentMetrics AgentMetrics! CLEAR Agent usage: cost, latency, turns, Conversations, users, tool calls and the pages questions came from, over a range (default: the last 12 ISO weeks). A turn is an Answer with recorded usage. Counts, sums and averages only. Admin only. Refuses an inverted range or one over 364 days with BAD_USER_INPUT. Selecting `recentQuestions` is logged as `conversation.admin_read`. See `AgentMetrics` and ADR-0013.
input: AgentMetricsInput
metricDefinitions [MetricDefinition!]! The metrics the admin /metrics page can plot over time, in registry order: key, name, dimension, unit, method text, time basis and whether the series can be grouped by source. Admin only. See ADR-0015.
metricSeries MetricSeries! One metric over a range as a share per bucket (numerator and denominator) by day, ISO week or calendar month, optionally grouped by source. Read from the service that owns the metric, so it equals that metric's own query row for row. Counts only. Admin only. Refuses a grouping the metric lacks, an inverted range or one over 364 days with BAD_USER_INPUT. See `MetricSeries` and ADR-0015.
input: MetricSeriesInput!
locationReplayRuns [LocationReplayRun!]! The Replay runs that re-located a Signal in the range, newest first, at most 50 (ADR-0020). Each can be drawn as a second line on location precision: `metricSeries` with `replayRunId`. Range rules as `metricSeries`. Platform admin only.
input: LocationReplayRunsInput
metricAnnotations [MetricAnnotation!]! The changes that should move a metric (deploys, imports, prompt changes), oldest first, in a range and optionally for one metric, drawn as markers on the /metrics charts. Admin only. See `MetricAnnotation` and ADR-0016.
input: MetricAnnotationsInput
pipelineCountries [PipelineCountry!]! The countries the CLEAR pipeline publishes a Situation Analysis for, with each Country's bounding box. The scheduled publisher reads this to know which countries to run. Requires authentication.
translations [TranslationRow!]! Translation rows currently stored for an entity, one per locale. Admin/pipeline only. Used by clear-pipeline to compare stored source hashes against the canonical row and decide which fields to re-translate.
entityType: String!entityId: String!
pendingTranslations [TranslationQueueItem!]! Entities enqueued for (re)translation, oldest-first — the Dagster translation drain (durable replacement for the lazy-on-read Celery enqueue). Optional entityType/locale filters; `first` caps the batch (default 100, max 500). Admin/pipeline only.
first: IntentityType: Stringlocale: String
translationCoverage [TranslationCoverage!]! Per-(entityType, locale) translation coverage snapshot for the admin dashboard. Admin only. Each row reports canonicalCount (how many entities of that type exist) and translatedCount (how many have a translation row for that locale). Coverage = translated / canonical.
entitiesMissingTranslation [ID!]! IDs of entities of the given type that have NO translation row for the given locale. Admin/pipeline only. Lets the backfill driver enqueue only entities the worker would actually translate, instead of relying on per-task staleness diffs to no-op thousands of already-current rounds. Stale rows (row exists but hashes are out of date) are NOT returned here - they're rare and handled by the per-entity enrichment hooks.
entityType: String!locale: String!
resolveKnowledgebaseLocation String Resolve a knowledge-base location reference to a `locations.id`. Pcode wins over name; `adminLevel` narrows the name match so a village that shares its state's name doesn't collide. Returns null when neither the pcode nor the name matches - the ingest keeps the raw pcode on the row so a future backfill can re-resolve. A name given without `adminLevel` that matches more than one admin level is ambiguous and also returns null (rather than guessing the deepest match), so an unlevelled name never silently lands on the wrong tier. Admin / pipeline only.
pcode: Stringname: StringadminLevel: Int
resolveGazetteerLocation GazetteerHit Resolve a place name against CLEAR's place aliases, then the offline GeoNames gazetteer - the first tier of the hybrid geo-resolver. A place alias (ADR-0019) wins: the same normalised name and country, and a scope that is the whole country or holds `withinLocationId`. Its hit has `source: ALIAS` and a `locationId`, with the location's point as the coordinates. Then GeoNames (`source: GEONAMES`): an exact normalised-name match, then a `pg_trgm` fuzzy match, preferring populated places / admin areas (feature class P/A) and the more-populous tie-break. `countryCode` (ISO-3166-1 alpha-2, e.g. "SD") scopes the search; omit to search every loaded country. `minSimilarity` (default 0.4) floors the fuzzy match. Arabic names (GeoNames' Arabic alternate names) match exactly only: no fuzzy tier. `withinLocationId` keeps only matches strictly inside that location's geometry (null for an unknown id or one without geometry), so a same-named place elsewhere can't win on population. Returns null on no match - the geoparser then falls back to LocationIQ for landmarks/POIs the gazetteer lacks. Admin / pipeline only.
name: String!countryCode: StringminSimilarity: FloatwithinLocationId: String
searchKnowledgebase [KnowledgebaseHit!]! Hybrid dense + BM25 retrieval over the knowledge base, fused with Reciprocal Rank Fusion (k=60) and returned in descending score order. Both retrievers run in parallel over the same filter set; each contributes up to 50 candidates before fusion. The embedding provider is the one configured in the environment - keep the write and read sides on the same provider or turn on `filters.currentEmbeddingModelOnly` to guarantee vector-space consistency. Requires any authenticated content reader. Two tiers are searched (ADR-0006): the ReliefWeb report KB (state / analysis) and the incident index (event cards, always fresh). Each tier is retrieved + RRF-fused independently, then merged tier-aware so the few short incident cards are never buried by the many dense report chunks. `mode` picks the merge: FRAME (a location+time frame with little topical text — the situation-analysis case) returns a report band + a quota-bounded incident band ordered by recency + severity; TOPICAL (a strong free-text query — the chatbot case) interleaves by relevance, gating weak incidents. AUTO picks FRAME when the query is effectively empty/frame-only, else TOPICAL. Every hit carries its `tier`.
query: String!filters: KnowledgebaseFilterslimit: Inttiers: [KnowledgebaseTier!] — Which tiers to search. Default: both (the KB is always fresh). Pass [report] to get the pre-ADR-0006 report-only behaviour.mode: KnowledgebaseSearchModeincludeFigures: Boolean — When true, append a band of the most relevant FIGURE hits (charts / maps / infographics) AFTER the normal text results — the RAG-with-figures case: a chatbot gets its answer context plus supporting visuals in one call. Figure hits carry `figureS3Key` / `figureImageUrl`, so split the band off by `figureS3Key != null`; their scores sit just below the text hits. These are IN ADDITION to `limit` (they don't displace text), and deduped against any figure that already ranked into the main results. No-op when `filters.figuresOnly` is set (that's already figures-only) or the report tier isn't searched. Default false.figureLimit: Int — How many figures the `includeFigures` band may add (1–20). Default 6.
searchReports [ReportHit!]! Find whole REPORTS (not chunks) and get a download link — the Cap 3 read path ("fetch me the UNHCR report on X between these dates"). Groups the knowledgebase by `reportId` and returns one `ReportHit` per report, each with a presigned PDF `downloadUrl`. Two modes, picked by whether `query` is a non-empty topical string: - With a query: semantic retrieval over report chunks, grouped to the best-matching chunk per report, ordered by that best similarity. - Without a query: a filter/date listing ordered by `publishedAt` descending (most recent first). `source` is a case-insensitive substring matched against the report title and source URL (e.g. "UNHCR"). `publishedRange` filters on the report's publication date (distinct from `filters.timeRange`, which is the chunk's extracted EVENT window). `filters` applies the same location / event-type / sector scoping as `searchKnowledgebase`. Requires any authenticated content reader.
query: String — Topical query. Omit or pass empty for a pure filter/date listing.filters: KnowledgebaseFilterspublishedRange: DateRangeInput — Filter on the report's PUBLICATION date (inclusive).source: String — Case-insensitive substring on report title / source URL (e.g. a publisher like "UNHCR" or "OCHA").limit: Int
searchReportsNaturalLanguage NlReportSearch! Natural-language front door to `searchReports` (the "NL on top of structured" layer). Parses a free-text question — e.g. "fetch me the UNHCR report on flooding in Sudan between March and June 2024" — into the structured arguments (`source`, publication-date window, country scope, and the residual topical query) and runs the same report search. Returns BOTH the parsed `interpreted` filters and the `reports`, so a caller can show how the question was understood and, if it's wrong, call `searchReports` directly with corrected arguments. Parsing is deterministic (no LLM): it recognises a curated set of publishers, common date phrasings, and country names from the locations table. Anything it doesn't recognise simply stays in the topical query, which still finds the report by content. Requires any authenticated content reader.
question: String!limit: Int
reportFiguresPendingKbMerge [ReportFigureForMerge!]! Figures (from `report_figures`) whose report is in the knowledgebase but whose figure chunk isn't present yet — the work list for the figure→KB sync (clear-pipeline). Returns ALL figures for each report that needs syncing (not just the missing ones) so the caller can `figuresOnly`-upsert the complete set per report. Bounded by `limit` REPORTS (not figures), oldest report id first. admin/pipeline only.
limit: Int
knowledgebaseIngestJob KnowledgebaseIngestJob Poll a Dagster run kicked off by `uploadKnowledgebaseDocument`. Returns null when the runId doesn't exist on this Dagster instance (e.g. Dagster was restarted with a fresh instance store, or the runId was recorded against a different DAGSTER_URL). Requires any authenticated content reader.
runId: String!
reportDatapoint ReportDatapoint One report's extracted structured datapoints. Returns null when no extraction has been persisted yet (report ingested via vector RAG but the datapoint pipeline hasn't caught up). Requires any authenticated content reader.
reportId: String!
situationAnalysis SituationAnalysis Current situation-analysis snapshot for one bucket of a country. Buckets are keyed `(countryLocationId, windowKind, windowStart)`. By default reads the yearly bucket, where `year` derives `windowStart = Jan 1` server-side and falls back to `year(now())` when null - the dashboard's usual call. Pass `windowKind` + `windowStart` instead to read a finer bucket (e.g. monthly, to diff one month against the previous). Returns null when no snapshot exists - the dashboard should render an empty state and wait for the next weekly generation. Requires any authenticated content reader.
countryLocationId: String!year: IntwindowKind: String — Bucket granularity, part of the bucket key. Defaults to `yearly`. The pipeline owns this taxonomy (currently `yearly` and `monthly`), so it is not validated against a fixed list here - an unknown value simply matches no row and returns null.windowStart: DateTime — Exact bucket start, matched for equality. Required when `windowKind` is anything other than `yearly`, because a year alone cannot identify a finer bucket. Must be the same instant the writer used (midnight UTC on the first day of the window), so pass the value the pipeline computed rather than reconstructing it. `windowEnd` is never matched on.asOf: DateTime — Historical read - return the version that was current at this timestamp (defaults to now).schemaVersion: String — Pin the read to a payload schema version. Defaults to the most recently written version for the bucket. Versions coexist rather than supersede - an older payload shape stays readable, so pass this to keep a client on a shape it understands. Read `schemaVersion` off the returned row to see what you got.
situationAnalysesForCountry [SituationAnalysis!]! Trend / history view - one row per year for a country, current versions only, newest year first. Never mixes schema versions: a bump changes what the numbers mean, so one series is always one version. Requires any authenticated content reader.
countryLocationId: String!limit: IntschemaVersion: String — Pin the trend to a payload schema version. Defaults to the country's most recently written version. Pass an older one to chart a historical payload shape.
situationAnalysisById SituationAnalysis Read one situation-analysis snapshot by its row id, including superseded history rows (the bucket-keyed `situationAnalysis` query only returns the current row). Used by the translation pipeline to fetch a specific generation's canonical prose. `data` is overlaid with the caller's locale translation like every other read — the pipeline calls it as `en` and gets canonical text back. Requires any authenticated content reader.
id: String!
analysis Analysis Unified frame-scoped analysis (ADR-0007). Reads the current row for a FRAME (locationIds / eventTypes / needSectors / window) — the generalised successor to `situationAnalysis`, and the read path for "crisis overview" frames. `windowEnd` null in the frame reads the rolling ("to present") row. Pass `asOf` for a historical read and `schemaVersion` to pin a payload shape. Returns null when no analysis exists for the frame yet. Requires any authenticated content reader.
frame: AnalysisFrameInput!asOf: DateTimeschemaVersion: String
analysisById Analysis Read one analysis by row id, including superseded history rows (the frame-keyed `analysis` query only returns the current row). Requires any authenticated content reader.
id: String!
nodeAnalyses [NodeAnalysis!]! Read the current per-node deep-dive results for a frame (analysis-node-deepdive) — the L2/L3 leaves generated on demand, one row per taxonomy node (ordered by depth then key). Pass `schemaVersion` to pin the payload shape. Requires any authenticated content reader.
frame: AnalysisFrameInput!schemaVersion: String!
analysisAutomations [AnalysisAutomation!]! List analysis automation subscriptions (ADR-0007 §5). Optionally scope to a team or to enabled rows only. Requires any authenticated content reader.
teamId: StringenabledOnly: Boolean
analysisAutomation AnalysisAutomation One analysis automation, for its title, discussion, and evidence. A content reader on the owning team, or any content reader for a system-owned automation. Null when the id is unknown.
id: String!
pendingAnalyses [AnalysisRequest!]! Pipeline drain (ADR-0007 §4): the oldest PENDING on-demand analysis requests, so the generation sensor can pick them up. Admin / pipeline only.
limit: Int
dueAnalysisAutomations [AnalysisAutomation!]! Scheduler drain (ADR-0007 §5): enabled analysis automations that are DUE (never run, or their nextRunAt has passed). The pipeline groups them by frame and regenerates each at the minimum cadence across subscribers. Admin / pipeline only.
limit: Int
frameEvidenceWatermark FrameEvidenceWatermark! Latest-evidence watermark for a frame (ADR-0008) over the `knowledgebase` retrieval corpus — `latestEvidenceAt` (max ingestion time) + `evidenceCount`. The pipeline drains compare it to the live analysis's `generatedAt` to decide whether new evidence warrants a regeneration. Admin / pipeline only.
frame: AnalysisFrameInput!
reportFigures [ReportFigure!]! Captured infographics (charts/maps/tables/composite panels) filtered by the SAME params as text — location / event type / need sector / time / kind — so a figure can be attached to an answer scoped to a place + topic + period. Powers figure attachment + on-demand infographic generation. Array filters match ANY tag; time overlaps the window. Any authenticated content reader.
reportId: StringlocationIds: [String!]eventTypes: [String!]needSectors: [String!]kinds: [String!]timeRangeStart: DateTimetimeRangeEnd: DateTimefirst: Int — Max rows to return (1–200, default 50).after: String — Cursor for pagination: the `id` of the last figure from the previous page. Rows after it (in the stable extractedAt/pageNumber/id order) are returned. Omit for the first page; a report's figures are capped well under 200 so most callers never need this.
hasAggregatedDatapoints Boolean! True when at least one current `aggregated_datapoints` row exists for the given schema version. Used by the Dagster aggregation asset to distinguish first-run backfill (wide lookback window) from routine weekly refreshes (narrow window). Pass `countryLocationId` (an admin-0 location id) to scope the check to ONE country, so a newly-onboarded country's first run uses the initial window even after other countries are established — the four-tier walk always produces yearly/all-time buckets AT the country location, so an A0 row is the per-country signal. Any authenticated content reader - a cheap existence check.
schemaVersion: String!countryLocationId: String
aggregatedDatapoint AggregatedDatapoint Aggregated datapoints for a (window × window_kind × location) scope. Cache-first: returns the pre-computed snapshot when one is current (`validTo IS NULL` or covers the `asOf` timestamp); otherwise assembles the bucket on-demand from `report_datapoints` and returns it with `onDemand = true`. Returns null when no contributing reports exist in scope.
locationId: String — Null = country-wide roll-up (yearly / all-time tiers).windowStart: DateTime!windowEnd: DateTime!windowKind: String!schemaVersion: String — Defaults to the currently-configured pipeline schema version.asOf: DateTime — Historical snapshot lookup - return the version that was current at this timestamp. Defaults to `now`.
webhookSubscriptions [WebhookSubscription!]! All webhook subscriptions, newest first.
webhookSubscription WebhookSubscription One subscription by ID, or null if not found.
id: String!
webhookDeliveries [WebhookDelivery!]! Recent delivery attempts for a subscription, newest first.
subscriptionId: String!limit: Int
teamAlertWebhooks [WebhookSubscription!]! A team's clear_alert webhook subscriptions. Caller must be a team admin, org admin, or platform admin for the team. Secrets are scrubbed.
teamId: String!
groundSources [GroundSource!]! All ground sources (per-source policy records), newest first.
groundThreads [GroundThread!]! Review queue: ground threads, newest first. Filter by source and/or review state ("unverified" | "approved_private" | "approved_public" | "rejected").
groundSourceId: StringreviewState: Stringlimit: Intoffset: Int
groundThread GroundThread One ground thread with its messages, or null if not found.
id: String!
groundMessages [GroundMessage!]! Staged messages, oldest first. Filter by source and/or thread.
groundSourceId: StringthreadId: Stringlimit: Intoffset: Int
groundMessagesForClassification [GroundMessageForClassification!]! PIPELINE CONTRACT (admin/pipeline only): a source's staged messages, oldest first, projected for the classification/threading worker — no private-tier sender identity. By default returns ALL messages (classified and not) so one query powers both labelling and thread assembly (clustering staged Signals into threads). Drains pass `unclassifiedOnly` / `awaitingTranscript` to read only their work queue — the default window is the oldest `limit` messages and stops advancing once those are all done.
groundSourceId: String!limit: IntunclassifiedOnly: Boolean — Only messages with no classification yet — the enrichment drain's queue. Excludes messages marked failed for enrichment, and voice notes marked failed for transcription (they have no content to enrich until a retry transcribes them).awaitingTranscript: Boolean — Only hotline voice notes with no transcript yet — the transcription drain's queue. Excludes messages marked failed for transcription.
groundThreadsForSource [GroundThread] PIPELINE CONTRACT (admin/pipeline only): threading context for the classification worker — a source's existing threads, oldest first, so late corrections/retractions can target an existing thread via GroundThreadUpsertInput.threadId. `states` filters on lifecycleState ("reported" | "updated" | "confirmed" | "corrected" | "retracted"); omitted/empty returns all. The worker selects {id, title, lifecycleState, reviewState, messageIds} — no message content, no sender identity.
groundSourceId: String!states: [String!]
pipelineGroundSourceIds [String!]! PIPELINE CONTRACT (admin/pipeline only): active source ids for a given kind, minimal projection (no consent/policy fields) — used by the hotline enrichment job to enumerate sources to drain.
kind: StringisActive: Boolean
groundMessageForTranslation GroundMessageForTranslation PIPELINE CONTRACT (admin/pipeline only): the translate drain's canonical fetch for a queued groundMessage translation — text and detected language, no sender identity. Null if the message is gone.
id: String!
task Task One Task by id, or null. Any authenticated content reader; the Task's status follows its Event's visibility. `lastError` is visible to the requester and platform admins only.
id: String!
eventTasks [Task!]! Enrichment Tasks about an Event, newest first. Same gate as `task`.
eventId: String!
myTasks [Task!]! The caller's own requests: Tasks they asked for, across every Event, newest first — "what happened to the thing I asked for". Always scoped to the signed-in requester; `status` narrows it. `lastError` is present (the caller is the requester). Any approved content reader except the worker role, which requests nothing.
status: TaskStatuslimit: Intoffset: Int
eventImpactPriors [ImpactPrior!]! History: the whole ImpactPriors Workers proposed for an Event in V1–V3, newest first. Nothing creates them any more (the ImpactPrior is computed, see `Event.computedImpactPriors`) and none can be decided. An `accepted` one follows the Event's visibility; a `proposed` one is visible to its requester and to deciders (admins, and the Task team's analysts and team admins); a `rejected` one to deciders only.
eventId: String!
caseProposals [CaseProposal!]! The Inbox's per-case Review items (V4): CaseProposals in one state across every Event, newest first — `proposed` by default. Platform admins (every team), and team analysts and team admins (their own teams' Tasks only), so the list is exactly what the caller may decide.
state: CaseProposalStatelimit: Intoffset: Int
eventCaseProposals [CaseProposal!]! Web cases proposed for an Event, newest first. Same visibility as `Event.caseProposals`.
eventId: String!
rejectedCaseUrls [String!]! Source URLs already rejected for an Event: a web Worker reads this before searching and never proposes one again. The worker role, platform admins and analysts.
eventId: String!
briefs [Brief!]! Briefs, newest first. Platform admins only.
limit: Intoffset: Int
brief Brief One Brief, or null. Platform admins only.
id: String!
recipientLists [RecipientList!]! Every Recipient list, by name. Platform admins only.
briefDigestPreview [DigestPreviewRow!]! What the automatic daily Alert Digest would send for a Brief's area and window: each published Alert it would include, newest first, with how many daily subscribers it would reach. Alerts no subscriber matches are left out. Reads only: nothing is written or sent. Works on sent Briefs too, against today's subscriptions. Platform admins only.
briefId: String!

Mutations

NameReturnsDescription
recordOnboardingCompleted Boolean! Record that you finished onboarding (`user.onboarding_completed`). Best-effort: returns true even if the log write fails. Any signed-in user.
recordReportExported Boolean! Record that you exported an analysis report (`analysis.report_exported`). The log row holds the analysis id and its frame (locations, event types, need sectors, window), never content. Best-effort: returns true even if the log write fails. Any signed-in user.
analysisId: String!
createApiKey CreateApiKeyPayload! Create a new API key for the authenticated user.
input: CreateApiKeyInput!
grantApiSignalSource ApiSignalSourceGrant! Open one data source's Signals to an API-only developer. Admin only. Idempotent: re-granting an existing pair returns the existing row.
userId: String!dataSourceId: String!reason: String
revokeApiSignalSource Boolean! Close one data source for an API-only developer. Admin only. Returns false when no such grant existed.
userId: String!dataSourceId: String!
revokeApiKey ApiKey! Revoke an API key by ID. Only the key owner or an admin can revoke.
id: String!
upsertConversation Conversation! Create one of your Conversations with the CLEAR Agent's thread id, or update its title or metadata. FORBIDDEN if the id belongs to another user. CLEAR Agent only (the owner's session plus the agent key).
input: UpsertConversationInput!
upsertConversationMessages [ConversationMessage!]! Create or replace messages in one of your Conversations, matched by id (at most 200 per call). Only the owner's Conversations, admins included, and CLEAR Agent only (the owner's session plus the agent key). An Answer whose usage is recorded can't change. Returns the messages in input order.
conversationId: String!messages: [ConversationMessageInput!]!
saveAgentWorkingMemory AgentWorkingMemory! Create or update your CLEAR Agent working memory. CLEAR Agent only (your session plus the agent key).
input: SaveAgentWorkingMemoryInput!
recordConversationTurnUsage ConversationMessage! Record what a CLEAR Agent turn used (model, tokens, cost, latency) on its Answer, an `assistant` message in one of your Conversations. The cost counts toward your daily Agent budget. Write-once: FORBIDDEN if the turn's usage is already recorded. Owner only, CLEAR Agent only (the owner's session plus the agent key).
messageId: String!usage: ConversationTurnUsageInput!
createDevUser CreateDevUserResult! Provision a developer account from an approved waitlist application. Creates the user, mints an initial API key (no expiry), issues a long-lived set-password verification token, and sends the welcome email. Requires global `admin`. The CRM write-back is the caller's responsibility.
input: CreateDevUserInput!
rotateDevUserApiKey RotateDevUserApiKeyResult! Revoke every active API key for a dev user and issue a fresh one. Notifies the user by email. Requires global `admin`.
userId: String!
approveUser ApproveUserResult! Approve a self-signed-up user. Flips their role from `pending` to `member` (granting read access to signals / events / alerts / crises) and emails them that they are approved. When a CRM is configured, also moves their contact into the approved collection. The role flip is authoritative; the email and CRM sync are best-effort and report back on the result. Requires global `admin`.
userId: String!
updateUserRole User! Set a user's global platform role (`member` or `admin`; `analyst` is now a team role). Does not approve pending users — call `approveUser` first. Requires global `admin`. Cannot demote yourself or the last remaining admin. This is the product write path for the Users-tab dropdown on the operator app; the Developer Portal HTML form hits the same service via POST `/portal/admin/users/role`.
userId: String!role: GlobalRole!
requestEmailVerification Boolean! Request an email verification link for the authenticated user. `frontendBaseUrl` sets the host of the verification link (trusted as given for this authenticated call; defaults to `FRONTEND_URL`). `senderEmail`/`senderName` set Reply-To and the From display name.
frontendBaseUrl: StringsenderEmail: StringsenderName: String
verifyEmail Boolean! Verify email using a token from the verification link.
token: String!
updateProfile User! Update the authenticated user's profile and notification preferences.
input: UpdateProfileInput!
createAlert Alert Create an alert from an event, notifying subscribers. Returns `null` (no error) when the event's types are all NRC-irrelevant, so the pipeline can skip it without a thrown error / GlitchTip alert.
input: CreateAlertInput!
updateAlert Alert! Update an existing alert.
id: String!input: UpdateAlertInput!
deleteAlert Boolean! Delete an alert.
id: String!
archiveStaleAlerts ArchiveStaleAlertsResult! Archive published alerts whose event.lastSignalCreatedAt is older than olderThanDays (default: 14). Sets alerts.status to 'archived'. Admin or pipeline only. Returns the number of rows affected.
olderThanDays: Int
createSignal Signal! Create a signal from a data source.
input: CreateSignalInput!
markSignalsProcessed Int! Mark signals done for the Dagster drain, after classify→group→alert or after recomputing a changed signal's events. Sets status (PROCESSED, or FAILED) and processedAt. Pass exactly one of `ids` (unconditional) or `items` (compare-and-set: a row is updated only if its revision still matches). Returns rows updated. Idempotent. Admin/pipeline only. Each marked Signal a pipeline brought in also gets one row in the location Outcome log (ADR-0020): the location it has now, at the new processedAt. `runKind` says which kind of run this is (default LIVE); a Signal that a run already finished is recorded as REPLAY whatever is sent. `pipelineVersion` is the clear-pipeline git SHA and `runId` the Dagster run id.
ids: [String!]items: [SignalRevisionInput!]status: SignalStatusrunKind: LocationRunKindpipelineVersion: StringrunId: String
requeueSignals Int! Put signals back in the Dagster drain queue for a backfill: sets status NEW and clears processedAt, so the next drain re-classifies and re-groups them. Only signals with no event link are requeued - a linked signal would be grouped a second time - so delete or unlink their events first. At most 500 ids per call. Returns rows requeued. Admin only.
ids: [String!]!
createManualSignal Signal! Create a manual signal from a field officer, partner, or government source. Persists the signal and sends it to the pipeline for event grouping and auto-escalation.
input: CreateManualSignalInput!
updateSignalSeverity Signal! Update a signal's severity score.
id: String!severity: Int!
setSignalGlideCode Signal! Record the glide code the pipeline grouped a signal with, so an event recompute can reproduce grouping's per-signal stats fallback. Idempotent (overwrites). Admin/pipeline only.
id: String!glideCode: String!
updateSignalGeoparsedData Signal! Attach the clear-pipeline geoparser's result to an existing signal. Used for the manual-signal flow, where the signal is created via createManualSignal before the pipeline has a chance to run the geoparser. Stores the structured candidate verbatim; does not change locationId. Admin/pipeline only.
id: String!geoparsedData: JSON!
updateSignalLocation Signal! Set (or replace) an existing signal's generalLocation. Used by pipeline paths that place a signal after it was created: manual signals whose author picked no location, and push feeds (e.g. sudan-war-x) that arrive with text only. The location is an admin area matched from the text, or an L4 from findOrCreateLandmarkL4, so downstream event grouping can key on its admin-2 district instead of creating an isolated event. Admin/pipeline only. The drain marks the Signal afterwards, and that mark writes the location Outcome (ADR-0020). A replay job that moves a Signal without the drain passes `runKind: REPLAY`: the move then writes a REPLAY Outcome itself, with `pipelineVersion` (the clear-pipeline git SHA) and `runId`.
id: String!locationId: String!runKind: LocationRunKindpipelineVersion: StringrunId: String
updateSignalContent Signal! Apply an in-place change to a signal, identified by `id` or by (`sourceId`, `externalId`). Content is written when contentHash differs, `retracted` when the flag differs; either bumps `revision`, stamps lastRevisedAt and moves a grouped signal to NEEDS_RECOMPUTE. A changed `rawS3Key` alone is metadata-only; a no-op re-send is ignored. Admin/pipeline only.
input: UpdateSignalContentInput!
deleteSignal Boolean! Delete a signal.
id: String!
setEventAggregates Event! Overwrite an event's aggregates with values recomputed from scratch from its live (non-retracted) member signals. Absent fields are left unchanged; explicit nulls clear them. `members` is the (id, revision) snapshot the values were computed from; if the live members differ, nothing is written and the call fails with STALE_EVENT_MEMBERS (a newer recompute supersedes it; do not retry). `runKind`, `pipelineVersion` and `runId` name the run, for the Event facts log (ADR-0021): a call with an API key writes the Event's onset, first Signal date and places as this run left them. Admin/pipeline only.
id: String!input: EventAggregatesInput!members: [SignalRevisionInput!]!runKind: LocationRunKindpipelineVersion: StringrunId: String
submitSignalLocationChallenge SignalLocationChallenge! File a Location challenge on a Signal for a team, with an optional corrected point. Auth: an analyst on that team, or a platform admin; the Signal must be within the team's area. Supersedes the Signal's open challenge, if any. Never changes the Signal: a decision does.
input: SubmitSignalLocationChallengeInput!
decideSignalLocationChallenge SignalLocationChallenge! Decide an open Location challenge. Auth: the team_admin of the team it was filed for, or a platform admin, including whoever filed it. ACCEPT writes the proposed point onto the Signal; CORRECT writes `point` instead; DECLINE leaves the Signal as it is. A written point becomes the Signal's general location (a reused or new level-4 point under the admin area containing it; origin and destination are cleared, countries follow), and later source revisions keep it. Writing needs the Signal still within the team's area, and the point inside the areas CLEAR covers and, unless a platform admin decides, within the team's area. CONFLICT when the challenge is no longer open.
id: String! — The challenge to decide.decision: SignalLocationChallengeDecision! — ACCEPT, CORRECT or DECLINE.point: LocationChallengePointInput — The point to write: required with CORRECT, refused otherwise.
recordUnresolvedPlaceName UnresolvedPlaceName! Record a place name that geocoding could not place inside a Signal's area (ADR-0019). Creates the queue row for (country, normalised spelling, state), or adds the Signal to the row that exists. A Signal counts once per row, so a re-run changes nothing. The row's status never changes here: a row marked not a place stays closed and only its count and dates move. Auth: admin or pipeline.
input: RecordUnresolvedPlaceNameInput!
resolveUnresolvedPlaceName UnresolvedPlaceName! Resolve a row of the unresolved place-name queue (ADR-0019). A location answer (LOCATION, GEONAMES or POINT) writes a place alias for the spelling in the row's state, closes the row as RESOLVED and moves the waiting Signals to the alias location. A Signal moves only when the alias location is inside its current location and no person corrected it. NOT_A_PLACE and AMBIGUOUS close the row with no alias. Auth: a platform admin, or a team admin when the row is inside their team's area; a team admin must place the answer inside the row's state. CONFLICT when the row is already resolved or marked not a place, or when the spelling has an alias.
id: String! — The queue row.resolution: UnresolvedPlaceNameResolutionInput!note: String — Why, at most 2000 characters. Kept on the row and on the alias.
createPlaceAlias PlaceAlias! Add a place alias by hand (source MANUAL), to an existing location or to a new point. It also resolves the open queue rows with the same spelling in its scope, and moves their waiting Signals. Auth: a platform admin, or a team admin for a scope inside their team's area; a country-wide alias needs a platform admin. CONFLICT when the scope already has an alias for the spelling.
input: CreatePlaceAliasInput!
updatePlaceAlias PlaceAlias! Change a place alias's target, scope or note. Signals it moved before stay where they are: the change applies to new Signals. Auth as createPlaceAlias, for the alias's scope and for the new one.
id: String!input: UpdatePlaceAliasInput!
deletePlaceAlias Boolean! Delete a place alias. Signals it moved stay where they are. The queue row it came from goes back to OPEN. Auth as createPlaceAlias. Returns true.
id: String!
createEvent Event! Create a new event from signals.
input: CreateEventInput!
updateEvent Event! Update an existing event.
id: String!input: UpdateEventInput!
deleteEvent Boolean! Delete an event.
id: String!
escalateEvent EventEscalation! Escalate an event: creates an alert (published) and records the user escalation. If the event already has a published alert, just records the user escalation. teamId (optional) admits any team member on that team even without a global admin role — purely an authorisation hint, not stored on the event.
eventId: String!userId: String!teamId: String
createDataSource DataSource! Create a new data source.
input: CreateDataSourceInput!
updateDataSource DataSource! Update an existing data source.
id: String!input: UpdateDataSourceInput!
deleteDataSource Boolean! Delete a data source.
id: String!
createMetricAnnotation MetricAnnotation! Record a change that should move a metric, as a marker on the /metrics charts (ADR-0016). Admin only; logged as `metric_annotation.create`. Refuses an empty label, a non-http link, no metric or an unknown one with BAD_USER_INPUT.
input: CreateMetricAnnotationInput!
deleteMetricAnnotation Boolean! Remove a metric annotation. Admin only; logged as `metric_annotation.delete`. NOT_FOUND when there is none with that id.
id: ID!
resolveDataSource String! Idempotently resolve an organisation/source name to a data_sources id, creating an ungraded row if none matches (admin/pipeline only). Matching order: exact name/synonym → infoUrl (when homepage given) → pg_trgm fuzzy (>= minSimilarity, default 0.6) → create. On a URL/fuzzy hit the incoming name is appended as a synonym so future lookups hit exactly. Returns the resolved data_sources id. When markTrusted is true the resolved source is graded at the maximum reliability (4) — used for the publisher of a human-uploaded document, which is trusted by virtue of a team member deliberately uploading it. This overwrites any existing grade. See clear-pipeline ADR-0004.
name: String!homepage: StringminSimilarity: FloatmarkTrusted: Boolean
createLocation Location! Create a new location.
input: CreateLocationInput!
ensureCountryLocation Location! Idempotently resolve a level-0 Country location by exact name, creating it with a bounding-box MULTIPOLYGON geometry if absent (admin/pipeline only). bbox is [minLng, minLat, maxLng, maxLat]. Returns the (found or created) Country — doubles as the pipeline's name→id resolution.
name: String!bbox: [Float!]!
updateLocation Location! Update an existing location.
id: String!input: UpdateLocationInput!
deleteLocation Boolean! Delete a location.
id: String!
updateLocationGeometry Location! Replace a location's geometry with the given GeoJSON (admin/pipeline only).
id: String!geometry: GeoJSON!
updateLocationPopulation Location! Set a location's cached population (admin/pipeline only).
id: String!population: String!
updateCrisisPopulation Crisis! Set a crisis's populationAffected + populationInArea (admin/pipeline only).
id: String!input: UpdateCrisisPopulationInput!
upsertLocationMetadata LocationMetadata! Create or update a location's metadata entry for a given type (admin/pipeline only). Upsert keyed by (locationId, type).
input: UpsertLocationMetadataInput!
upsertLocationMetadataBatch [LocationMetadata!]! Bulk-upsert multiple (locationId, type, data) rows in a single call (admin/pipeline only). Returns the current row for each input. Rows whose locationId doesn't exist are skipped silently. Idempotent: an input whose blob is identical to the currently-open row is left untouched (no new history version), so re-running an ingest with unchanged data is a no-op.
inputs: [UpsertLocationMetadataInput!]!
deleteLocationMetadata Boolean! Delete a location's metadata entry for a given type (admin only).
locationId: String!type: String!
findOrCreateLandmarkL4 FindOrCreateLandmarkL4Result! Find an existing level-4 location matching a geoparsed candidate, or create one. Used by the clear-pipeline geoparser to promote a landmark hit (e.g., "Nyala Airport") into a reusable A4 instead of letting the resolver invent a fresh point-location for every signal. When sourceLat and sourceLng are provided, the resolver verifies that the candidate's containing A2 matches the source coord's containing A2 — on mismatch it aborts with abortedReason="different_a2" so the caller can fall back to source coords. Without source coords no check is made: the text-only signal path checks the point lies inside the admin area it matched from the text before calling. Admin/pipeline only.
input: FindOrCreateLandmarkL4Input!
upsertNominatimCache NominatimCacheEntry! Upsert a Nominatim geocoder cache entry (admin/pipeline only). Replaces any existing row with the same queryHash, resetting the TTL.
input: UpsertNominatimCacheInput!
setFeatureFlag FeatureFlag! Set the enabled state of a feature flag, identified by its string key. Upserts the row so the same call works whether the key is already present. Admin only — toggling features is an org-wide change, not a per-user preference. Returns the persisted flag so callers can update local state without an extra round-trip.
key: String!enabled: Boolean!
createNotification Notification! Create a notification for a user.
input: CreateNotificationInput!
createBulkNotifications Int! Create notifications for multiple users at once. Returns the count of notifications created.
input: CreateBulkNotificationsInput!
notifyAlertSubscribers Int! Notify all subscribers of a single alert (immediate frequency). Matches on event types and locations.
input: AlertNotifyInput!
notifyAlertDigest Int! Send a digest notification for multiple alerts to subscribers of the given frequency (daily/weekly/monthly).
input: AlertDigestInput!
deleteNotification Boolean! Delete a notification.
id: String!
markNotificationRead Notification! Mark a notification as read.
id: String!
markAllNotificationsRead Boolean! Mark all notifications as read for the authenticated user.
addFeedback UserFeedback! Add feedback (rating + optional text) to a signal or event.
input: AddFeedbackInput!
deleteFeedback Boolean! Delete your own feedback.
id: String!
addComment UserComment! Add a comment to a signal or event.
input: AddCommentInput!
replyToComment UserComment! Reply to an existing comment.
input: ReplyToCommentInput!
deleteComment Boolean! Delete your own comment.
id: String!
tagUsersInComment UserComment! Tag users in a comment.
commentId: String!userIds: [String!]!
createOrganisation Organisation! Create a new organisation. The creator becomes the first org_admin.
input: CreateOrganisationInput!
updateOrganisation Organisation! Update an existing organisation. Requires org_admin (or platform admin).
id: String!input: UpdateOrganisationInput!
addOrgMember OrgMember! Add a member to an organisation.
orgId: String!userId: String!role: OrgMemberRole
removeOrgMember Boolean! Remove a member from an organisation.
orgId: String!userId: String!
updateOrgMemberRole OrgMember! Change a member's role within an organisation. Requires the caller to be a platform admin or an org_admin of the target organisation.
orgId: String!userId: String!role: OrgMemberRole!
deleteOrganisation Boolean! Delete an organisation and all its teams, members, and invitations. Requires global admin.
id: String!
createTeam Team! Create a new team within an organisation. Requires org_admin (or platform admin).
input: CreateTeamInput!
updateTeam Team! Update an existing team.
id: String!input: UpdateTeamInput!
deleteTeam Boolean! Delete a team.
id: String!
addTeamMember TeamMember! Add an organisation member to a team. Emails them that they were added, unless they added themselves.
teamId: String!userId: String!role: TeamMemberRole
removeTeamMember Boolean! Remove a member from a team.
teamId: String!userId: String!
updateTeamMemberRole TeamMember! Update a team member's role.
teamId: String!userId: String!role: TeamMemberRole!
setTeamLocations Team! Set the locations a team is scoped to. Replaces all existing locations.
teamId: String!locationIds: [String!]!
setDefaultTeam Team! Set the authenticated user's default team (for frontend convenience).
teamId: String!
inviteUser Invitation! Invite a user to an organisation and one or more of its teams. Sends an invite email; an existing org member is added to the teams at once. Org admins may invite with any org role. A team admin may invite with the member org role into teams they are team admin of.
input: InviteUserInput!
acceptInvite Boolean! Accept an invitation. Creates user account if new, adds to org and team.
input: AcceptInviteInput!
cancelInvite Boolean! Cancel a pending invitation.
id: String!
resendInvite Invitation! Resend an invitation email (resets expiry to 7 days). The optional sender/frontend arguments brand the email and link the same way as inviteUser; trusted as given for this authenticated call.
id: String!frontendBaseUrl: StringsenderEmail: StringsenderName: String
requestPasswordReset Boolean! Request a password reset email (public, always returns true). `frontendBaseUrl` sets the host of the reset link. Because this mutation is unauthenticated, that override is honoured only when its origin is in the operator's `ALLOWED_FRONTEND_ORIGINS` allowlist; otherwise it falls back to `FRONTEND_URL` (a token-bearing link can never be pointed at an arbitrary host). `senderEmail`/`senderName` set Reply-To and the From display name.
email: String!frontendBaseUrl: StringsenderEmail: StringsenderName: String
resetPassword Boolean! Reset password using a token from the reset email.
token: String!newPassword: String!
subscribeToAlerts AlertSubscription! Subscribe to alerts for a specific type and location.
input: SubscribeToAlertsInput!
subscribeToAlertsBatch [AlertSubscription!]! Subscribe to alerts for multiple (location × alertType) combinations in a single call. Returns the list of created subscriptions. Duplicates are skipped silently.
input: SubscribeToAlertsBatchInput!
updateAlertSubscription AlertSubscription! Update an existing alert subscription (channel, frequency, active).
id: String!input: UpdateAlertSubscriptionInput!
unsubscribeFromAlerts Boolean! Unsubscribe - deletes the subscription.
id: String!
createCrisisFromEvents Crisis! Create a new crisis from a list of event IDs. Links all provided events to the new crisis.
input: CreateCrisisFromEventsInput!
markCrisisEnriched Crisis! Mark a crisis ENRICHED for the Dagster drain — the enrichment consumer calls this once narrative/scenarios/needs-analysis are current. Idempotent. Admin/pipeline only.
id: String!
addEventToCrisis EventCrisis! Add an existing event to an existing crisis. Idempotent - returns the existing link if one already exists.
crisisId: String!eventId: String!
removeEventFromCrisis Crisis Remove an event from a crisis. Recomputes populationAffected from the remaining events and dispatches the enrichment task so title/summary get regenerated to reflect the new event set. If the event being removed is the LAST event, deletes the crisis entirely and returns null. Otherwise returns the updated crisis (title/summary still show pre-removal values until the async enrichment task completes).
crisisId: String!eventId: String!
updateCrisisTitle Crisis! Edit a crisis's title in place. Any approved user (admin or member); a `pending` signup or the `worker` role is FORBIDDEN. Pass an empty string to clear the field.
id: String!title: String!
updateCrisisDescription Crisis! Edit the human-facing description on a crisis. The crisis's summary column stores JSON of the form description+tldr — this mutation updates just the description key and preserves any existing tldr bullets (which the LLM enrichment task generates). Any approved user (admin or member); a `pending` signup or the `worker` role is FORBIDDEN. Pass an empty string to clear the description without disturbing the tldr.
id: String!description: String!
deleteCrisis Boolean! Delete a crisis. Cascades the eventCrises join rows, user feedback, and user comments via the FK constraints. Platform admins only.
id: String!
addCrisisAttachments Crisis! Append S3 keys to a crisis's attachments list. Idempotent — keys already present in the list are skipped silently. Returns the updated crisis with the new list. Any approved user (admin or member); a `pending` signup or the `worker` role is FORBIDDEN.
id: String!keys: [String!]!
removeCrisisAttachment Crisis! Remove an S3 key from a crisis's attachments list. Does NOT delete the underlying S3 object (operators can clean those up separately). Returns the updated crisis. Any approved user (admin or member); a `pending` signup or the `worker` role is FORBIDDEN.
id: String!key: String!
setCrisisNeedsAnalysis Crisis! Set the LLM-generated NRC SAF needs analysis inside the crisis's needs JSONB. Merges generalSummary and sector keys into the existing object so other keys on needs are preserved. Admin/pipeline only.
id: String!generalSummary: [String!]!sector: JSON!
upsertTranslations UpsertTranslationsResult! Upsert one or more per-locale translation rows for an event, crisis, or location. The translated data blob mirrors the canonical entity's JSON shape per locale. Admin/pipeline only. Clears any matching rows from the translation queue (the write is the drain-completion signal).
input: UpsertTranslationsInput!
enqueueTranslation TranslationQueueItem! Enqueue an entity for (re)translation at a locale — the durable replacement for the lazy-on-read Celery enqueue. Idempotent (one row per entity+locale). Admin/pipeline only.
entityType: String!entityId: String!locale: String!
markTranslated Boolean! Remove an entity/locale from the translation queue (explicit drain completion). Returns true when a queued row was removed. upsertTranslations clears the queue itself, so this is only for consumers not writing via it. Admin/pipeline only.
entityType: String!entityId: String!locale: String!
upsertKnowledgebaseChunks UpsertKnowledgebaseResult! Replace all knowledgebase rows for `reportId` with `chunks`. Runs inside one transaction — a failed insert rolls back the delete so a re-run can retry cleanly. Vector length is validated against the pgvector column dimension (1024) on the server; mismatched rows are rejected before the write hits Postgres. Admin/pipeline only.
reportId: String!reportTitle: String!sourceUrl: String!s3Key: String!publishedAt: DateTime!chunks: [KnowledgebaseChunkInput!]!figuresOnly: Boolean — When true, delete only this report's FIGURE chunks before inserting, leaving its text chunks intact — the figure→KB sync uses this to attach figures to a report whose text was ingested in an earlier run. Every chunk must then be a figure chunk (figureS3Key set). Default false = replace all chunks for the report (text + figures), the original behaviour.teamId: ID — Team-scoped upload attribution (Cap 1): stored on every chunk of the report so a team-scoped read can filter by it. Null for the weekly ReliefWeb ingest; set for a team member's manual upload.uploadedByUserId: ID — clear-api user id of the uploader (provenance). Null for weekly ingest.
syncEventCards SyncEventCardsResult! Synthesise, embed, and upsert incident-tier "event cards" into `events_index` for the given events (ADR-0006) — replace-on-revise, keyed by event id. Call this when events are created or revised (from the signal→event grouping step, or a periodic catch-up) to keep the incident tier of `searchKnowledgebase` fresh. Embedding uses the same provider+model as the report KB. Admin/pipeline only.
eventIds: [String!]!
upsertReportDatapoints UpsertReportDatapointsResult! Replace the `report_datapoints` row for `input.reportId`. Admin / pipeline only. The dagster-quickstart datapoints extraction asset is the primary caller; hand-invocation is supported for backfills and re-extraction. Idempotent — the row is uniquely keyed on `report_id`.
input: UpsertReportDatapointsInput!
upsertAnalysisDatapoints UpsertAnalysisDatapointsResult! Upsert the analysis module's final numbers for one analysis generation (clear-pipeline `analysis_numbers_extract`). Keyed on `analysisId` (one row per generation) — idempotent replace-in-place. Admin / pipeline only.
input: UpsertAnalysisDatapointsInput!
upsertSituationAnalysis UpsertSituationAnalysisResult! Insert a fresh situation-analysis snapshot for (`input.countryLocationId`, `input.windowStart`, `input.windowEnd`) and stamp `validTo = now()` on the previous current row for the same bucket in the same transaction. History rows are preserved. Admin / pipeline only — the Dagster `weekly_situation_analyses` asset is the primary caller.
input: UpsertSituationAnalysisInput!
upsertAnalysis UpsertAnalysisResult! Upsert a unified frame-scoped analysis (ADR-0007). The pipeline generator's write path: bitemporal supersede-then-insert keyed on the frame columns (locationIds / eventTypes / needSectors / windowStart / windowEnd), stamping `validTo` on the previous current row for the same frame in the same transaction. History rows are preserved. Frame arrays are canonicalised (sorted + de-duplicated) server-side. Admin / pipeline only.
input: UpsertAnalysisInput!
upsertNodeAnalyses UpsertNodeAnalysesResult! Pipeline: upsert the per-node results of an on-demand node deep-dive — one bitemporal row per (frame × taxonomy node × schemaVersion), each superseding its own previous current row in one transaction. The frame-scoped sibling of `upsertAnalysis` at node granularity (analysis-node-deepdive). Admin / pipeline only.
input: UpsertNodeAnalysesInput!
touchAnalysisSynced Boolean! Pipeline: bump the current analysis row's `lastSyncedAt` for a frame WITHOUT regenerating (ADR-0008) — used when the drain's gate decides to skip (within the 24h floor, or no new evidence). Returns false when no current row exists for the frame. Admin / pipeline only.
frame: AnalysisFrameInput!
createAnalysisAutomation AnalysisAutomation! Create an analysis automation — a subscription that keeps a frame's analysis current on a cadence (ADR-0007 §5). Admin, or a team analyst on the owning team.
input: CreateAnalysisAutomationInput!
updateAnalysisAutomation AnalysisAutomation! Update an analysis automation's cadence or enabled flag. Admin, or a team analyst on the owning team.
id: String!input: UpdateAnalysisAutomationInput!
deleteAnalysisAutomation Boolean! Delete an analysis automation subscription. Admin, or a team analyst on the owning team.
id: String!
requestAnalysis AnalysisRequest! Enqueue an on-demand analysis for a frame (ADR-0007 §4). Dedupes against an existing PENDING request for the same frame. Admin, or a team analyst on the owning team. A manual trigger always regenerates: it bypasses both the 24h regeneration floor and the new-evidence freshness gate (ADR-0008). The floor still governs scheduled automations.
input: RequestAnalysisInput!
markAnalysisRequestGenerated AnalysisRequest! Pipeline: mark a drained request GENERATED after its analysis was upserted. Admin / pipeline only.
id: String!
markAnalysisRequestFailed AnalysisRequest! Pipeline: record a generation failure on a request (bumps the attempt counter). Admin / pipeline only.
id: String!error: String
markAnalysisAutomationsRan Int! Scheduler: stamp lastRunAt + nextRunAt (from each row's cadence) on the automations whose frame was just regenerated (ADR-0007 §5) — pass all the ids sharing that frame. Returns the count updated. Admin / pipeline only.
ids: [String!]!
upsertReportFigures UpsertReportFiguresResult! Replace a report's captured infographics (image asset store). Pipeline-only; delete-then-insert like `upsertReportDatapoints`.
input: UpsertReportFiguresInput!
refreshAggregatedDatapoints RefreshAggregatedDatapointsResult! Pre-compute all four aggregation tiers (weekly × A2, monthly × A1, yearly × country, all-time × country) for reports whose `reportingPeriodEnd` falls in `[from, to]`. Each computed bucket is inserted with `validFrom = now()`; the previous "current" row for the same bucket key has its `validTo` stamped in the same transaction. History rows are preserved. Admin / pipeline only. Pass `countryLocationId` (an admin-0 location id) to SCOPE the refresh to that country's subtree — only that country's buckets are (re)computed (the window's reports are still scanned; the bucket step filters to scopes whose admin-0 ancestor is this country). Omit it to refresh every country in the window (the original global behaviour). The per-country partitioned pipeline passes it so each country's run recomputes only its own buckets instead of a redundant global pass. An unresolvable id errors rather than silently computing nothing.
from: DateTime!to: DateTime!schemaVersion: String!countryLocationId: String
uploadKnowledgebaseDocument KnowledgebaseIngestJob! Upload a PDF into the manual-ingest S3 inbox and trigger the Dagster `process_manual_document_job` to run the extract → chunk → enrich → embed → upsert chain against it. The report_id is derived from the file's SHA-256 (first 12 chars, prefixed `manual:`) so re-uploading the same bytes is idempotent — Dagster runs but the upsert path replaces the previous version in place. To force a fresh row, tweak the file (any byte) or switch to a scripted upload that supplies its own report_id. Team-scoped (Cap 1): a global admin, or any content-writer member of `teamId`, may upload — the ingest costs LLM + embedding credits per document, so it stays gated, but a team member can now upload on behalf of their team rather than it being admin-only. The uploader and (when given) the team are attributed onto the Dagster ingest run. Omit `teamId` only as a global admin; a non-admin must pass a `teamId` they belong to. When DAGSTER_URL is unset the mutation still stages the PDF in S3 but returns a UNKNOWN-status job with no runId — useful for offline dev of the upload path.
file: Upload!title: String!sourceUrl: StringpublishedAt: DateTime!countryIso3: String — Optional ISO3 country code (e.g. `"SDN"`) the document is about — selects the knowledge-base country partition it is ingested into (`kb_downstream_job`). When omitted, the country is derived from the analysis automation's frame (its locations' level-0 ancestor), so a normal frame-attached upload needs no explicit value. Required only when there is no automation to derive from. Must resolve to a pipeline country.teamId: ID — Team to attribute the upload to. Required for a non-admin uploader (must be a team they belong to); optional for a global admin.analysisAutomationId: ID — Optionally attach this upload to an analysis automation. The file is ingested into the knowledgebase exactly as a normal upload; in addition its name (with the resulting `reportId`/`s3Key`) is recorded against the automation as a document in its reference set. The automation must belong to `teamId` (or be system-owned and uploaded by an admin).
createGroundSource GroundSource! Create a ground source — the per-source policy record (consent scope, privacy default, reviewer roles, retention) that every ingest from a WhatsApp group or hotline is gated on. Admin only; group kinds require a complete consent record (consentScope + consentRecordedAt + consentRecordedBy).
input: CreateGroundSourceInput!
updateGroundSource GroundSource! Update a source's policy record (admin only, partial). The merged row is re-validated — a group-kind source cannot be left without a complete consent record, so legacy rows must have consent supplied in the same update. transportId is immutable.
id: String!input: UpdateGroundSourceInput!
setGroundSourceActive GroundSource! Activate or deactivate a source (admin only). Deactivation is the live-capture kill switch: the ingest consent gate rejects every payload for an inactive source. Deliberately exempt from consent-record validation so an incomplete legacy row can still be shut off immediately.
id: String!isActive: Boolean!
reviewGroundThread GroundThread! Review a ground thread: decision is "approve_private", "approve_public", or "reject". Open to platform admins (any source) and to members who are an emergency_response_manager or team_admin, for the sources assigned to those teams; a thread from another team's source is NOT_FOUND. Transitions follow the V1 state machine — notably approved_public is terminal. approve_public also promotes the thread into the standard signals graph via createSignal, with all sender identity scrubbed. `overrides` (approve_public only) carries the reviewer's edits into the promoted signal. `rejectReason` (reject only) is one of "spam", "not_report", "unusable", "duplicate"; any other decision clears it. Either one sent with the wrong decision is BAD_USER_INPUT.
id: String!decision: String!note: StringrejectReason: Stringoverrides: GroundPromotionOverridesInput
upsertGroundMessageClassifications Int! PIPELINE CONTRACT (admin/pipeline only): write back classifications from the classify_ground_messages worker. Unknown messageIds are skipped with a warning. Returns the number of messages updated.
inputs: [GroundMessageClassificationInput!]!
upsertGroundMessageTranscripts Int! PIPELINE CONTRACT (admin/pipeline only): write back transcriptions from the ground_transcribe worker. Unknown messageIds are skipped with a warning. Returns the number of messages updated.
inputs: [GroundMessageTranscriptInput!]!
upsertGroundThreads [String]! PIPELINE CONTRACT (admin/pipeline only): replace placeholder threading with pipeline-built threads (clusters of staged Signals). Each input creates a thread (or, when `threadId` is set, APPENDS to that existing thread and updates its lifecycleState + title), re-points its messageIds at it, and deletes the placeholder threads that became empty. Messages whose current thread has already been human-reviewed (or promoted) are NEVER re-threaded, and a promoted `threadId` target is never mutated (a new thread is created instead) — the review gate outranks the pipeline. Returns one thread id per input, in order; null where an input had no movable messages (no thread created or updated).
inputs: [GroundThreadUpsertInput!]!
upsertGroundThreadDrafts Int! PIPELINE CONTRACT (admin/pipeline only): write back enrichment drafts (title/severity/location/disasterType) from the hotline enrichment job. Unknown threadIds are skipped with a warning. Null fields on an input leave the existing draft value unchanged. Returns the number of threads updated.
inputs: [GroundThreadDraftInput!]!
markGroundMessagesFailed Int! PIPELINE CONTRACT (admin/pipeline only): durably mark messages a ground drain has given up on (attempts exhausted, or a message that can never succeed). A marked message drops out of that stage's queue in groundMessagesForClassification until retryGroundMessage clears it. A message whose stage already succeeded (classification / transcript set) is left unmarked. Unknown messageIds are skipped with a warning. Returns the number of messages marked.
inputs: [GroundMessageFailureInput!]!
retryGroundMessage GroundMessage! Clear a message's failure marker for one stage (admin), so it re-enters that drain's queue on the next pipeline run. No-op when the stage isn't marked failed. Returns the message.
messageId: String!stage: GroundPipelineStage!
requestGroundMessageTranslation GroundMessageTranslation! Translate one staged message's text into `locale` (admin) — any supported locale, `en` included (the source is the reporter's language). Queues it for the pipeline's translate drain and returns the current state; poll GroundMessage.translation(locale) while queued. Idempotent: a ready translation is returned as is, a queued one keeps its place, and a request after the drain gave up queues it again. A message with no text is unavailable. The message's own text is never changed.
messageId: String!locale: String!
createWebhookSubscription WebhookSubscription! Create a new webhook subscription. The response is the only place the plaintext secret is returned — persist it in your own records (e.g. downstream verifier config) at this moment. To retrieve later, use rotateWebhookSubscriptionSecret which generates a fresh one.
input: CreateWebhookSubscriptionInput!
updateWebhookSubscription WebhookSubscription! Update a subscription. Only provide fields you want to change.
id: String!input: UpdateWebhookSubscriptionInput!
deleteWebhookSubscription Boolean! Permanently delete a subscription and all its delivery history.
id: String!
rotateWebhookSubscriptionSecret WebhookSubscription! Generate a new secret and invalidate the old one. Response includes the new plaintext secret (same one-shot semantics as create).
id: String!
sendTestWebhookEvent WebhookDelivery! Send a synthetic test event to this subscription. Creates a WebhookDelivery row and attempts delivery immediately. Payload mimics GlitchTip's alert format so downstream verifiers see a realistic shape.
id: String!
retryWebhookDelivery WebhookDelivery! Re-fire a dead-lettered delivery. Resets attemptNumber to 1 and schedules an immediate retry via the poller.
id: String!
createAlertWebhook WebhookSubscription! Create a team-scoped clear_alert webhook subscription. The caller must be a team admin, org admin, or platform admin for the team. The response is the only place the plaintext secret is returned.
input: CreateAlertWebhookInput!
updateAlertWebhook WebhookSubscription! Update a clear_alert webhook. Only provide fields you want to change. The secret is never returned here — rotate it with rotateAlertWebhookSecret.
id: String!input: UpdateAlertWebhookInput!
deleteAlertWebhook Boolean! Permanently delete a clear_alert webhook and its delivery history.
id: String!
rotateAlertWebhookSecret WebhookSubscription! Generate a new secret for a clear_alert webhook and invalidate the old one. Response includes the new plaintext secret (one-shot).
id: String!
requestEventEnrichment [Task!]! Request an Event enrichment. Always fans out: one Task per enabled source kind of the `kind` family (server-configured; today `event.impact_prior.web`, the web search that proposes signals for analysts to review), so every Worker proposes on the Event side by side and nothing marks it done. Returns the open (PENDING / LEASED) Task per kind, in configured order — an already-open one is returned unchanged rather than duplicated; only kinds with none get a new Task. Same rights as `escalateEvent`: a global admin anywhere; a team member (incl. a team analyst) for the `teamId` they act on behalf of. Capped per requester per UTC day, counting requests not Tasks (FORBIDDEN with subCode `DAILY_CAP`); a request that creates nothing does not count. The only family today is `event.impact_prior` (a historical name: the ImpactPrior itself is computed, see `Event.computedImpactPriors`); `horizonYears` (default 10) is how far back each Worker looks for cases.
eventId: String!kind: StringteamId: StringhorizonYears: Int
decideCaseProposal CaseProposal! Decide one web case (V4): a platform admin, or a team analyst or team admin on the case's team, accepts or rejects it, recorded as who, when and why (the Domain Ontology's DecisionRecord). Only from `proposed` (CONFLICT otherwise). The `rationale` is required to reject and optional to accept. Accepting writes the case into CLEAR as history, in one transaction: a Signal (source `web_enrichment`, `url` the case's source, `publishedAt` the date the incident happened, submitted by the decider) on the CLEAR Event it describes — the Worker's matched Event, else the Event that already carries the same URL, else a new historical Event dated to the incident. A Signal with the same URL already in CLEAR is reused, not duplicated. Historical Events never alert: their newest Signal is the incident's date. The case's figures become Estimates on that Event (`media_report`, `event_caused`). The returned case carries `resultSignalId` and `resultEventId`. Rejecting keeps the case, so its URL is never proposed again for that Event.
id: String!decision: CaseProposalDecision!rationale: String
cancelTask Task! Cancel a Task. The requester or a platform admin only. A PENDING Task is CANCELLED at once; a LEASED one is flagged and becomes CANCELLED at the Worker's next heartbeat, completion or failure (its result is discarded). Any other status is CONFLICT.
id: String!
claimTasks [Task!]! WORKER CONTRACT (`worker` role): lease up to `limit` of the oldest claimable Tasks of exactly `kind` — PENDING, or LEASED past their expiry — atomically (`FOR UPDATE SKIP LOCKED`), so no two Workers hold the same Task. A Worker drains its own source kind (`event.impact_prior.web`, …). The retired whole-prior kinds — the bare `event.impact_prior` and `event.impact_prior.clear` — are BAD_USER_INPUT. `limit` is clamped to the platform cap. Each lease lasts TASK_LEASE_MINUTES; heartbeat to keep it.
kind: String!limit: Int
heartbeatTask Task! WORKER CONTRACT: keep a lease alive. Extends `leaseExpiresAt` by TASK_LEASE_MINUTES from now. Only the lease owner, only while LEASED (CONFLICT `NOT_LEASED`, FORBIDDEN `NOT_LEASE_OWNER` — the latter means the lease lapsed and was reclaimed, so this `leaseToken` is stale; stop working on it). If cancellation was requested, the Task becomes CANCELLED and the Worker should stop.
id: String!leaseToken: String!
failTask Task! WORKER CONTRACT: give the Task up with an error. It returns to PENDING for another Worker (or attempt) while attempts remain, and becomes FAILED with this as its `lastError` once `maxAttempts` claims have been used. Only the lease owner, only while LEASED.
id: String!leaseToken: String!error: String!
completeTask Task! WORKER CONTRACT: report the Task done. `result` is the raw output (audit only). For an `event.impact_prior.web` Task, pass `cases` and `methodVersion` (V4): one CaseProposal per case, each decided on its own (outcome `produced`); a URL already proposed for the Event is skipped (`no_new_cases` when all were); an empty list or none records `no_prior_found`. Any other kind completes with `result` only. The whole-prior `impactPrior` input was removed (2026-10-08): the ImpactPrior is computed from history. Only the lease owner, only while LEASED (CONFLICT `NOT_LEASED`, FORBIDDEN `NOT_LEASE_OWNER`). If cancellation was requested meanwhile the Task becomes CANCELLED and the result is discarded.
id: String!leaseToken: String!result: JSON!usage: TaskUsageInputcases: [CaseProposalInput!]methodVersion: String — Skill or handler version that produced `cases`; required with them.
createBrief Brief! Start a draft Brief for one area. The window ends now and starts 24 hours, 7 days or 30 days earlier, by cadence.
input: CreateBriefInput!
updateBrief Brief! Edit a draft Brief's text. Only the fields given change. Every mutation on a sent Brief or its items is BAD_USER_INPUT "Brief already sent".
id: String!input: UpdateBriefInput!
refreshBriefWindow Brief! Move a draft Brief's window end to now and its start back by the cadence.
id: String!
deleteBrief Boolean! Delete a draft Brief and its items. Sent Briefs are kept.
id: String!
addBriefItem BriefItem! Pick an Alert, Event or Signal into a draft Brief, at the end of its kind's group. The snapshot is built from the live row; the client never supplies it. Picking the same item again returns the existing one. NOT_FOUND when the entity doesn't exist.
briefId: String!kind: BriefItemKind!entityId: String!
removeBriefItem Boolean! Unpick an item from a draft Brief.
itemId: String!
updateBriefItemNote BriefItem! Set or clear (null or blank) an item's analyst note.
itemId: String!note: String
reorderBriefItems [BriefItem!]! Reorder one kind's group. `itemIds` must list every item of that kind in the Brief exactly once, in the new order.
briefId: String!kind: BriefItemKind!itemIds: [String!]!
sendBriefTest Boolean! Email the Brief to one address, with [TEST] in the subject and no unsubscribe link. `to` defaults to the caller's own address (also when blank). Changes nothing. False when the email provider refused it.
id: String!to: String
sendBrief BriefSendResult! Send a draft Brief to a Recipient list and freeze it. In one transaction it rewrites every item's snapshot from live data (keeping the stored one when the entity is gone), stores the counts and marks the Brief sent; then it emails every member who hasn't unsubscribed, each with their own unsubscribe link. Failed emails are counted, not retried. BAD_USER_INPUT when the Brief is already sent, the list has no one to send to, or the window was refreshed during the send (send again).
id: String!recipientListId: String!
createRecipientList RecipientList! Create an empty Recipient list. BAD_USER_INPUT when the name is blank or taken.
name: String!
addRecipientListMember RecipientListMember! Add an address to a Recipient list, lower-cased. It need not belong to a CLEAR user. An address already on the list is returned unchanged, so re-adding never clears an unsubscribe.
listId: String!email: String!
removeRecipientListMember Boolean! Take an address off its Recipient list.
memberId: String!

Types

All types in the schema, auto-generated from the running server.

DateTime scalar

ISO 8601 date-time string (e.g. 2024-01-15T09:30:00.000Z).

GeoJSON scalar

JSON scalar

Arbitrary JSON value — objects, arrays, strings, numbers, booleans, or null.

Upload scalar

File upload scalar (via graphql-upload).

AlertOrderBy enum

ValueDescription
CREATED_DESCNewest first by event.firstSignalCreatedAt.
CREATED_ASCOldest first by event.firstSignalCreatedAt.
SEVERITY_DESCHighest event severity first.
SEVERITY_ASCLowest event severity first.

AlertStatus enum

Publication status of an alert.

ValueDescription
draft—
published—
archived—

AnalysisRequestStatus enum

ValueDescription
PENDING—
GENERATED—
FAILED—

BriefCadence enum

How far back a Brief window reaches from its end.

ValueDescription
dailyThe last 24 hours.
weeklyThe last 7 days.
monthlyThe last 30 days.

BriefItemKind enum

Which detection a Brief item points at. Items are grouped by kind, shown in the order alert, event, signal.

ValueDescription
alert—
event—
signal—

BriefStatus enum

A Brief is edited while `draft` and frozen once `sent`.

ValueDescription
draft—
sent—

CaseProposalDecision enum

The decision a named admin or analyst records on a proposed case.

ValueDescription
accepted—
rejected—

CaseProposalState enum

A web Worker writes `proposed` only (V4). A named admin or analyst accepts or rejects each case; a rejected one stays, so its URL is never proposed again for the same Event.

ValueDescription
proposed—
accepted—
rejected—

Channel enum

Notification channel for alert subscriptions.

ValueDescription
email—
sms—

CrisisEnrichmentStatus enum

Durable enrichment status for the Dagster drain. PENDING = needs (re)enrichment (set on crisis create / event add / event remove); ENRICHED = narrative/scenarios/needs-analysis current.

ValueDescription
PENDING—
ENRICHED—

DateAccuracy enum

Precision of an extracted start/end date — how finely the pipeline's LLM could pin the real-world onset/close. DAY = exact; coarser values mean the date is only known to that week/month/year.

ValueDescription
DAY—
WEEK—
MONTH—
YEAR—

DetectionExclusionReason enum

Why an Event in range is left out of time to detection. Each excluded Event has exactly one reason, the first that applies in this order.

ValueDescription
NO_INGESTED_SIGNALNo Signal a pipeline ingested: only history (accepted web cases) or Signals a person filed by hand.
NO_ONSETThe Event has no onset date to measure from.
COARSE_ONSETThe onset is only known to a week/month/year (coarse startedAtAccuracy), so a whole-day delay would be spuriously precise.
DATE_ONLY_FIRST_SIGNALThe first ingested Signal has a date but no time of day (published at exactly UTC midnight).
BEFORE_ONSETThe first ingested Signal is dated before the onset day: a data error.

DetectionStatus enum

Processing status of a detection (retained for potential future use).

ValueDescription
raw—
processed—
ignored—

EntityKind enum

ValueDescription
signal—
event—
alert—

EstimateAttribution enum

Whether a figure counts need caused by the Event, need that existed beforehand, or both.

ValueDescription
event_caused—
pre_existing—
combined—

EstimateMethod enum

How a figure was arrived at (the Domain Ontology's Estimate methods). `not_documented` when the method is unknown, e.g. figures backfilled from the pipeline's Event fields.

ValueDescription
exposure_model—
model_inference—
rapid_assessment—
formal_assessment—
registration—
field_staff_judgement—
partner_or_cluster_figure—
prior_caseload_analogue—
government_figure—
media_report—
not_documented—

EstimateMetric enum

Which of the seven distinct figures an Estimate is (the Domain Ontology's Metric types). The sector routinely conflates them; keeping them apart is the point.

ValueDescription
people_affected—
people_displaced_new—
people_displaced_cumulative—
people_in_need—
people_targeted—
people_reached—
households_affected—

EventOrderBy enum

ValueDescription
LAST_SIGNAL_DESCNewest signal first (lastSignalCreatedAt).
LAST_SIGNAL_ASCOldest signal first (lastSignalCreatedAt).
CREATED_DESCNewest first by firstSignalCreatedAt.
CREATED_ASCOldest first by firstSignalCreatedAt.
SEVERITY_DESC—
SEVERITY_ASC—

Frequency enum

How often a user receives alert notifications.

ValueDescription
immediately—
daily—
weekly—
monthly—

GazetteerSource enum

Where a gazetteer answer came from.

ValueDescription
ALIASOne of CLEAR's own place aliases. `locationId` is set.
GEONAMESThe GeoNames copy.

GlobalRole enum

Assignable global platform roles. `pending` is not in this enum — those users must go through `approveUser` first. `analyst` is no longer global — it is a TeamMemberRole.

ValueDescription
member—
admin—

GroundPipelineStage enum

A clear-pipeline ground drain stage that can give up on a message.

ValueDescription
ENRICHground_hotline_enrich — classification + thread draft.
TRANSCRIBEground_transcribe — voice-note transcription.

GroundTranslationStatus enum

Where a message's on-demand translation stands.

ValueDescription
queuedRequested; the pipeline's translate drain hasn't written it yet.
readyTranslated — `text` holds it.
unavailableNot requested, nothing to translate (no text), or the drain gave up. Requesting again re-queues it.

ImpactPriorState enum

The state a V1–V3 whole-prior proposal was left in. Retired: none is created or decided any more.

ValueDescription
proposed—
accepted—
rejected—

InvitationStatus enum

Status of an invitation.

ValueDescription
pending—
accepted—
expired—

KnowledgebaseIngestStatus enum

Coarse-grained status of a manual-ingest Dagster run. Dagster's own RunStatus enum is finer-grained (STARTING / MANAGED / CANCELING / …) — we fold those down to what a UI actually needs to render.

ValueDescription
QUEUED—
STARTED—
SUCCESS—
FAILURE—
CANCELED—
UNKNOWNDagster is offline, the run id doesn't exist, or the run status is one this API doesn't recognise. Non-terminal — poll again.

KnowledgebaseSearchMode enum

How `searchKnowledgebase` merges the report + incident tiers (ADR-0006).

ValueDescription
AUTOPick FRAME when the query is effectively empty / frame-only, else TOPICAL.
FRAMESituation-analysis: a location+time frame with little topical text. Returns a report band + a quota-bounded incident band ordered by recency + severity; no similarity floor (it would gate out the very incidents the frame is asking for).
TOPICALChatbot: a strong free-text query. Interleaves the two tiers by relevance (soft), gating weak incidents below a similarity floor and giving reports a small rank preference.

KnowledgebaseTier enum

A knowledgebase tier (ADR-0006). `report` = the ReliefWeb state/analysis KB; `incident` = an event card from the incident index (lower-tier, possibly unverified). Lowercase values match the stored tier strings.

ValueDescription
report—
incident—

LocationRunKind enum

Which kind of pipeline run wrote a log row: a location Outcome (ADR-0020) or a grouping log Link (ADR-0021).

ValueDescription
LIVEThe run that processes a Signal for the first time, after ingest.
REPLAYA run that re-processes a Signal that a Live run already processed.

MetricDimension enum

The Notion Metrics table's dimension a metric sits under.

ValueDescription
TIMELINESS—
ACCURACY—
COVERAGE—
RELIABILITY—
USEFULNESS—

MetricGranularity enum

The bucket a metric series is read in (ADR-0014): a UTC calendar day, an ISO week from Monday 00:00 UTC, or a UTC calendar month.

ValueDescription
DAY—
WEEK—
MONTH—

MetricGroupBy enum

How a series can be split into groups.

ValueDescription
SOURCEOne series per data source (`DataSource.name`), in the owning query's order: most rows (Signals or Events) first, the expected-cadence list for Sources on schedule.

MetricKey enum

A metric the admin /metrics page can plot over time (ADR-0015). Each value is one registry entry in clear-api.

ValueDescription
DETECTED_BY_NEXT_DAYShare of measured Events first signalled on the onset day or the day after (ADR-0011).
DETECTED_SAME_DAYShare of measured Events first signalled on the onset day (ADR-0011).
ALERTED_BY_NEXT_DAYShare of measured Alerts raised on the Event's onset day or the day after (ADR-0017).
ALERTED_SAME_DAYShare of measured Alerts raised on the Event's onset day (ADR-0017).
DISTRICT_OR_FINERShare of located ingested Signals placed at a district or a point inside one (ADR-0012).
SIGNALS_GROUPEDShare of ingested Signals whose Event holds another ingested Signal, a grouping proxy (ADR-0018).
EVENTS_WITH_ONE_SIGNALShare of Events holding exactly one ingested Signal, a grouping proxy (ADR-0018).
ACLED_EVENTS_ALERTEDShare of ACLED events whose district held a CLEAR Alert from another feed within three days, a recall proxy (ADR-0018).
SOURCES_ON_SCHEDULEShare of source-days on which an expected data feed was within its cadence (ADR-0017).
EVENTS_ESCALATEDShare of Events a user escalated to the team, an interim usefulness proxy (ADR-0017).

MetricOnsetBasis enum

Which onset a delay metric measures from (ADR-0021, decision 4).

ValueDescription
AS_DELIVEREDEvery value as the Live pipeline run gave it at the time: the onset on the Alert, or the last onset a Live run gave the Event. Past buckets do not move after the Event settles, and no replay moves them.
CURRENTThe same instants, measured against the onset the Event has today. Past buckets move when the onset changes; every bucket has one ruler.

MetricUnit enum

What a metric's denominator counts.

ValueDescription
EVENTS—
SIGNALS—
SOURCE_DAYSOne per expected data source per measured UTC day.
ACLED_EVENTSOne ACLED event: the reference dataset's Signal.

NotificationStatus enum

ValueDescription
PENDING—
DELIVERED—
FAILED—
READ—

OrgMemberRole enum

Role within an organisation.

ValueDescription
org_admin—
member—

PlaceAliasSource enum

Where a place alias came from.

ValueDescription
REVIEWA decider resolved an unresolved place name.
SEEDA loaded list, for example critical facilities.
MANUALA user added it by hand.

PlaceNameSuggestionKind enum

What kind of place a suggestion is.

ValueDescription
GEONAMESA GeoNames row. Resolve with kind GEONAMES and its `geonamesId`.
LOCATIONA CLEAR district or landmark. Resolve with kind LOCATION and its `locationId`.

SignalLocationChallengeDecision enum

How an admin decides a Location challenge.

ValueDescription
ACCEPTWrite the proposed point onto the Signal.
CORRECTWrite a different point, given as `point`, onto the Signal.
DECLINELeave the Signal as it is.

SignalOrderBy enum

ValueDescription
PUBLISHED_DESCNewest first by publishedAt.
PUBLISHED_ASCOldest first by publishedAt.
SEVERITY_DESC—
SEVERITY_ASC—

SignalStatus enum

Durable processing status for the Dagster event-driven drain (pending work only; see `retracted`). NEW = awaiting first grouping; PROCESSED = classify→group→alert done; FAILED = terminal failure; NEEDS_RECOMPUTE = grouped, then changed (content revision or retraction flip), so its events must be re-aggregated from their live members.

ValueDescription
NEW—
PROCESSED—
FAILED—
NEEDS_RECOMPUTE—

StatsGroupBy enum

ValueDescription
noneSingle bucket — just `total`. Use this for "how many X" queries.
typeGroup by event/signal type (event.types[] is unnested; signals use their source name as the type proxy).
severityGroup by integer severity (1-5).
dayGroup by day / week / month of the entity's primary timestamp. Buckets are returned with ISO-8601 keys (`YYYY-MM-DD`, `YYYY-Www`, `YYYY-MM`).
week—
month—

TaskOrigin enum

Who asked for the Task: a signed-in user, an automatic rule, or an API-key caller.

ValueDescription
user—
rule—
api—

TaskStatus enum

Lifecycle of a Task. PENDING → LEASED (claimed) → COMPLETED | FAILED; PENDING or LEASED → CANCELLED. An expired lease returns the Task to PENDING lazily, at the next claim. Tasks are never deleted.

ValueDescription
PENDING—
LEASED—
COMPLETED—
FAILED—
CANCELLED—

TeamMemberRole enum

Role within a team. `analyst` carries elevated, location-scoped powers (promote alerts, decide tasks/cases, manage team analyses, act on events/alerts/crises within the team's location scope).

ValueDescription
team_admin—
analyst—
emergency_response_manager—
team_member—

UnresolvedPlaceNameReason enum

Why geocoding did not place a name.

ValueDescription
NO_MATCHThe gazetteer has no candidate for the spelling.
OUTSIDE_AREAA candidate exists, but it lies outside the Signal's area.

UnresolvedPlaceNameResolutionKind enum

How a decider answers a queued name.

ValueDescription
LOCATIONAn existing CLEAR location: give `locationId`.
GEONAMESA GeoNames suggestion: give `geonamesId`. It becomes a level-4 landmark.
POINTA new point: give `point`. It becomes a level-4 landmark.
NOT_A_PLACEThe spelling is not a place. The row closes and does not come back.
AMBIGUOUSThe spelling can mean more than one place. The row leaves the open queue and stays resolvable.

UnresolvedPlaceNameStatus enum

The state of an unresolved place name.

ValueDescription
OPENWaits for a decider.
RESOLVEDA decider gave it a location. A place alias holds the answer.
NOT_A_PLACEThe spelling is not a place. A later miss only adds to the count.
AMBIGUOUSThe spelling can mean more than one place. It needs local knowledge.

WebhookDeliveryStatus enum

ValueDescription
pendingWaiting for the first attempt (rare — the receive route usually attempts inline).
succeededDelivered — target returned 2xx on some attempt.
retryingFailed at least once; a retry is scheduled.
deadExhausted all retry attempts. Admin can manually re-fire.

AcceptInviteInput input

FieldTypeDescription
token String! —
name String! —
password String! —

ActivityLogFilterInput input

Filter for the paginated activityLogs query.

FieldTypeDescription
userId String —
actionPrefix String Action prefix match — e.g. 'crisis.' returns all crisis-related rows.
action String Exact action match.
resourceType String Coarse resource bucket — 'signal' / 'event' / 'alert' / 'crisis' / 'feedback' / 'session'.
from DateTime —
to DateTime —

AddCommentInput input

FieldTypeDescription
eventId String Provide exactly one of eventId, signalId, crisisId, or analysisAutomationId.
signalId String —
crisisId String —
analysisAutomationId String Discussion on an analysis automation. Shared with everyone who can read it.
comment String! —
tagUserIds [String!] User IDs to tag in the comment.

AddFeedbackInput input

FieldTypeDescription
eventId String Provide exactly one of eventId, signalId, or crisisId.
signalId String —
crisisId String —
rating Int! Rating from 1 to 5.
text String Optional textual feedback.

AgentMetricsInput input

The range to measure CLEAR Agent usage over. Both fields are optional.

FieldTypeDescription
from DateTime Start of the range, inclusive. Defaults to the start (Monday 00:00 UTC) of the ISO week 11 weeks before `to`'s week, so the default range is 12 ISO weeks.
to DateTime End of the range, inclusive. Defaults to now.

AlertDigestInput input

FieldTypeDescription
alertIds [String!]! List of alert IDs to include in the digest.
frequency String! Frequency: daily, weekly, or monthly.

AlertNotifyInput input

FieldTypeDescription
alertId String! Alert ID to notify subscribers about (uses immediate frequency).

AlertsPageInput input

FieldTypeDescription
limit Int Page size — clamped to [1, 100]. Default 25.
offset Int Zero-based row offset. Default 0.
orderBy AlertOrderBy —
status AlertStatus —
teamId String Apply a team's location-scope filter to the underlying events.
locationId String Restrict to alerts whose event sits under this location (or any of its descendants).
locationIds [String!] Like `locationId`, for several locations: keeps alerts whose event sits under any of them or under `locationId`. An empty list is no filter.
eventTypes [String!] Glide codes — alert event must contain at least one of these in its `types` array. Case-sensitive.
severityMin Int Inclusive lower bound on event severity (1-5).
severityMax Int Inclusive upper bound on event severity (1-5).
from DateTime Filter on event.firstSignalCreatedAt — inclusive.
to DateTime Filter on event.firstSignalCreatedAt — inclusive.
includeDummy Boolean Hide isDummy events when false (default).

AnalysisFrameInput input

A frame — the scope of an analysis. `windowEnd` omitted / null means rolling "to present". Array members are order-insensitive (canonicalised server-side).

FieldTypeDescription
locationIds [String!] —
eventTypes [String!] —
needSectors [String!] —
windowStart DateTime! —
windowEnd DateTime —

CaseFigureInput input

One figure a case's source gives.

FieldTypeDescription
metric String! One of `people_affected`, `people_displaced_new`, `people_displaced_cumulative`, `people_in_need`, `people_targeted`, `people_reached`, `households_affected`.
value Float! Non-negative. With bounds, `lowerBound ≤ value ≤ upperBound`.
lowerBound Float —
upperBound Float —
unit String —
populationGroup String —

CaseProposalInput input

One case a web Worker proposes on completing an `event.impact_prior.web` Task (V4).

FieldTypeDescription
sourceUrl String! Absolute http(s) URL; one case per URL per Event.
quote String! The source's own words, verbatim.
occurredAt DateTime! When the incident happened: within the request's horizon, not in the future.
locationLabel String! —
locationId String A CLEAR location in the Event's country, if resolved.
hazardType String! Must be one of the Event's `types`.
geographicScope String! `district` or `country`.
figures [CaseFigureInput!] —
matchedEventId String The CLEAR Event this case describes, if the Worker found one: it must exist, not be the Event being enriched, manifest the case's hazard and sit in the same country.

ConversationMessageInput input

One message to create or replace, matched by id.

FieldTypeDescription
id String! The Agent's message id. Rejected if it belongs to another Conversation.
role String! `user`, `assistant`, `system`, `tool` or `signal`.
type String —
content JSON! The message parts. At most 1,000,000 characters as JSON.
currentView JSON User turns: the Current view (page, entity ids, filters — identifiers, never data), at most 10,000 characters as JSON. Omit on update to keep it.
createdAt DateTime Ordering key for history. Defaults to now on create; omit on update to keep it.

ConversationTurnUsageInput input

What one CLEAR Agent turn used. Recorded on its Answer.

FieldTypeDescription
model String! The model id the turn ran on, e.g. `anthropic/claude-sonnet-5-5`.
inputTokens Int! —
outputTokens Int! —
costUsd Float! Cost in USD, computed by the caller from its price table.
latencyMs Int! —

CreateAlertInput input

FieldTypeDescription
eventId String! The event ID to create an alert from.
status AlertStatus —
runKind LocationRunKind The run that raises the Alert (ADR-0021). `runKind` defaults to LIVE; a replay job sends REPLAY, and that Alert is not part of the history series. Read only for a call with an API key: an Alert that a person raises has no run kind. `pipelineVersion` and `runId` are accepted so the pipeline sends one run block on every write; the Alert does not store them.
pipelineVersion String —
runId String —

CreateAlertWebhookInput input

Input for creating a team-scoped clear_alert webhook. The secret is generated server-side (openssl rand -hex 32 equivalent) and returned once on create.

FieldTypeDescription
teamId String! Owning team. The caller must be a team admin of this team, an org admin of its organisation, or a platform admin.
name String! —
targetUrl String! —
alertTypeFilter [String!] Optional glide-code allowlist. Empty / omitted = all event types.
minSeverity Int Optional minimum alert severity (1-5). Omitted = all severities.

CreateAnalysisAutomationInput input

FieldTypeDescription
locationIds [String!] —
eventTypes [String!] —
needSectors [String!] —
windowStart DateTime! —
cadence String! Refresh cadence label, e.g. `daily` / `weekly`.
teamId String Owning team. Omit for a system-owned automation (admin only).
title String Display name. Blank clears it. At most 120 characters.

CreateApiKeyInput input

Input for creating a new API key.

FieldTypeDescription
name String! A descriptive name for this key (e.g. my-app-prod).
expiresAt DateTime Optional expiration date. Omit for a key that never expires.

CreateBriefInput input

FieldTypeDescription
cadence BriefCadence! —
locationId String! A country, state or district (location level 0 to 2).
title String Defaults to "<Daily|Weekly|Monthly> Brief, <area name>".

CreateBulkNotificationsInput input

FieldTypeDescription
userIds [String!]! List of user IDs to notify.
message String! —
notificationType String! —
actionUrl String —
actionText String —

CreateCrisisFromEventsInput input

FieldTypeDescription
title String —
summary String —
severity Float! —
locationId String —
needs JSON! Needs as JSON.
eventIds [String!]! Event IDs to link to the newly created crisis (must not be empty).
teamId String Team the crisis is being filed under. When present, the caller may be any team member on that team instead of a global admin. Purely an authorisation hint — the crisis itself has no team column; team affiliation is derived from location scope. Ignored for platform-level callers.

CreateDataSourceInput input

FieldTypeDescription
name String! —
type String! —
isActive Boolean —
baseUrl String —
infoUrl String —
synonyms [String!] Alias set for source-name normalisation (see resolveDataSource).
reliability Int NATO Admiralty-style reliability grade 1–4; null = ungraded.

CreateDevUserInput input

Input for `createDevUser`.

FieldTypeDescription
email String! The dev's email address — also the dedup key against existing users.
name String! Display name shown in the welcome email and in the User row.
keyName String Optional descriptive label for the first API key. Defaults to "Initial dev key".

CreateEventInput input

FieldTypeDescription
signalIds [String!]! —
title String —
description String —
descriptionSignals JSON —
validFrom String! —
validTo String —
firstSignalCreatedAt String! —
lastSignalCreatedAt String! —
startedAt String When the real-world event started (onset), parsed from signal text. ISO-8601; null/omitted when no onset could be resolved.
endedAt String ISO-8601 event end (the onset's close), distinct from validTo. Null/omitted when no end is known ("ongoing").
startedAtAccuracy DateAccuracy Precision of startedAt / endedAt (DAY/WEEK/MONTH/YEAR).
endedAtAccuracy DateAccuracy —
magnitude Float Natural-hazard magnitude + its unit (e.g. 6.4 "Mw"), aggregated from member signals. Null for non-disaster events.
magnitudeUnit String —
actors [String!] Named conflict actors aggregated from member signals.
countryIds [String!] Admin-0 location ids the event touches (countries relation).
originId String —
destinationId String —
locationId String —
types [String!]! —
severity Int Severity score (1–5). Aggregated from signal severities.
populationAffected String —
populationDisplaced String Estimated population displaced (BigInt as string).
casualties Int Aggregated casualties for the event (sum across constituent signals).
rank Float! —
lat Float Latitude for automatic geo-resolution (resolves to nearest location in hierarchy).
lng Float Longitude for automatic geo-resolution.
teamId String Team the event is being filed under. When present, the caller may be any team member on that team instead of a global admin. Purely an authorisation hint — the event itself has no team column; team affiliation is derived from location scope. Ignored for platform-level callers.
runKind LocationRunKind The run that makes this write, for the grouping log and the Event facts log (ADR-0021). `runKind` defaults to LIVE; a replay job sends REPLAY. `pipelineVersion` is the clear-pipeline git SHA and `runId` the Dagster run id. clear-api writes to the logs only for a call with an API key: a person's Link or edit writes no row.
pipelineVersion String —
runId String —

CreateGroundSourceInput input

FieldTypeDescription
name String! —
kind String! "staff_group" | "partner_group" | "hotline".
transportId String! WhatsApp group JID (or hotline number). Must be unique.
consentScope String REQUIRED (with consentRecordedAt + consentRecordedBy) for the group kinds; hotline consent is explicit by design.
consentRecordedAt String —
consentRecordedBy String —
privacyDefault String Defaults to "private".
reviewerRoles [String!] Defaults to ["admin"].
retentionRule String —

CreateLocationInput input

FieldTypeDescription
geoId Int —
osmId String —
pCode String —
name String! —
level Int! —
parentId String —

CreateManualSignalInput input

FieldTypeDescription
sourceId String! Data source ID (must be field_officer, partner, or government type).
title String! —
description String! —
severity Int Severity score (1–5).
url String URL or reference link.
mediaUrls [String!] Media URLs (pre-uploaded via /api/upload endpoint).
media [Upload!] Media files (direct upload via graphql-upload, alternative to mediaUrls).
locationId String —
originId String —
destinationId String —
lat Float Latitude for automatic geo-resolution.
lng Float Longitude for automatic geo-resolution.
metadata JSON Arbitrary internal metadata stored in rawData (e.g. notes, recommendAlert). Not surfaced in the UI - use freely without schema changes.
teamId String Team the signal is being filed under. When present, the caller may be any team member on that team instead of a global admin. Purely an authorisation hint — the signal itself has no team column; team affiliation is derived from location scope. Ignored for platform-level callers.

CreateMetricAnnotationInput input

FieldTypeDescription
at DateTime! When the change reached this environment (UTC).
label String! Short label on the chart, at most 120 characters.
description String At most 1000 characters.
link String An http(s) URL, at most 500 characters.
metricKeys [MetricKey!]! At least one registry metric.

CreateNotificationInput input

FieldTypeDescription
userId String! —
message String! —
notificationType String! —
actionUrl String —
actionText String —

CreateOrganisationInput input

Fields for creating a new organisation.

FieldTypeDescription
name String! Display name for the organisation.
slug String! URL-friendly identifier. Must be unique.

CreatePlaceAliasInput input

An alias added by hand. Give the target as `locationId` or as `point`, not both.

FieldTypeDescription
name String! The spelling. At most 500 characters.
nameAr String The same place in Arabic script. It gets an alias of its own.
countryCode String! ISO-3166-1 alpha-2 (SD, VE, AF).
scopeLocationId String The state where the alias applies. Omit for the whole country (platform admins only).
locationId String An existing CLEAR location: a district, a state or a level-4 landmark.
point LocationChallengePointInput A new point. It becomes a level-4 landmark. Its name defaults to `name`.
note String —

CreatePublicEventLinkInput input

Input for the `createPublicEventLink` mutation.

FieldTypeDescription
eventId String! The event to share. Caller must be able to read it via the normal `event(id)` resolver — i.e. `requireContentReader` passes.
ttlDays Int Snapshot lifetime in days. Defaults to 30, capped at 90. Smaller values produce shorter URLs by reducing the impact of any future URL-history scraping.

CreateSignalInput input

FieldTypeDescription
id String Signal id minted by the gx pipeline: a lowercase UUIDv5 of the prefixed externalId. Requires externalId and a non-manual rawData; any other shape is refused with BAD_USER_INPUT. Omit it to get a server-minted id.
sourceId String! —
externalId String Stable upstream identifier for idempotent ingestion. If a signal with the same (sourceId, externalId) already exists, createSignal returns the existing row instead of creating a duplicate. Recommended prefix scheme: "gdacs:{eventid}", "acled:{event_id_cnty}".
contentHash String Fingerprint of rawData, for sources whose records get revised in place (e.g. IDMC). Optional — most sources never revise a signal after creation, so this stays null for them. Seeding it here means an immediate follow-up updateSignalContent call (same hash) is a correct no-op instead of falsely stamping lastRevisedAt on a brand-new signal.
rawData JSON! Write-only ingest payload stored internally. Not exposed on Signal queries.
rawS3Key String Pointer to the raw payload blob in the S3 data lake (bronze layer), written by the Dagster ingest asset. Optional — rawData carries the payload for sources not yet landing in the lake.
publishedAt String! —
collectedAt String —
pipelineVersion String The clear-pipeline git SHA, kept on the Signal's first location Outcome (ADR-0020). Optional.
runId String The Dagster run id, kept on the Signal's first location Outcome (ADR-0020). Optional.
url String —
title String —
description String —
severity Int Severity score (1–5). From data source or estimated by pipeline.
casualties Int Reported casualties for the signal.
startDate String Structured event attributes extracted by the shared event-classification LLM. Dates are ISO-8601; accuracy is one of DAY/WEEK/MONTH/YEAR.
startDateAccuracy DateAccuracy —
endDate String —
endDateAccuracy DateAccuracy —
magnitude Float Natural-hazard magnitude + its unit (e.g. 6.4 "Mw"). Null for non-disaster signals.
magnitudeUnit String —
actors [String!] Named conflict actors. Omitted/empty for non-conflict signals.
countryIds [String!] Admin-0 location ids the extracted event touches (countries relation).
media [String!] Media URLs (source URLs for images, videos, etc.).
originId String —
destinationId String —
locationId String —
lat Float Latitude for automatic geo-resolution (resolves to nearest location in hierarchy).
lng Float Longitude for automatic geo-resolution.
geoparsedData JSON Optional output of clear-pipeline's text-based geoparser. Additive enrichment, stored verbatim for downstream comparison against the source's coords. Schema documented on the signals model.
pointName String Human-readable name to use when the resolver has to create a new L4 point location from `lat`/`lng`. Typically the geoparser's top extracted candidate suffixed with " (unresolved)" when the Nominatim lookup failed, so audit views show `al-Obeid (unresolved)` instead of the signal's full paragraph. Ignored when `locationId` is supplied. When omitted, the resolver falls back to a coord-based label like `Point 15.6280, 30.2156`.

CreateTeamInput input

FieldTypeDescription
organisationId String! —
name String! —
slug String! —
description String —

CreateWebhookSubscriptionInput input

Input for creating a new webhook subscription. The secret is generated server-side (openssl rand -hex 32 equivalent) and returned once on create.

FieldTypeDescription
name String! —
targetUrl String! —
eventTypeFilter [String!] Empty array = fire on all events. Otherwise, only fire when the source payload's event type matches one of these values.
active Boolean Whether the subscription starts active. Defaults to true.

DateRangeInput input

Half-open date window (from inclusive, to exclusive) used to filter `searchKnowledgebase` by the chunk's extracted event window. Chunks whose time_range overlaps the window match.

FieldTypeDescription
from DateTime —
to DateTime —

DetectionMetricsInput input

The range and place to measure time to detection over. Every field is optional.

FieldTypeDescription
from DateTime Start of the range, inclusive. Defaults to the start (Monday 00:00 UTC) of the ISO week 11 weeks before `to`'s week, so the default range is 12 ISO weeks.
to DateTime End of the range, inclusive. Defaults to now.
locationId String Only Events whose origin, destination or general location is this location or inside it.
granularity MetricGranularity Bucket size of `series`. Defaults to `WEEK`.

EntityStatsInput input

FieldTypeDescription
entity EntityKind! —
groupBy StatsGroupBy —
teamId String —
locationId String —
locationIds [String!] Like `locationId`, for several locations: keeps rows under any of them or under `locationId`. An empty list is no filter.
eventTypes [String!] —
severityMin Int —
severityMax Int —
from DateTime —
to DateTime —
includeDummy Boolean —

EventAggregatesInput input

Absolute event aggregates from the pipeline's recompute. Absent fields are left unchanged; explicit nulls clear them.

FieldTypeDescription
severity Int —
casualties Int —
populationAffected String BigInt as a decimal string.
populationDisplaced String BigInt as a decimal string.
rank Float! —
title String —
description String —
rewriteMembersHash String —
endedAt String Structured event attributes, aggregated from the live members. Absolute: an explicit null / empty list clears a fact no live member supports.
startedAtAccuracy DateAccuracy —
endedAtAccuracy DateAccuracy —
magnitude Float —
magnitudeUnit String —
actors [String!] —
countryIds [String!] —

EventsPageInput input

FieldTypeDescription
limit Int —
offset Int —
orderBy EventOrderBy —
teamId String —
locationId String —
locationIds [String!] Like `locationId`, for several locations: keeps rows under any of them or under `locationId`. An empty list is no filter.
eventTypes [String!] —
severityMin Int —
severityMax Int —
from DateTime Filter on event.firstSignalCreatedAt — inclusive.
to DateTime —
includeDummy Boolean —

FindOrCreateLandmarkL4Input input

Input for findOrCreateLandmarkL4. Drives geoparser-based L4 promotion in the signal-ingestion pipeline.

FieldTypeDescription
name String! Display name to use when creating a new L4 (e.g., 'Nyala Airport'). Reuse for kind='landmark' is keyed on a case-insensitive match of this field within the candidate's containing A2.
lat Float! Candidate latitude (from the geocoder).
lng Float! Candidate longitude (from the geocoder).
kind String! 'landmark' or 'admin'. Drives the reuse strategy: landmarks reuse by exact name, admins reuse by proximity (≤100m) within the same A2.
sourceLat Float Source coordinate's latitude. When provided, the resolver verifies the candidate's A2 matches the source's A2 — a mismatch aborts the promotion.
sourceLng Float Source coordinate's longitude. See sourceLat.

GroundMessageClassificationInput input

One classification write-back from the pipeline worker.

FieldTypeDescription
messageId String! —
classification String! "field_report" | "news_digest" | "operational" | "chatter".
uncertaintyMarker String Pipeline-detected uncertainty tag. Null/omitted leaves the ingest-extracted marker untouched.

GroundMessageFailureInput input

One failure marker from a clear-pipeline ground drain.

FieldTypeDescription
messageId String! —
stage GroundPipelineStage! —
error String! Exception text from the last attempt. Stored truncated to 500 characters, with phone numbers redacted.

GroundMessageTranscriptInput input

One transcription write-back from the ground_transcribe worker.

FieldTypeDescription
messageId String! —
transcript String! Transcribed text of the message's voice note(s).

GroundPromotionOverridesInput input

Reviewer edits applied to the signal a thread is promoted into (reviewGroundThread approve_public only). Omitted, null or blank fields keep the default derived from the thread (thread title; the joined message text as description; no severity; no location). The signal's rawData provenance is never affected.

FieldTypeDescription
title String —
description String —
severity Int Integer 1-5.
locationId String An existing `locations` row id (any admin level).

GroundThreadDraftInput input

One enrichment draft from the Dagster hotline-enrichment job. Null fields leave the existing draft value on the thread unchanged.

FieldTypeDescription
threadId String! —
draftTitle String —
draftSeverity Int 1-5. Validated server-side when present.
draftLocationId String —
draftDisasterType String —

GroundThreadUpsertInput input

One thread (a cluster of staged Signals) produced by the pipeline threading task. Its messageIds are re-pointed at the thread, replacing their V1 one-per-message placeholder threads. With `threadId` set, the input APPENDS to that existing thread (cross-run threading: late corrections/retractions join the thread they belong to) instead of creating a new one.

FieldTypeDescription
groundSourceId String! —
title String! —
lifecycleState String! "reported" | "updated" | "confirmed" | "corrected" | "retracted".
messageIds [String!]! —
threadId String Optional target thread for cross-run appends. When set, messageIds are appended to this thread and its lifecycleState + title are updated — provided the thread is not yet promoted (reviewState != "approved_public" and no promotedSignalId) and belongs to groundSourceId. A promoted/terminal (or unknown/wrong-source) target is never mutated: a NEW thread is created instead, with a warning.

InviteUserInput input

FieldTypeDescription
email String! —
organisationId String! —
role String Organisation role: org_admin, member (default: member).
teams [TeamAssignmentInput!]! Team assignments — at least one team is required. Each entry grants the invitee membership in that team with the given role on acceptance.
frontendBaseUrl String Base URL of the frontend the invite should link into (e.g. `https://app.example.org`). The accept-invite link is built from it. Trusted as given for this authenticated call; defaults to the platform `FRONTEND_URL` when omitted. May include a path prefix.
senderEmail String Address replies to the invite email route to (becomes `Reply-To`). The `From` address stays the platform's verified sender.
senderName String Display name shown on the invite email's `From` header (e.g. the inviting organisation's name).

KnowledgebaseChunkInput input

One chunk written into the knowledgebase table. Mirrors the columns exactly (minus `lexicalTsv`, which the DB trigger fills from `embeddedText`, and `createdAt` which uses the column default).

FieldTypeDescription
chunkIndex Int! 0-indexed position within the report.
pageStart Int! Inclusive PDF page span this chunk covers.
pageEnd Int! —
chunkText String! Raw excerpt text — what a UI would render on a search hit.
contextPrefix String! LLM-generated context prefix (empty string when contextualization is skipped).
embeddedText String! `contextPrefix + "\n\n" + chunkText` — what was actually embedded and tokenised.
embeddingProvider String! Provenance for the embedding — mirrors the DB columns so a later re-embed backfill can filter by (provider, model).
embeddingModel String! —
embedding [Float!]! 1024-dim dense embedding. The API validates length and casts to `vector(1024)` before insert.
locationIds [String!]! Resolved `locations.id` refs (post-lookup).
locationPcodes [String!]! Raw pcodes the LLM emitted but the resolver couldn't match.
timeRangeStart DateTime Optional event window described by the chunk.
timeRangeEnd DateTime —
eventTypes [String!]! Multi-hazard tags — GLIDE codes or free-text categories.
needSectors [String!]! NRC SAF sectors: Shelter, WASH, Protection, Health, Food Security, Education.
figureS3Key String Infographic capture: set only when this chunk is a figure transcription merged into the KB. `figureS3Key` is the cropped image's S3 key (join key to `report_figures`); `figureKind` is that figure's kind. Both null for ordinary text chunks.
figureKind String —

KnowledgebaseFilters input

Optional filters applied BEFORE the retrieval step — array filters use overlap semantics (any-of), the time range uses inclusive intersection. Leave a field null to skip that filter.

FieldTypeDescription
locationIds [String!] Match rows tagged with ANY of these `locations.id` values.
countryLocationId String Scope to one country: keep only chunks tagged with a location in this A0's subtree (itself or any descendant admin unit). Chunk locations are resolved to leaf admin ids, so a bare `locationIds=[A0]` would miss them — this expands the A0 to its subtree server-side via the locations tree. The situation-analysis RAG uses this so a country's analysis never cites reports about another country.
eventTypes [String!] Match rows tagged with ANY of these event-type tags.
needSectors [String!] Match rows tagged with ANY of these SAF sectors.
timeRange DateRangeInput Match rows whose extracted event window overlaps this range.
currentEmbeddingModelOnly Boolean Restrict to rows written by the currently-configured embedding provider + model. Default true — mixing embedding spaces yields meaningless distances. Set false only when inspecting historical rows via BM25-only search (no vector step will be run for filtered-out rows).
figuresOnly Boolean Infographic search (Cap 2): keep only figure-transcription chunks (those with a `figureS3Key`). Combine with a topical `query` to find the charts/maps/tables most relevant to a question, then read `figureImageUrl` on each hit for the cropped image. Only affects the `report` tier — the `incident` tier has no figures. Default false.
teamId ID Team-scoped reads (Cap 1): return only documents uploaded on behalf of this team (`team_id` match). Set only on team uploads, so this EXCLUDES the shared ReliefWeb corpus — use it to show a team just its own uploads. Report tier only. Omit to search everything the reader may see.
boostTeamUploadsId ID Ranking HINT, not an exclusion: give this team's own uploaded documents (`team_id` match) more weight by promoting them a few ranks in the TOPICAL fusion — the shared corpus is still searched and returned. Set by the analysis generator to the team whose analysis is being generated so its uploads carry extra weight; ordinary search omits it. Report tier only.

LocaleTranslationInput input

Per-locale payload accepted by upsertTranslations. data mirrors the canonical entity's JSON shape exactly for the given locale — e.g. for a crisis it carries the localized title/summary/scenarios/needs with the same keys/nesting the English columns use.

FieldTypeDescription
locale String! BCP-47 lowercased — 'ar', 'fr'. 'en' is rejected (canonical) except for groundMessage, whose source is the reporter's language.
data JSON! Translated payload. Shape mirrors the canonical entity per type.
sourceHashes JSON! Per-field SHA-256 hashes of the canonical English source used to produce `data`. Stored so the pipeline can detect which canonical field changed and re-translate only that field on the next pass.

LocationChallengePointInput input

The point an admin places when the proposed one is wrong too.

FieldTypeDescription
lat Float! Latitude, -90 to 90.
lng Float! Longitude, -180 to 180.
name String Display name of the place, at most 500 characters. Without one the point shows its admin area's name.

LocationPrecisionMetricsInput input

The range, place and sources to measure location precision over. Every field is optional.

FieldTypeDescription
from DateTime Start of the range, inclusive. Defaults to the start (Monday 00:00 UTC) of the ISO week 11 weeks before `to`'s week, so the default range is 12 ISO weeks.
to DateTime End of the range, inclusive. Defaults to now.
locationId String Only Signals whose location is this location or inside it. A Signal with no location cannot be placed, so it is left out when this is set.
sourceNames [String!] Only these sources, by `DataSource.name` (e.g. `sudan-war-x`). Defaults to every source.
granularity MetricGranularity Bucket size of `series`. Defaults to `WEEK`.

LocationReplayRunsInput input

Which Replay runs to list: the range and filters of the series they are drawn on.

FieldTypeDescription
from DateTime Start of the range, inclusive. Defaults as `metricSeries` does.
to DateTime End of the range, inclusive. Defaults to now.
locationId String Only Signals whose Live Outcome is in this location or inside it.
sourceNames [String!] Only these sources, by `DataSource.name`.

MetricAnnotationsInput input

The range and metric to list annotations for. Every field is optional.

FieldTypeDescription
from DateTime Only annotations at or after this instant.
to DateTime Only annotations at or before this instant.
metric MetricKey Only annotations tagged with this metric.

MetricSeriesInput input

The metric, range, bucket size and grouping to read a series for. Only `metric` is required.

FieldTypeDescription
metric MetricKey! —
granularity MetricGranularity Bucket size (ADR-0014). Defaults to `WEEK`.
from DateTime Start of the range, inclusive. Defaults to the start of the ISO week 11 weeks before `to`'s week.
to DateTime End of the range, inclusive. Defaults to now.
locationId String Only rows in this location or inside it, as the owning query reads it. Ignored by a metric whose definition has `locationScoped: false`.
sourceNames [String!] Only these sources, by `DataSource.name`; only for metrics that can be grouped by source.
groupBy MetricGroupBy Split the series into groups. Refused with BAD_USER_INPUT for a metric that cannot be grouped.
replayRunId String Read the replay series of one Replay run instead of the history series (ADR-0020): only the Signals in range that the run re-processed, each at the result the run gave it, in the bucket the history series has it in. The two series then compare the same Signals bucket by bucket. Take the id from `locationReplayRuns`. Only `DISTRICT_OR_FINER` has a replay series; another metric refuses it with BAD_USER_INPUT. A run with no Signal in range gives an all-zero series.
onsetBasis MetricOnsetBasis The onset a delay metric measures from (ADR-0021). `AS_DELIVERED`, the default, is the history series. `CURRENT` is the "same ruler" view, only for `DETECTED_BY_NEXT_DAY`, `DETECTED_SAME_DAY`, `ALERTED_BY_NEXT_DAY` and `ALERTED_SAME_DAY`; another metric refuses it with BAD_USER_INPUT. The bucket shape is the same for both.

NodeAnalysisInput input

One node's result in an `upsertNodeAnalyses` call.

FieldTypeDescription
nodeKey String! Stable taxonomy slug path (`task/l1[/l2[/l3]]`).
nodeName String! —
task String! —
level Int! Taxonomy depth: 1 / 2 / 3.
data JSON! —
status String! —
sourceReportIds [String!] —
generatedByModel String! —
generationCostUsd Float —
generationInputTokens Int —
generationOutputTokens Int —

RecordUnresolvedPlaceNameInput input

One geocode miss, sent by the pipeline.

FieldTypeDescription
signalId String! The Signal that named the place.
name String! The place name as the pipeline read it. At most 500 characters.
nameAr String The Arabic spelling from the Signal's text, when one was found.
countryCode String! ISO-3166-1 alpha-2 (SD, VE, AF).
areaLocationId String! The area the pipeline chose for the Signal. The server derives the row's state from it.
reason UnresolvedPlaceNameReason Why geocoding did not place the name. Default NO_MATCH.
seenAt DateTime When the miss happened. Default now. A backfill passes the real date.

ReplyToCommentInput input

FieldTypeDescription
repliedToCommentId String! ID of the comment to reply to.
comment String! —
tagUserIds [String!] User IDs to tag in the reply.

ReportFigureInput input

FieldTypeDescription
pageNumber Int! —
bbox [Float!] —
isFullPage Boolean —
s3Key String! —
kind String! —
title String —
description String —
transcription JSON —
sourceId String —
locationIds [String!] —
locationPcodes [String!] —
eventTypes [String!] —
needSectors [String!] —
timeRangeStart DateTime —
timeRangeEnd DateTime —

RequestAnalysisInput input

FieldTypeDescription
locationIds [String!] —
eventTypes [String!] —
needSectors [String!] —
windowStart DateTime! —
windowEnd DateTime —
teamId String Owning team, for a team-scoped on-demand request.
taxonomyNodeKeys [String!] On-demand node deep-dive (analysis-node-deepdive): the specific taxonomy node keys (L2/L3 leaves) to drill into. Omitted / empty = the default L1 situation analysis. Part of the PENDING dedupe identity, so a different node selection for the same frame is a distinct request.
force Boolean Deprecated / ignored: a manual trigger always regenerates now, bypassing both the 24h floor and the freshness gate (ADR-0008), for any authorized requester. Retained for backward compatibility; its value has no effect.

SaveAgentWorkingMemoryInput input

Replace your Agent working memory. Omitted fields stay unchanged.

FieldTypeDescription
workingMemory String The working-memory document (Markdown, at most 100,000 characters).
metadata JSON —

SignalRevisionInput input

FieldTypeDescription
id String! —
revision Int! The revision the caller read; the write applies only if it still matches.

SignalsPageInput input

FieldTypeDescription
limit Int —
offset Int —
orderBy SignalOrderBy —
teamId String —
locationId String —
locationIds [String!] Like `locationId`, for several locations: keeps rows under any of them or under `locationId`. An empty list is no filter.
sourceNames [String!] Restrict to signals whose source name is in this list (e.g. ["acled","gdacs"]).
severityMin Int —
severityMax Int —
from DateTime Filter on signal.publishedAt — inclusive.
to DateTime —
includeDummy Boolean —

SubmitSignalLocationChallengeInput input

FieldTypeDescription
signalId String! —
teamId String! The team it is filed for. The caller must be an analyst on it (or a platform admin), and the Signal must be within the team's area.
note String —
proposedLng Float Omit both to file a bare challenge. Provide both (finite, in range) for a corrected point, which must fall inside the areas CLEAR covers and, unless a platform admin files it, within the team's area. One without the other is rejected.
proposedLat Float —
proposedName String —

SubscribeToAlertsBatchInput input

FieldTypeDescription
locationIds [String!]! One or more location IDs.
alertTypes [String!]! One or more disaster/event types (glideNumbers). A subscription is created for every (location × alertType) pair.
channel Channel! —
frequency Frequency! —
minSeverity Int Minimum event severity (1-5). Applied to all created subscriptions.

SubscribeToAlertsInput input

FieldTypeDescription
locationId String! —
alertType String! Disaster/event type (glideNumber from disaster_types, e.g. 'fl', 'eq').
channel Channel! —
frequency Frequency! —
minSeverity Int Minimum event severity (1-5) to notify on. Defaults to 1 (all alerts).

TaskUsageInput input

Spend a Worker reports when completing a Task. Cost is computed by the caller from its own price table.

FieldTypeDescription
model String! —
inputTokens Int! —
outputTokens Int! —
costUsd Float! —

TeamAssignmentInput input

One (team, role) assignment passed to inviteUser.

FieldTypeDescription
teamId String! —
teamRole TeamMemberRole! —

UnresolvedPlaceNameResolutionInput input

One answer: `kind`, and the one field that kind needs.

FieldTypeDescription
kind UnresolvedPlaceNameResolutionKind! —
locationId String With LOCATION: a district, a state or a level-4 landmark in the row's country.
geonamesId Int With GEONAMES: the suggestion's GeoNames id.
point LocationChallengePointInput With POINT: the place. Its name defaults to the row's spelling.

UpdateAlertInput input

FieldTypeDescription
status AlertStatus —

UpdateAlertSubscriptionInput input

FieldTypeDescription
channel Channel —
frequency Frequency —
active Boolean —
minSeverity Int Minimum event severity (1-5).

UpdateAlertWebhookInput input

Input for updating a clear_alert webhook. All fields optional — provide only what you want to change.

FieldTypeDescription
name String —
targetUrl String —
alertTypeFilter [String!] —
minSeverity Int —
active Boolean —

UpdateAnalysisAutomationInput input

FieldTypeDescription
cadence String —
enabled Boolean —
title String Display name. Blank clears it back to the area list. Omit to leave it.

UpdateBriefInput input

Fields to change on a draft Brief; omitted fields are kept.

FieldTypeDescription
title String Must not be blank.
summary String Markdown-lite.
closingNotes String Markdown-lite.

UpdateCrisisPopulationInput input

FieldTypeDescription
populationAffected String Population directly affected by the events (BigInt as string).
populationInArea String Total population residing within the event admin areas (BigInt as string).
title String AI-generated crisis title.
summary String AI-generated crisis summary.
scenarios JSON LLM-generated forward scenarios. Shape: { most_likely, best_case, worst_case, description }.

UpdateDataSourceInput input

FieldTypeDescription
name String —
type String —
isActive Boolean —
baseUrl String —
infoUrl String —
synonyms [String!] Alias set for source-name normalisation (see resolveDataSource).
reliability Int NATO Admiralty-style reliability grade 1–4; null = ungraded.

UpdateEventInput input

FieldTypeDescription
signalIds [String!] —
title String —
description String —
descriptionSignals JSON —
validFrom String —
validTo String ISO-8601 event end. Pass `null` to clear it ("ongoing / no known end"); omit it to leave the stored value unchanged.
firstSignalCreatedAt String ISO-8601. Only ever moves earlier: a value later than the stored one is ignored.
lastSignalCreatedAt String ISO-8601. Only ever moves later: a value earlier than the stored one is ignored, so an out-of-order signal can't pull it back.
startedAt String When the real-world event started (onset), parsed from signal text. ISO-8601. The pipeline keeps the EARLIEST onset across an event's signals.
endedAt String ISO-8601 event end. Pass `null` to clear ("ongoing"); omit to leave unchanged. The pipeline keeps the LATEST end across an event's signals.
startedAtAccuracy DateAccuracy Precision of startedAt / endedAt (DAY/WEEK/MONTH/YEAR).
endedAtAccuracy DateAccuracy —
magnitude Float Natural-hazard magnitude + its unit, aggregated from member signals.
magnitudeUnit String —
actors [String!] Named conflict actors aggregated from member signals. Replaces the set when provided; omit to leave unchanged.
countryIds [String!] Admin-0 location ids the event touches (countries relation). Replaces the set when provided; omit to leave unchanged.
originId String —
destinationId String —
locationId String —
types [String!] —
severity Int —
populationAffected String —
populationDisplaced String Estimated population displaced (BigInt as string).
casualties Int Aggregated casualties for the event (sum across constituent signals).
rank Float —
runKind LocationRunKind The run that makes this write, for the grouping log and the Event facts log (ADR-0021). `runKind` defaults to LIVE; a replay job sends REPLAY. `pipelineVersion` is the clear-pipeline git SHA and `runId` the Dagster run id. clear-api writes to the logs only for a call with an API key: a person's Link or edit writes no row.
pipelineVersion String —
runId String —

UpdateGroundSourceInput input

Partial update of a source's policy record. Null/omitted fields are left unchanged, except teamId, where null unassigns the team; transportId is immutable (it is the identity that externalIds are minted against). The merged row is re-validated: group kinds must end up with a complete consent record.

FieldTypeDescription
name String —
kind String "staff_group" | "partner_group" | "hotline".
consentScope String —
consentRecordedAt String —
consentRecordedBy String —
privacyDefault String —
reviewerRoles [String!] —
retentionRule String —
teamId String Assign the source to a team, whose emergency response managers then see and triage its threads. Null unassigns it (platform admins only).

UpdateLocationInput input

FieldTypeDescription
geoId Int —
osmId String —
pCode String —
name String —
level Int —
parentId String —

UpdateOrganisationInput input

Fields for updating an existing organisation.

FieldTypeDescription
name String New display name.
slug String New URL-friendly identifier.
isActive Boolean Set active/inactive status.

UpdatePlaceAliasInput input

What to change. A field left out stays as it is.

FieldTypeDescription
locationId String A new target: an existing CLEAR location.
point LocationChallengePointInput A new target: a point, which becomes a level-4 landmark.
scopeLocationId String A new scope: a state, or null for the whole country (platform admins only). Leave the field out to keep the scope.
note String A new note. Null or empty removes it.

UpdateProfileInput input

FieldTypeDescription
name String —
phoneNumber String —
image String —
enableInAppNotification Boolean —
enableEmailNotification Boolean —
enableSMSNotification Boolean —
language String Preferred UI language code (BCP-47 / ISO 639-1, e.g. "en", "ar").
analyticsOptOut Boolean Opt out of (true) or back into (false) usage analytics, account-wide.

UpdateSignalContentInput input

FieldTypeDescription
id String The signal's id. Alternatively use sourceId + externalId.
sourceId String With externalId: the signal's natural key, unique per source.
externalId String —
contentHash String! Fingerprint of the incoming raw payload. Compared against the signal's stored contentHash; content fields are written only when they differ.
retracted Boolean Superseded upstream. Null or absent leaves the stored flag unchanged.
rawS3Key String Pointer to the raw payload blob in the S3 data lake. Null or absent leaves it unchanged; a change alone is metadata-only (no revision bump).
rawData JSON! —
url String —
title String —
description String —
severity Int —
casualties Int —
startDate String Structured event attributes extracted by the shared event-classification LLM. Absent fields leave the stored value unchanged; dates are ISO-8601.
startDateAccuracy DateAccuracy —
endDate String —
endDateAccuracy DateAccuracy —
magnitude Float —
magnitudeUnit String —
actors [String!] —
countryIds [String!] Admin-0 location ids the extracted event touches (countries relation). When provided, replaces the signal's country set.
originId String —
destinationId String —
locationId String —
lat Float Fallback geo-resolution, same as CreateSignalInput's lat/lng — used when no explicit originId/destinationId/locationId resolved.
lng Float —
geoparsedData JSON —
pointName String —

UpdateTeamInput input

FieldTypeDescription
name String —
slug String —
description String —

UpdateWebhookSubscriptionInput input

Input for updating an existing subscription. All fields are optional — provide only what you want to change.

FieldTypeDescription
name String —
targetUrl String —
eventTypeFilter [String!] —
active Boolean —

UpsertAnalysisDatapointsInput input

Input for `upsertAnalysisDatapoints`. Upsert is keyed on `analysisId` (one row per generation), so re-running an extraction replaces in place.

FieldTypeDescription
analysisId String! —
data JSON! —
contributingReportIds [String!]! —
origin String —
newestSourceAt DateTime —
oldestSourceAt DateTime —
dataQualityScore Float —
reportCount Int —
schemaVersion String! —

UpsertAnalysisInput input

FieldTypeDescription
locationIds [String!] The frame this analysis covers.
eventTypes [String!] —
needSectors [String!] —
windowStart DateTime! —
windowEnd DateTime —
data JSON! —
sourceReportIds [String!]! —
generatedByModel String! —
generationCostUsd Float —
generationInputTokens Int Provider-reported token usage of the generation, summed across component calls. Optional — omitted for deterministic-only runs.
generationOutputTokens Int —
schemaVersion String! —
force Boolean Bypass the 24h regeneration floor (ADR-0008). The pipeline sets this for an admin-forced request. Omitted/false: a write within 24h of the current row's `generatedAt` is a no-op that only bumps `lastSyncedAt`.

UpsertConversationInput input

Create a Conversation with a caller-supplied id, or update its title or metadata.

FieldTypeDescription
id String! The Agent's thread id. Rejected if it belongs to another user's Conversation.
title String Omit to leave the title unchanged. At most 500 characters.
metadata JSON Omit to leave the metadata unchanged. At most 100,000 characters as JSON.
createdAt DateTime Creation time from the Agent. Ignored on update. Defaults to now.

UpsertLocationMetadataInput input

FieldTypeDescription
locationId String! —
type String! Type string (e.g. "iom_dtm_displacement").
data JSON! JSON payload for this type.

UpsertNodeAnalysesInput input

FieldTypeDescription
frame AnalysisFrameInput! The frame these node results cover (same identity rules as `Analysis`).
schemaVersion String! —
nodes [NodeAnalysisInput!]! One entry per taxonomy node generated (the deep-dive's leaf frontier).

UpsertNominatimCacheInput input

FieldTypeDescription
queryHash String! SHA-256 hex digest of `<endpoint>:<normalised_query>`. The caller is responsible for computing this — the server doesn't re-hash.
query String! Raw query string for debugging / audit.
endpoint String! The Nominatim endpoint that produced this response.
responseJson JSON! Raw JSON response to cache. Stored verbatim.
status String! 'ok' for a usable result, 'no_result' for an empty result set, 'error' when the geocoder returned an error response. Negative results are cached so we don't re-ask the same dead question.
ttlSeconds Int! How long this entry should remain valid, in seconds. The server computes `expires_at = NOW() + ttl_seconds`.

UpsertReportDatapointsInput input

Input for `upsertReportDatapoints`. Field names / types mirror the ReportDatapoint output so a client can echo one back into the other with minimal transformation.

FieldTypeDescription
reportId String! —
reportTitle String! —
sourceUrl String! —
publishedAt DateTime! —
reportingPeriodStart DateTime —
reportingPeriodEnd DateTime —
locationIds [String!]! —
locationPcodes [String!]! —
eventTypes [String!]! —
totalAffected Int —
totalDisplaced Int —
totalKilled Int —
data JSON! —
schemaVersion String! —
extractedByModel String! —
sourceId String The report's publisher source (a `data_sources` id), resolved by the pipeline via `resolveDataSource`. Null until source attribution backfills; a figure's own cited source lives per-figure inside `data`. See clear-pipeline ADR-0004.

UpsertReportFiguresInput input

Replace-on-reingest payload for one report's figures (pipeline-only).

FieldTypeDescription
reportId String! —
reportTitle String! —
sourceUrl String! —
extractedByModel String! —
figures [ReportFigureInput!]! —

UpsertSituationAnalysisInput input

FieldTypeDescription
countryLocationId String! —
windowStart DateTime! —
windowEnd DateTime! —
windowKind String! Window granularity — `yearly` today. Required: it is part of the bucket key, so a wrong or missing value writes a row no reader will ask for. Not defaulted, deliberately.
data JSON! —
sourceReportIds [String!]! —
aggregatedDatapointId String —
generatedByModel String! —
generationCostUsd Float —
schemaVersion String! —

UpsertTranslationsInput input

FieldTypeDescription
entityType String! One of 'event' | 'crisis' | 'location' | 'situationAnalysis' | 'analysis' | 'groundMessage' (case-insensitive).
entityId String! —
translations [LocaleTranslationInput!]! One entry per target locale. Each row is upserted independently.

ActionCount object

How many times one action was recorded.

FieldTypeDescription
action String! Namespaced action, e.g. 'auth.login', 'analysis.report_exported'.
count Int! —

ActivityCountsByAction object

Activity counts for one bucket (the whole window, a user, or a day). Generic over action names, so a newly logged action appears here without a schema change.

FieldTypeDescription
total Int! Every recorded action in the bucket, whatever its name.
actions [ActionCount!]! One entry per action seen in the bucket, highest count first (ties by action name). Actions with zero rows are omitted.

ActivityLog object

A single user-initiated action recorded for analytics.

FieldTypeDescription
id String! —
user User! —
action String! Namespaced action verb — e.g. 'auth.login', 'signal.create_manual', 'event.create', 'alert.create', 'crisis.create', 'feedback.create'.
resourceType String Coarse resource bucket — 'signal' / 'event' / 'alert' / 'crisis' / 'feedback' / 'session'.
resourceId String The created/affected row's id. Null for actions like login.
metadata JSON Per-action context (title, severity, etc.). Shape varies by action.
ipAddress String —
userAgent String —
createdAt DateTime! —

ActivityStats object

Aggregate counts and time-series for the admin dashboard.

FieldTypeDescription
from DateTime! Window the stats cover, in ISO-8601. Mirrored back to the client so a paginated dashboard can know what range its numbers are based on.
to DateTime! —
totals ActivityCountsByAction! Total event counts across the window, keyed by action.
byUser [UserActivitySummary!]! Per-user breakdown, ordered by total activity (desc), limited to the top 50 most-active users in the window.
byDay [DailyActivityCount!]! Daily activity counts across the window (UTC dates).

AgentBudget object

Your daily CLEAR Agent budget. Spend is the sum of your turns' cost since UTC midnight; the budget resets at the next UTC midnight.

FieldTypeDescription
limitUsd Float! The daily limit in USD.
spentTodayUsd Float! What your turns have cost since UTC midnight, in USD.
resetsAt DateTime! When spend resets to zero: the next UTC midnight.

AgentDailyUsage object

FieldTypeDescription
date String! YYYY-MM-DD in UTC.
turns Int! —
distinctUsers Int! —
costUsd Float! —

AgentMetrics object

CLEAR Agent usage over a range: what it cost, how fast it answered, how much it was used and what for. The unit is a **turn**: one Answer with the usage clear-mvp recorded for it. A turn is in range when its usage was recorded in the range (server time, as the daily budget counts). Counts, sums and averages only; clear-mvp formats them. See ADR-0013.

FieldTypeDescription
from DateTime! Start of the range measured.
to DateTime! End of the range measured.
turns Int! Turns in range: Answers with recorded usage.
turnsUnrecorded Int! Answers written in range (by `createdAt`) whose usage was never recorded: failed turns, or a lost record. Not in any other number here.
conversations Int! Conversations with at least one turn in range.
newConversations Int! Of those, Conversations created in range.
users Int! Users with at least one turn in range.
totalCostUsd Float! Sum of the turns' cost, USD.
costPerTurnUsd Float Mean cost of a turn, USD. Null with no turns.
costPerTurnP95Usd Float 95th percentile (nearest rank) cost of a turn, USD. Null with no turns.
costPerConversationUsd Float Total cost over the Conversations with a turn in range, USD. Null with no turns.
latencyMedianMs Float Median turn latency, milliseconds, over turns that recorded one. Null with none.
latencyP95Ms Float 95th percentile (nearest rank) turn latency, milliseconds. Null with none.
totalInputTokens Int! Sum of input tokens over the turns. Every step of a turn's tool loop counts, so one turn can report far more than one request.
totalOutputTokens Int! Sum of output tokens over the turns.
inputTokensPerTurn Float Mean input tokens per turn. Null with no turns.
outputTokensPerTurn Float Mean output tokens per turn. Null with no turns.
toolCallsPerTurn Float Mean tool calls per turn, from the Answers' stored parts. Null with no turns.
turnsWithoutTools Int! Turns that called no tool.
turnsWithManyToolCalls Int! Turns with more than 5 tool calls: the tool-thrash signal.
budgetLimitUsd Float! The daily per-user Agent budget in force, USD.
budgetHits Int! User-days (one user, one UTC day) whose recorded spend reached the budget.
byModel [AgentModelUsage!]! Turns by the model that answered, most turns first. `unknown` when none was recorded.
byTool [AgentToolUsage!]! Tool calls by tool, most calls first.
byPage [AgentPageUsage!]! Turns by the page they were asked from (the first segment of the preceding user turn's route, ids left out), most turns first. `unknown` when no view was sent.
weekly [AgentWeek!]! Turns per ISO week of their usage record, ascending, one row per week the range touches (zero-filled).
recentQuestions [AgentQuestion!]! The newest questions asked in range (user turns by `createdAt`), newest first, each cut to 160 characters, without the user. Reading them is logged as `conversation.admin_read`, so select this field only when the questions will be shown.
first: Int — How many to return (1–50, default 20).

AgentModelUsage object

Turns one model answered in range.

FieldTypeDescription
model String! The model, as clear-mvp recorded it (e.g. `anthropic/claude-sonnet-5-5`).
turns Int! —
costUsd Float! —
inputTokens Int! —
outputTokens Int! —

AgentPageUsage object

Turns asked from one page.

FieldTypeDescription
page String! The first segment of the route, e.g. `/map`, `/dashboard`, `/event`; `unknown` when no view was sent.
turns Int! —

AgentQuestion object

One question a user asked the Agent, without the user.

FieldTypeDescription
askedAt DateTime! —
question String! The question's text, cut to 160 characters.
page String! The page it was asked from, as in `byPage`.

AgentRouteUsage object

FieldTypeDescription
route String! —
turns Int! —
distinctUsers Int! —

AgentToolUsage object

Calls to one tool in range.

FieldTypeDescription
tool String! The tool's name, e.g. `clear_list_events`, `navigate`, `nrc_find`.
calls Int! Calls, over all turns.
turns Int! Turns that called it at least once.

AgentUsageStats object

CLEAR Agent usage over a window, from usage metadata only.

FieldTypeDescription
from DateTime! —
to DateTime! —
turns Int! User turns (questions sent to the Agent).
answers Int! Agent Answers.
distinctUsers Int! People who sent at least one turn.
costUsd Float! Summed Answer cost, in USD.
inputTokens Int! —
outputTokens Int! —
byRoute [AgentRouteUsage!]! Turns by the page they were sent from, id segments collapsed to ':id'. Most turns first.
byDay [AgentDailyUsage!]! Per UTC day, ascending.

AgentWeek object

Agent usage in one ISO week.

FieldTypeDescription
isoWeek String! The ISO week, e.g. `2026-W42`.
weekStart DateTime! Monday 00:00 UTC of the week.
isPartial Boolean! True when the range covers only part of the week, e.g. the current week.
turns Int! —
conversations Int! —
users Int! —
costUsd Float! —
costPerTurnUsd Float Mean cost of a turn this week, USD. Null with no turns.
latencyMedianMs Float Median turn latency this week, milliseconds. Null with no turns.
inputTokensPerTurn Float Mean input tokens per turn this week. Null with no turns.
toolCallsPerTurn Float Mean tool calls per turn this week. Null with no turns.
models [String!]! The models that answered this week, sorted. A change from one week to the next marks a model change on a chart.

AgentWorkingMemory object

What the CLEAR Agent keeps about you across Threads (its working memory). Yours only: no one else, admins included, can read or write it.

FieldTypeDescription
userId String! —
workingMemory String The working-memory document (Markdown).
metadata JSON Opaque metadata kept by the Agent.
createdAt DateTime! —
updatedAt DateTime! —

AggregatedDatapoint object

One aggregated bucket - the roll-up of every contributing `report_datapoint` for a scope (window × window_kind × location). Consumed by the situation-analysis dashboard tiles and by chatbot factual queries. See `AggregatedField` docstring for the JSON `data` shape.

FieldTypeDescription
id String! —
windowStart DateTime! —
windowEnd DateTime! —
windowKind String! One of `weekly` | `monthly` | `yearly` | `all`.
locationId String Null when the bucket rolls up to a country (yearly, all-time tiers). Otherwise references `locations.id`.
data JSON! Flat map keyed by field label. Each value is either a QualityEnvelope (for numeric fields), a SetUnionEnvelope (for label fields - `{ values, contributing_report_ids }`), or `null` when no report in scope reported that field. A numeric QualityEnvelope carries `{ value, unit, confidence_mix, newest_report_at, oldest_report_at, contributing_report_ids }` plus the credibility fields (clear-pipeline ADR-0004/0005): the cached time-invariant `reliability` (1–4) and `intrinsic_credibility` (0–8.5), and - added on every read - `recency` (0–1.5), `information_credibility` (0–10), and `data_quality` (**0–10**), the per-field headline. The legacy `quality_score` (0–1, directness-only) is retained for backwards compatibility.
contributingReportIds [String!]! —
newestSourceAt DateTime! —
oldestSourceAt DateTime! —
dataQualityScore Float! Bucket headline data quality on a **0–10** scale (clear-pipeline ADR-0005): the mean of the fields' read-time `data_quality` (`(reliability × 2.5 × information_credibility) / 10`, Recency folded in at read). The stored column carries the same 0–10 scale. NOTE: this is a scale change from the pre-data-quality `quality_score` (0–1) - thresholds tuned on the old scale must be re-tuned.
reportCount Int! —
estimatedCurrentTotals CurrentTotals Estimated current totals - latest authoritative stock + the flows reported after it (ADR-0006 §4). This is an **as-of-now** figure, NOT the bucket's period: it is returned only for a bucket whose window still includes now (the current year/month/week and the `all` tier) and is `null` on any historical bucket, so a past-period row never carries a present-day number. Resolved lazily - the bounded `report_datapoints` scan runs only when this field is selected - but it is a real scan, not free.
validFrom DateTime! Bitemporal validity - this snapshot's lifetime as a "current" row. `validTo` is null when the row is still the current one for its bucket; else it carries the timestamp when a newer computation superseded it.
validTo DateTime —
schemaVersion String! —
computedAt DateTime! —
onDemand Boolean! True when the resolver assembled this bucket on-demand from `report_datapoints` rather than serving it from the pre-compute cache. The dashboard can render a "just computed" indicator so users know the number reflects the freshest possible view.

Alert object

An alert created from an event, distributed to subscribed users.

FieldTypeDescription
id String! —
event Event! The event this alert was created from.
representativePoint Location Location of the alert's event's FIRST signal — the same point as `event.representativePoint`, surfaced directly on the alert so a marker can be placed without walking into the event. Null when the first signal has no located point. Requires any authenticated content reader.
status AlertStatus! —
createdAt DateTime! When the alert row was first created.
updatedAt DateTime! Last time the alert row was updated (e.g. status transition).
userAlerts [UserAlert!]! Users who received this alert.

AlertsPage object

FieldTypeDescription
items [Alert!]! —
totalCount Int! —
hasMore Boolean! —

AlertSubscription object

A user's subscription to alerts of a specific type at a specific location.

FieldTypeDescription
id String! —
userId String! —
user User! —
location Location! —
alertType String! Disaster/event type to subscribe to (e.g. 'fl' for flood, 'eq' for earthquake).
active Boolean! —
minSeverity Int! Minimum event severity (1-5) to notify on. Alerts with event.severity < minSeverity are suppressed for this user.
channel Channel! —
frequency Frequency! —
createdAt DateTime! —
updatedAt DateTime! —

Analysis object

A single frame-scoped analysis snapshot. Cache read path — always the current row for its frame unless `asOf` is supplied for a historical read.

FieldTypeDescription
id String! —
locationIds [String!]! ── Frame ── The dimensions this analysis was generated over, the same ones the knowledgebase is filtered by. Arrays are canonicalised (sorted + de-duplicated) on write so frame identity is stable.
eventTypes [String!]! —
needSectors [String!]! —
windowStart DateTime! —
windowEnd DateTime Window end. `null` means rolling "to present" (an automated analysis); a value means a fixed range (on-demand). The concrete "as of" instant of a rolling row is `generatedAt` / `validFrom`.
data JSON! Full analysis blob (situation taxonomy + `scenarios`). Opaque and versioned by `schemaVersion`; LLM components carry their own `source_report_ids` for per-component provenance.
sourceReportIds [String!]! Denormalised union of every contributing report id across components. Per-field datapoint provenance lives inside `data` — a frame can span many aggregated-datapoints rows, so there is no single bucket reference.
generatedByModel String! —
generationCostUsd Float —
generationInputTokens Int Token usage of the LLM generation, summed across component calls (provider-reported). Null for deterministic-only runs. USD cost is derived from these where current prices are known — none is frozen on the row.
generationOutputTokens Int —
generatedAt DateTime! —
lastSyncedAt DateTime Last time any trigger checked this frame (manual sync or automation), whether or not it regenerated (ADR-0008). On a gate skip (within the 24h floor, or no new evidence) this advances while `generatedAt` does not.
validFrom DateTime! Bitemporal validity — `validTo` is null while this is the current row for its frame, else the timestamp a regeneration superseded it.
validTo DateTime —
schemaVersion String! Bumped when the payload taxonomy or prompt set changes. Versions coexist per frame; trend reads never mix them.

AnalysisAutomation object

A subscription that keeps one frame's analysis current on a cadence (ADR-0007 §5). The analysis row is shared; the scheduler regenerates each frame at the minimum cadence across its subscribers. Automations are always rolling ("to present"), so they carry no `windowEnd`.

FieldTypeDescription
id String! —
locationIds [String!]! —
eventTypes [String!]! —
needSectors [String!]! —
windowStart DateTime! —
title String Display name chosen by the team. Null means the area list is the name.
cadence String! —
teamId String —
createdByUserId String —
enabled Boolean! —
lastRunAt DateTime —
nextRunAt DateTime —
createdAt DateTime! —
updatedAt DateTime! —
comments [UserComment!]! Shared discussion. Every reader of this analysis sees every comment.
documents [AnalysisAutomationDocument!]! PDFs attached as evidence for this analysis.

AnalysisAutomationDocument object

FieldTypeDescription
id String! —
fileName String! —
reportId String! —
s3Key String! —
createdAt DateTime! —
url String Short-lived link for preview. Null when the file cannot be signed.

AnalysisDatapoint object

The extracted + aggregated final figures for one analysis generation.

FieldTypeDescription
id String! —
analysisId String! —
data JSON! Figures — same QualityEnvelope leaf structure as `AggregatedDatapoint.data`.
contributingReportIds [String!]! Report ids that fed these figures (web gap-fill evidence is cited per-figure in `data`).
origin String Coarse provenance: `kb` | `aggregated` | `web` (dominant origin for mixed rows).
newestSourceAt DateTime —
oldestSourceAt DateTime —
dataQualityScore Float —
reportCount Int —
schemaVersion String! —
computedAt DateTime! —

AnalysisRequest object

An on-demand analysis generation request (ADR-0007 §4). A user enqueues a frame that may not exist yet; a pipeline sensor drains `pendingAnalyses`, generates + upserts the analysis, and marks the request `GENERATED`. Scheduled refreshes use `AnalysisAutomation` instead of this one-shot queue.

FieldTypeDescription
id String! —
locationIds [String!]! —
eventTypes [String!]! —
needSectors [String!]! —
windowStart DateTime! —
windowEnd DateTime —
status AnalysisRequestStatus! —
requestedByUserId String —
teamId String —
taxonomyNodeKeys [String!]! On-demand node deep-dive selection (analysis-node-deepdive): the taxonomy node keys to generate (the leaf frontier). Empty = the default L1 situation fan-out.
force Boolean! Admin force (ADR-0008): the drain bypasses the 24h floor + freshness check for this request.
attempts Int! —
lastError String —
createdAt DateTime! —
updatedAt DateTime! —

ApiKey object

A personal API key for programmatic access. The full key is only shown once at creation.

FieldTypeDescription
id String! —
name String! Descriptive name you chose when creating the key.
prefix String! Short prefix for identification (e.g. sk_live_abc1).
expiresAt DateTime Optional expiration date. Expired keys are rejected automatically.
lastUsedAt DateTime When this key was last used to authenticate a request.
revokedAt DateTime When this key was revoked, if applicable. Revocation is permanent.
createdAt DateTime! —
updatedAt DateTime! —

ApiSignalSourceGrant object

One data source opened to one API-only developer. API-only users (a `member` who holds a live API key and belongs to no organisation or team) read NO Signals by default — including the Signals nested under an Event. Each grant opens exactly one source to one user.

FieldTypeDescription
id String! —
user User! —
dataSource DataSource! —
grantedBy User Admin who issued it. Null if that account was deleted.
reason String Why this source was opened to this user.
createdAt DateTime! —

ApproveUserResult object

Result of the admin-only `approveUser` mutation. Flips a `pending` user's role to `member`, emails them that they are approved, and mirrors the approval into the CRM when one is configured.

FieldTypeDescription
user User! The approved user (with the new role).
emailSent Boolean! True when the approval email was handed to the email provider. False means the user is approved but was not told; `emailError` says why.
emailError String Why the approval email failed. Null when it was sent.
crmMoved Boolean! True when the CRM contact landed in the approved collection. False when no CRM is configured or the sync failed; a failure also adds an entry to `crmWarnings`. The approval stands either way.
crmWarnings [String!]! Non-fatal CRM warnings, if any (e.g. profileType update failed while the list swap succeeded). Empty on the happy path.

ArchiveStaleAlertsResult object

Result of the archiveStaleAlerts bulk mutation.

FieldTypeDescription
alertsArchived Int! —

Brief object

A Brief: a platform admin's hand-picked summary of one area over one Brief window, emailed to a Recipient list. Sending freezes it. Platform admins only.

FieldTypeDescription
id String! —
cadence BriefCadence! —
status BriefStatus! —
title String! —
locationId String! The area: a country, state or district (locations.id). Not a relation: a sent Brief outlives location changes.
locationName String! The area's name, frozen when the Brief was created.
windowStart DateTime! Start of the Brief window: `windowEnd` minus 24h, 7d or 30d.
windowEnd DateTime! End of the Brief window: when the Brief was created or last refreshed.
summary String! Markdown-lite: **bold**, *italic*, `- ` bullets and [text](https://...) links.
closingNotes String! Markdown-lite, like `summary`.
items [BriefItem!]! Picked items, ordered by group (alert, event, signal) and then by `position` within the group.
counts BriefCounts! Signals, Events and Alerts over exactly this Brief's area and window, by severity and type, whatever filters a list shows. Live for a draft; for a sent Brief, the counts it was sent with.
createdById String! —
sentAt DateTime —
sentById String —
sentToListId String The Recipient list it was sent to.
sentCount Int Emails accepted by the provider at send.
failedCount Int Emails the provider refused at send. Not retried.
createdAt DateTime! —
updatedAt DateTime! —

BriefCounts object

Counts for a Brief's area and window, with the same semantics as `entityStats`: Alerts and Events windowed on their first Signal, Signals on publication, the area including everything inside it.

FieldTypeDescription
signal EntityCount! —
event EntityCount! —
alert EntityCount! —

BriefItem object

A detection picked into a Brief.

FieldTypeDescription
id String! —
briefId String! —
kind BriefItemKind! —
entityId String! The Alert, Event or Signal id. Not a relation: the item survives the entity being merged or deleted.
position Int! Order within its kind group, from 0.
note String The analyst's note, Markdown-lite.
snapshot BriefItemSnapshot! What the Brief shows for the item. Built server-side when the item is added, rewritten from live data at send, then frozen.
createdAt DateTime! —
updatedAt DateTime! —

BriefItemSnapshot object

A Brief item as the Brief shows it.

FieldTypeDescription
title String! —
severity Int 1 to 5, or null when unknown.
locationName String —
eventTypes [String!]! Disaster-type codes. A Signal takes its Events' types.
occurredAt DateTime! When the item happened, by the same columns the History list and `entityStats` window on: an Alert's or Event's first Signal, a Signal's publication. Earlier than `Brief.windowStart` means it was picked from before the window.
url String! The item's page in the CLEAR app.

BriefSendResult object

What `sendBrief` handed to the email provider.

FieldTypeDescription
sent Int! Emails the provider accepted.
failed Int! Emails the provider refused. Not retried.

CaseProposal object

One historical case a web Worker found while enriching an Event (V4): a past incident like it, the source that reports it, the figures it gives, and the CLEAR Event it describes when CLEAR already holds one. The unit an analyst accepts or rejects, one by one, in the Inbox and on the Event page.

FieldTypeDescription
id String! —
eventId String! The Event whose enrichment request produced the case.
event Event! —
taskId String! —
task Task! —
state CaseProposalState! —
sourceUrl String! —
quote String! The source's own words, verbatim.
occurredAt DateTime! When the incident happened (valid time), not when it was reported.
locationLabel String! —
locationId String A CLEAR location for the place, when the Worker resolved one.
hazardType String! GLIDE code; one of the requesting Event's `types`.
geographicScope String! `district` or `country`: the scope the case was matched at.
figures JSON! The figures the source gives, each on one of the Domain Ontology's seven metric types — `[{ metric, value, lowerBound?, upperBound?, unit?, populationGroup? }]`. Empty when the source states none.
matchedEventId String The CLEAR Event this case describes, when CLEAR already holds it.
matchedEvent Event —
methodVersion String! Version string of the skill or handler that produced the case.
decidedById String Who decided it, when and why (null while `proposed`).
decidedBy User —
decidedAt DateTime —
decisionRationale String —
resultSignalId String What accepting wrote into CLEAR: the Signal, and the Event it sits on.
resultEventId String —
createdAt DateTime! —

CommentTag object

A tag linking a user to a comment.

FieldTypeDescription
user User! —
comment UserComment! —

ComputedImpactPrior object

What has typically happened before (the Domain Ontology's ImpactPrior), computed from CLEAR's history (V4): the Events before this one that manifest the same hazard in the same country within the horizon, one current figure each for one metric and population group. Computed on read from accepted history — nothing to review. Read `numberOfCases` beside the figure: a prior resting on three Events is not one resting on ninety. Only observed or reported figures count: Estimates whose method is one of `media_report`, `government_figure`, `partner_or_cluster_figure`, `rapid_assessment`, `formal_assessment`, `registration`, `field_staff_judgement`. Figures with method `not_documented` (the pipeline's backfilled placeholders), `model_inference`, `exposure_model` or `prior_caseload_analogue` (itself derived from a prior) are not history, so they are never summarised.

FieldTypeDescription
hazardType String! GLIDE code; one of the Event's `types`.
countryLocationId String! The Event's country (level-0 location).
horizonYears Int! How far back history was taken, in years.
metric String! One of the Domain Ontology's seven metric types.
populationGroup String —
unit String The figures' unit (lower-cased), or null when they state none. Figures in different units are never summarised together.
centralValue Float! The median of the historical figures.
lowerBound Float! The smallest historical figure.
upperBound Float! The largest historical figure.
numberOfCases Int! How many historical Events it rests on.
lowConfidence Boolean! True below three cases: a starting point, not a basis.
eventIds [String!]! The historical Events it rests on.
estimateIds [String!]! The Estimates it rests on, one per Event.
basisMethods [EstimateMethodCount!]! How the Estimates it rests on were arrived at, most common first, so a reader can see what the prior is built from.
methodVersion String! Version of the method that computed it.

Conversation object

One CLEAR Agent Thread, stored as the record of what the Agent told its owner: the user's turns, the Answers, and the tools and Source documents each Answer drew on. Readable by its owner and, read-only, by platform admins (every admin read is logged). Written only through the CLEAR Agent's memory adapter in clear-mvp — the owner's session plus the agent service key — never by the owner calling the API directly; there is no delete.

FieldTypeDescription
id String! Caller-supplied id (the Agent's thread id).
userId String! The owner. Every Conversation belongs to exactly one user.
title String —
metadata JSON Opaque thread metadata kept by the Agent.
createdAt DateTime! —
updatedAt DateTime! Last time the Conversation or any of its messages was written.
cursor String! Opaque position in "most recently active first" order. Pass the last one of a page as `after` to get the next page.
messageCount Int! Number of messages in the Conversation.
messages [ConversationMessage!]! The most recent messages (before `before`, if given), in chronological order — the window an Agent loads as history. Page back with `before` for older ones.
first: Int — Max messages to return (1–500). Defaults to 500.before: String — Message id: return only messages older than this one. Pass the oldest id from the previous window to page back through history.

ConversationMessage object

One turn of a Conversation, as the CLEAR Agent stores it. `content` holds the Agent's message parts (text, tool calls and results, Source documents) and is opaque to the API.

FieldTypeDescription
id String! Caller-supplied id (the Agent's message id).
conversationId String! —
role String! `user`, `assistant`, `system`, `tool` or `signal`.
type String The Agent's message format tag, returned as stored.
content JSON! The message parts. Text that came from outside CLEAR (documents, signal bodies) is data, never instructions.
currentView JSON User turns only: what the user was looking at when they sent the turn — the page, entity ids and active filters. Identifiers, never data.
model String Answers only: the model that wrote it.
inputTokens Int Answers only: input tokens across the whole turn, tool steps included.
outputTokens Int Answers only: output tokens across the whole turn.
costUsd Float Answers only: what the turn cost in USD, from the caller's price table.
latencyMs Int Answers only: time from the user's turn to the finished Answer.
createdAt DateTime! —
updatedAt DateTime! —

CreateApiKeyPayload object

Returned only from createApiKey. Contains the full plaintext key that will never be retrievable again.

FieldTypeDescription
apiKey ApiKey! —
key String! The full API key. Copy this immediately — it cannot be retrieved later.

CreateDevUserResult object

Result of the admin-only `createDevUser` mutation. The plaintext API key is returned only here — it is never stored and cannot be retrieved later. The admin UI surfaces it once so the operator can copy-paste it in case the welcome email bounces.

FieldTypeDescription
user User! The newly-provisioned user.
plaintextKey String! The full plaintext API key (sk_live_…). Save this immediately — it will not be retrievable from the API after this response is read.
welcomeEmailSent Boolean! True when the welcome email was successfully handed off to the email provider.
setPasswordTokenIssued Boolean! True when a long-lived set-password verification token was successfully issued. The welcome email contains a link that consumes the token.

CreatePublicEventLinkResult object

Returned once from `createPublicEventLink`. The token is part of the URL and not retrievable again — same one-time-show semantics as `createApiKey`.

FieldTypeDescription
token String! The plaintext token. Embedded in `url` for convenience.
url String! Pre-built /public/event/<eventId>/<token> URL on the frontend. Hand this straight to the share UI.
expiresAt DateTime! Wall-clock expiry — when the cached snapshot will be dropped from Redis (assuming it isn't evicted earlier or revoked).

Crisis object

A crisis aggregates multiple events into a single coherent narrative.

FieldTypeDescription
id String! —
title String —
summary String —
enrichmentStatus CrisisEnrichmentStatus! Enrichment status for the pipeline drain (PENDING until enrichment runs).
scenarios JSON Forward-looking scenarios generated by the LLM enrichment task. Shape: { most_likely, best_case, worst_case, description }. Null until the enrichment task runs.
severity Float! Severity score (aggregated from linked events).
generalLocation Location General location of the crisis.
needs JSON! Needs associated with the crisis (JSON structure).
populationAffected String Population directly affected by linked events (BigInt as string).
populationInArea String Total population residing within the admin areas of linked events (BigInt as string).
attachments [String!]! Supporting documents uploaded by users (reports, photos, PDFs). Returned as presigned URLs — the underlying storage is S3 keys, which the resolver converts at read time so links stay short-lived.
events [Event!]! Events that are part of this crisis.
feedbacks [UserFeedback!]! User feedback on this crisis.
comments [UserComment!]! User comments on this crisis.
createdAt DateTime! When the crisis row was created.
updatedAt DateTime! When the crisis was last written to — bumped automatically by Prisma on every update path (title / description / population / attachments / event-linkage / needs / scenarios). Useful for cache invalidation and "recently updated" surfaces.

CurrentTotals object

Estimated current totals for a country bucket (ADR-0006 §4). Each metric is `null` when there is no anchoring stock in scope to accrue flows onto.

FieldTypeDescription
displacement StockFlowEstimate IDP displacement: latest `idp_stock` + `new_displacements` since T₀.
returns StockFlowEstimate Returns: latest `returnee_stock` + `new_returns` since T₀.

DailyActivityCount object

FieldTypeDescription
date String! YYYY-MM-DD in UTC.
total Int! —
counts ActivityCountsByAction! —

DataSource object

An external data source that feeds signals into the system.

FieldTypeDescription
id String! —
name String! —
type String! Source type identifier (e.g. satellite, sensor, manual).
isActive Boolean! —
baseUrl String Base URL of the data source API.
infoUrl String URL with more information about this source.
synonyms [String!]! Alias set for source-name normalisation — variants that resolve to this same source (e.g. "IOM DTM" / "Displacement Tracking Matrix" / "DTM").
reliability Int NATO Admiralty-style source-reliability grade, 1 (least) – 4 (most). Null = ungraded; the data-quality formula treats null as 1. See clear-pipeline ADR-0004.
createdAt DateTime! —
updatedAt DateTime! —
signals [Signal!]! Signals collected from this data source.

DauPoint object

One day in a DAU time series.

FieldTypeDescription
date String! ISO date (YYYY-MM-DD, UTC).
uniqueUsers Int! Number of distinct users who logged in on this date.

DetectionBucket object

Counted Events whose first ingested Signal falls in one bucket of the requested granularity.

FieldTypeDescription
start DateTime! Start of the bucket: 00:00 UTC of the day, the week's Monday, or the first of the month.
label String! `2026-10-29` for a day, `2026-W44` for an ISO week, `2026-10` for a month.
eventsInRange Int! Events in range in this bucket, counted plus excluded.
counted Int! Counted Events first signalled in this bucket.
sameDay Int! Of those, first signalled on their onset day.
byNextDay Int! Of those, first signalled on their onset day or the day after.
isPartial Boolean! True when the range covers only part of the bucket, e.g. the current one.

DetectionExclusion object

Events in range left out of time to detection for one reason.

FieldTypeDescription
reason DetectionExclusionReason! —
count Int! Events left out for this reason.

DetectionHistogramBucket object

Counted Events whose first ingested Signal came this many days after onset.

FieldTypeDescription
daysAfterOnset Int! Whole UTC days from onset to first ingested Signal; the open-ended row's lower bound.
isOpenEnded Boolean! True for the last row, which counts `daysAfterOnset` days and more.
count Int! Counted Events in this bucket.

DetectionMetrics object

Time to detection: how soon after an Event's real-world onset CLEAR received its first ingested Signal, in whole UTC days (same day = 0, next day = 1). Counts only; shares are the caller's to compute. See ADR-0011. An Event is in range when its first ingested Signal's `publishedAt` is, or, with none, its `firstSignalCreatedAt`. Dummy Events are left out.

FieldTypeDescription
from DateTime! Start of the range measured.
to DateTime! End of the range measured.
eventsInRange Int! Events in range: `counted` plus every exclusion.
withOnset Int! Events in range with an onset date.
counted Int! Events measured: an onset, a first ingested Signal with a time of day, on or after the onset day.
sameDay Int! Counted Events first signalled on their onset day.
byNextDay Int! Counted Events first signalled on their onset day or the day after.
histogram [DetectionHistogramBucket!]! Counted Events by whole days from onset: exactly 9 rows, 0 to 7, then 8 and more (`isOpenEnded`).
weekly [DetectionWeek!]! Counted Events per ISO week of their first ingested Signal, with each week's Events in range, ascending, one row per week the range touches (zero-filled).
exclusions [DetectionExclusion!]! Events in range not measured, by reason: exactly 4 rows, one per reason.
granularity MetricGranularity! The bucket size `series` was read in.
series [DetectionBucket!]! The same tally as `weekly` per bucket of `granularity` (ADR-0014): zero-filled over every bucket the range touches, ascending. With `WEEK` it equals `weekly` row for row.

DetectionWeek object

Counted Events whose first ingested Signal falls in one ISO week.

FieldTypeDescription
isoWeek String! The ISO week, e.g. `2026-W42`.
weekStart DateTime! Monday 00:00 UTC of the week.
eventsInRange Int! Events in range this week, counted plus excluded, bucketed by the same instant that puts them in range (the first ingested Signal, or with none `firstSignalCreatedAt`). `counted / eventsInRange` is the week's measured coverage.
counted Int! Counted Events first signalled this week.
sameDay Int! Of those, first signalled on their onset day.
byNextDay Int! Of those, first signalled on their onset day or the day after.
isPartial Boolean! True when the range covers only part of the week, e.g. the current week.

DigestPreviewRow object

One Alert the daily Alert Digest would send for a Brief's area and window.

FieldTypeDescription
alert Alert! A published Alert in the Brief's area whose Event's first Signal falls in the Brief window, the same scope as `Brief.counts`. Its title and severity are on `event`.
subscriberCount Int! Distinct users with an active daily subscription matching the Alert's type, location (or an ancestor of it) and severity floor. Always at least 1.

DisasterLevel1 object

A level-1 category with its level-2 groups.

FieldTypeDescription
name String! —
groups [DisasterLevel2!]! —

DisasterLevel2 object

A level-2 group with its distinct classification codes.

FieldTypeDescription
name String! —
codes [String!]! Classification codes belonging to this level-2 group (usually one).
subTypes [DisasterType!]! Level-3 sub-types under this level-2 group.

DisasterType object

A disaster classification in a 3-level hierarchy (level1 > level2 > level3). Events store arrays of codes (GLIDE or CLEAR IDs).

FieldTypeDescription
id String! —
disasterType String! Level-3 granular sub-type (e.g. "peaceful protest").
disasterClass String! Level-1 category (legacy — same as level1).
glideNumber String! Classification code — may be a GLIDE number or a CLEAR id.
level1 String! Top-level category (e.g. "natural hazard", "conflict").
level2 String! Mid-level group (e.g. "protests", "battles").
idType String! Identifier system: "glide_number" or "clear_id".

EntityCount object

One kind of detection's counts in a Brief.

FieldTypeDescription
total Int! —
bySeverity [StatsBucket!]! Keys are severities 1 to 5 as strings, "(unknown)" for none.
byType [StatsBucket!]! Disaster-type codes for Events and Alerts; data-source names for Signals, as in `entityStats`.

EntityStats object

FieldTypeDescription
total Int! Total matching the filter, regardless of groupBy.
buckets [StatsBucket!]! Buckets when groupBy != none. Empty when groupBy = none.

Estimate object

A figure for one metric on an Event (the Domain Ontology's Estimate), with its method, its uncertainty and both timestamps. Never overwritten: a correction is a new Estimate whose `supersedes` is the one it replaces. Where bounds are present, `lowerBound ≤ value ≤ upperBound`.

FieldTypeDescription
id String! —
eventId String! —
event Event! —
metric EstimateMetric! —
populationGroup String IDP, refugee, returnee, host community or non-displaced affected; null when the figure covers everyone.
value Float! —
unit String e.g. `people`, `households`.
lowerBound Float —
upperBound Float —
method EstimateMethod! —
attribution EstimateAttribution! —
validFor DateTime! The date the figure describes (valid time).
estimatedAt DateTime! When the figure was made (transaction time).
isGroundTruth Boolean! True for verified figures used to score earlier Estimates.
sourceSignalId String The Signal the figure was read from, if any.
sourceUrl String —
supersedesId String —
supersedes Estimate The Estimate this one corrects.
supersededBy Estimate The Estimate that corrects this one; null while it is current.
definitionVersion String! The Domain Ontology version whose definitions the figure was made under, e.g. `0.3.0`.
createdBy User Who recorded it; null for system-written Estimates.
createdAt DateTime! —

EstimateMethodCount object

How many of a prior's figures were arrived at by one method.

FieldTypeDescription
method EstimateMethod! —
count Int! —

Event object

An event grouping related signals into a coherent narrative.

FieldTypeDescription
id String! —
title String —
description String —
descriptionSignals JSON LLM-generated signal descriptions as JSON.
validFrom DateTime! —
validTo DateTime Event end / expiry. Null when no real end is known (not invented).
firstSignalCreatedAt DateTime! —
lastSignalCreatedAt DateTime! —
startedAt DateTime When the real-world event actually STARTED (its onset) — parsed from the signal text, distinct from `validFrom`/`firstSignalCreatedAt` (record + signal-collection times). Null when no onset could be resolved.
endedAt DateTime When the real-world event actually ENDED (its close), distinct from `validTo` (the visibility/expiry window). Null = ongoing / no known end.
startedAtAccuracy DateAccuracy Precision of `startedAt` (DAY = exact day; coarser = week/month/year).
endedAtAccuracy DateAccuracy Precision of `endedAt`.
magnitude Float Natural-hazard magnitude (e.g. 6.4), aggregated from member signals. Null for non-disaster events.
magnitudeUnit String Unit for `magnitude` (e.g. "Mw", "km/h"). Null when no magnitude.
actors [String!]! Named conflict actors aggregated across member signals. Empty for non-conflict events.
countries [Location!]! Countries the event touches, resolved to admin-0 locations.
originLocation Location Origin location of the event.
destinationLocation Location Destination location of the event.
generalLocation Location General location (when no origin/destination).
representativePoint Location Location of the event's FIRST signal (the one recorded in `firstSignalCreatedAt`) — a single point ready to drop as a map marker, so a client doesn't have to fetch every signal and pick one. The first non-null of the signal's origin → destination → general location; null when the first signal has no located point. Requires any authenticated content reader.
types [String!]! Event type tags.
severity Int Severity score (1–5). Aggregated from signal severities.
isDummy Boolean! Whether this is seed/demo data.
populationAffected String Estimated population affected.
populationDisplaced String Estimated population displaced by the event (BigInt as string).
casualties Int Aggregated casualties for the event (sum across constituent signals).
rank Float! —
rewriteMembersHash String Hash of the live member signal ids at the last LLM rewrite. Lets the recompute skip the rewrite when membership is unchanged.
signals [Signal!]! Signals linked to this event, excluding retracted ones.
alerts [Alert!]! Alerts created from this event.
feedbacks [UserFeedback!]! User feedback on this event.
comments [UserComment!]! User comments on this event.
escalations [EventEscalation!]! Escalations by users.
estimates [Estimate!]! Figures for this Event, newest first (by `estimatedAt`). Follows the Event's visibility: any authenticated content reader. By default the whole history, superseded Estimates included; `current: true` keeps only those not yet superseded.
metric: EstimateMetriccurrent: Boolean
enrichmentTasks [Task!]! Enrichment Tasks about this Event, newest first. Requires any authenticated content reader; `lastError` is redacted for all but the requester and platform admins.
impactPriors [ImpactPrior!]! History: the whole ImpactPriors Workers proposed for this Event in V1–V3, newest first. `accepted` follows the Event's visibility; `proposed` is visible to its requester and to deciders; `rejected` to deciders only. For what history suggests now, read `computedImpactPriors`.
caseProposals [CaseProposal!]! Web cases proposed while enriching this Event (V4), newest first, under the ImpactPrior visibility rule: `accepted` follows the Event, `proposed` is visible to the requester and deciders, `rejected` to deciders only.
computedImpactPriors [ComputedImpactPrior!]! ImpactPriors computed from CLEAR's history (V4), one per hazard the Event manifests × metric × population group with any history, most evidence first. Follows the Event's visibility. `horizonYears` (default 10, at most 50) is how far back history is taken.
horizonYears: Int

EventCrisis object

Link between a crisis and an event.

FieldTypeDescription
id String! —
crisisId String! —
eventId String! —
collectedAt DateTime! —
crisis Crisis! —
event Event! —

EventEscalation object

Tracks a user escalating an event, optionally to a crisis.

FieldTypeDescription
id String! —
user User! —
event Event! —
isCrisis Boolean! Whether this has been escalated to a crisis.
validFrom DateTime! —
validTo DateTime! —

EventsPage object

FieldTypeDescription
items [Event!]! —
totalCount Int! —
hasMore Boolean! —

FeatureFlag object

A feature toggle that controls runtime behavior.

FieldTypeDescription
id Int! —
key String! Unique key used to look up this flag (e.g. dark_mode).
enabled Boolean! —
updatedAt DateTime! —

FindOrCreateLandmarkL4Result object

Outcome of findOrCreateLandmarkL4.

FieldTypeDescription
locationId String The resolved L4 id. Null when the same-A2 safety check aborts.
reused Boolean! True when the call resolved to an existing L4, false when a new one was created. Meaningless when locationId is null.
pointType String Provenance tag of the resolved L4 ('landmark-geocoded', 'gps', etc). Null when the call aborted without producing a row.
abortedReason String Set to 'different_a2' when the candidate and source coords resolve to different containing A2s. Null on success.

FrameEvidenceWatermark object

Latest-evidence watermark for a frame (ADR-0008), over BOTH retrieval tiers the analysis is generated from — the `knowledgebase` report tier AND the `events_index` incident tier. The drain compares `latestEvidenceAt` to the live analysis's `generatedAt` to decide whether anything new warrants a regeneration. The per-tier fields let a selective regenerator tell whether the change came from new reports, new events, or both (#1067).

FieldTypeDescription
latestEvidenceAt DateTime Max ingestion time (`created_at`) across BOTH tiers matching the frame — the later of the report and event watermarks — or null when the frame has no evidence yet. This is the combined signal the regeneration gate keys off, so a new event now advances it just like a new report.
evidenceCount Int! Combined count across both tiers.
reportsLatestEvidenceAt DateTime Report tier (`knowledgebase`) only: max `created_at` and row count.
reportsCount Int! —
eventsLatestEvidenceAt DateTime Incident tier (`events_index`) only: max `created_at` and row count.
eventsCount Int! —

GazetteerHit object

A gazetteer match for a place name: one of CLEAR's own place aliases, or a GeoNames row. GeoNames coordinates come straight from GeoNames, so callers still validate them (e.g. the same-A2 check against a signal's source coordinates) before trusting a fuzzy hit.

FieldTypeDescription
geonamesId Int! The GeoNames id. 0 for an alias whose location has none.
name String! —
latitude Float! —
longitude Float! —
featureClass String GeoNames feature class: A=admin area, P=populated place, H=hydro, L=area, S=spot/POI, T=terrain, … The resolver prefers P/A.
featureCode String —
countryCode String! ISO-3166-1 alpha-2 (SD, VE, AF).
population Float! —
score Float! Match confidence 0–1: 1.0 for an exact normalised-name hit, else the pg_trgm similarity of the best fuzzy match.
exact Boolean! True when matched exactly on the normalised name, false when fuzzy.
locationId String The CLEAR location an alias points at. Null for a GeoNames match. Use it as the Signal's location directly: do not create a new landmark.
source GazetteerSource! —

GroundIngestResult object

Result of a chat-export ingest (also returned by the REST upload route as JSON).

FieldTypeDescription
created Int! —
skipped Int! —
mediaStored Int! —
mediaUnmatched [String!]! —

GroundMessage object

A staged Signal: a canonical message parsed from a WhatsApp source, held in the ground staging tier until its thread is reviewed. Text is phone-number-redacted at persistence. senderName is private-tier data and is scrubbed from anything promoted to the signals graph.

FieldTypeDescription
id ID! —
groundSourceId String! —
externalId String! Idempotency id, scheme "whatsapp:{groupJid}:{messageId}".
sentAt DateTime! —
senderRef String! Pseudonymous per-(source, sender) reference, e.g. "s_ab12cd34ef56".
senderName String Raw sender display name. Private tier only — never promoted.
text String! Message text (redacted). Empty for caption-less media messages. Always the reporter's original words — translations are a separate overlay (see `translation`), never written here.
language String Language of `text` as a lowercased ISO 639-1 code ("ar", "en", "fr", "es"), detected at intake without an LLM. Null when unknown (too short, another language, or ingested before detection).
translation GroundMessageTranslation! On-demand translation of `text` into `locale`. `unavailable` until requestGroundMessageTranslation queues it; poll while `queued`.
locale: String!
mediaKeys [String!]! S3 keys of stored attachments.
mediaUrls [String!]! Presigned GET URLs for mediaKeys (1 h expiry), generated at read time — URLs are never stored.
mediaRefs [String!]! Attachment filenames referenced by the export.
omittedMediaCount Int! Media the export omitted ("image omitted") — the message still counts as a media message.
hasVoice Boolean! True when the message has a voice-note attachment (hotline sources). Set when the row is created, so it is true even while the voice note's media is still being stored.
transcript String Transcribed text of the message's voice note(s). Null until the clear-pipeline Dagster ground_transcribe asset transcribes it, and always null for messages without a voice note. Phone numbers are redacted at write time.
classification String "field_report" | "news_digest" | "operational" | "chatter"; null until the pipeline classification task labels the message.
uncertainty String Contributor's own uncertainty tag ("unconfirmed", "rumour"), preserved from the source text.
isEdited Boolean! —
enrichFailedAt DateTime Enrichment (ground_hotline_enrich) gave up on this message: set when the drain exhausted its attempts. While set, the message is out of the enrichment queue — retryGroundMessage(stage: ENRICH) clears it.
enrichError String Last error from the enrichment drain (truncated, phone-redacted).
transcribeFailedAt DateTime Transcription (ground_transcribe) gave up on this voice note: set when the drain exhausted its attempts. While set, the message is out of both the transcription and enrichment queues ("transcription failed") — retryGroundMessage(stage: TRANSCRIBE) clears it.
transcribeError String Last error from the transcription drain (truncated, phone-redacted).
threadId String —
createdAt DateTime! —

GroundMessageForClassification object

Pipeline-facing projection of a staged Signal for the classification/threading worker (clear-pipeline's classify_ground_messages task). Deliberately excludes senderName — the pipeline never sees private-tier identity, only the pseudonymous senderRef.

FieldTypeDescription
id ID! —
text String! —
sentAt DateTime! —
senderRef String! —
hasMedia Boolean! True when the message carries stored media, export-referenced attachments, or export-omitted media.
voiceMediaKeys [String!]! S3 keys of this message's audio attachments only (a subset of its stored media) — empty when the message has no voice note, or while its media is still being stored (see `hasVoice`).
hasVoice Boolean! True when the message has a voice attachment. Set when the row is created, so it stays true while `voiceMediaKeys` is still empty because the media hasn't been stored yet.
transcript String Transcribed text for this message's voice note(s), null until the Dagster ground_transcribe asset transcribes them.
classification String Current label, null while unclassified.
threadId String Current thread (placeholder or pipeline-built).
enrichFailedAt DateTime Set once the enrichment drain has given up on the message (see markGroundMessagesFailed).
enrichError String —
transcribeFailedAt DateTime Set once the transcription drain has given up on the voice note.
transcribeError String —

GroundMessageForTranslation object

Pipeline-facing projection of a staged message for the translate drain: text and detected language only — no sender identity.

FieldTypeDescription
id ID! —
text String! Message text (phone-redacted at persistence).
language String Detected source language, null when unknown.

GroundMessageTranslation object

A staged message's translation into one locale — a read-only overlay; the original text stays canonical.

FieldTypeDescription
locale String! Lowercased BCP-47 locale, e.g. "en".
status GroundTranslationStatus! —
text String Translated text. Null unless `status` is `ready`.

GroundSource object

Per-source policy record for ground intelligence (WhatsApp groups, future hotline). Carries the consent scope, privacy default, reviewer roles, and retention rule for everything ingested from the source. The whole ground staging tier is private: admin only.

FieldTypeDescription
id ID! —
name String! —
kind String! Source kind: "staff_group" | "partner_group" | "hotline".
transportId String! Transport binding — WhatsApp group JID, or hotline number.
consentScope String What the source's members consented to (free text, e.g. "links and resources only"). Ingest policy is judged against this record.
consentRecordedAt DateTime —
consentRecordedBy String Who recorded/gave the consent (person name/role, not a user id).
privacyDefault String! Review default for derived threads. V1: always "private".
reviewerRoles [String!]! Global roles allowed to review threads from this source.
retentionRule String Free-text retention rule; enforcement is operational in V1.
teamId String The team whose emergency response managers triage this source. Null: no team yet, so only platform admins see its threads.
isActive Boolean! —
createdAt DateTime! —
updatedAt DateTime! —

GroundThread object

A thread — a cluster of staged Signals — in the review queue. V1 threads are one-per-message placeholders until the pipeline threading task clusters them. Lifecycle state models the correction chain; review state is the human gate in front of the signals graph. An approved thread is promoted and becomes a Signal.

FieldTypeDescription
id ID! —
groundSourceId String! —
source GroundSource! —
title String —
lifecycleState String! "reported" | "updated" | "confirmed" | "corrected" | "retracted".
reviewState String! "unverified" | "approved_private" | "approved_public" | "rejected".
reviewedBy String Auth user id of the reviewer who last transitioned reviewState.
reviewedAt DateTime —
reviewNote String —
rejectReason String Structured rejection reason: "spam" | "not_report" | "unusable" | "duplicate". Set only while reviewState is "rejected"; null otherwise.
promotedSignalId String Id of the `signals` row created when this thread was promoted (approved_public only).
draftTitle String LLM-suggested headline from the hotline-enrichment job. A draft — the ERM reviews/edits it before promotion; never used directly.
draftSeverity Int 1-5 suggestion from the hotline-enrichment job.
draftLocationId String Geoparser-resolved `locations` row id, suggested by the hotline-enrichment job.
draftDisasterType String Disaster-type guess from the hotline-enrichment job.
messages [GroundMessage!]! —
messageIds [String!]! Ids of the thread's messages, oldest first. The pipeline worker selects this (via groundThreadsForSource) instead of `messages` — it carries no message content and no sender identity.
createdAt DateTime! —
updatedAt DateTime! —

ImpactPrior object

History: a whole ImpactPrior a Worker proposed in V1–V3, and the decision recorded on it. Retired (2026-10-08): nothing creates or decides one any more. The ImpactPrior is computed from history instead (see `ComputedImpactPrior`); what analysts review is CaseProposals.

FieldTypeDescription
id String! —
eventId String! —
event Event! —
taskId String! —
task Task! —
state ImpactPriorState! —
sourceKind String! The kind of the Task that produced it — `event.impact_prior.clear` (CLEAR data), `event.impact_prior.web` (the web), or the pre-fan-out `event.impact_prior` — so a client can label the source.
hazardType String! GLIDE code; one of the Event's `types`.
countryLocationId String! The level-0 (country) ancestor of the Event's primary location.
geographicScope String! `district` or `country`: the scope the cases were matched at.
horizonYears Int! How far back cases were sought, in years.
populationGroup String —
metric String —
lowerBound Float —
upperBound Float —
numberOfCases Int! —
basis JSON! The evidence: one entry per case — `{ tier: "clear" | "web", eventId?, sourceUrl?, quote?, occurredAt?, locationLabel?, scope }`.
validFrom DateTime —
validTo DateTime —
methodVersion String! Version string of the skill or handler that produced it.
supersedesId String The previous ImpactPrior of the same `sourceKind` for the same Event, if any. Never crosses sources.
supersedes ImpactPrior —
decidedById String Who decided it, when and why (null while `proposed`).
decidedBy User —
decidedAt DateTime —
decisionRationale String —
createdAt DateTime! —

InterpretedReportQuery object

How `searchReportsNaturalLanguage` parsed the question into the structured arguments it ran. Surfaced so a UI can show "interpreted as …" and let the user correct it (then call `searchReports` directly with the fix).

FieldTypeDescription
topicalQuery String! Residual topical text used for the semantic step (empty → recency listing).
source String Recognised publisher/source substring (e.g. "UNHCR"); null if none.
publishedFrom DateTime Parsed publication-date window (inclusive); null ends are open.
publishedTo DateTime —
countryLocationId String A0 location resolved from a country named in the question; null if none.
countryName String —

Invitation object

An invitation to join an organisation, with one or more team assignments.

FieldTypeDescription
id String! —
email String! —
organisation Organisation! —
team Team Single team — legacy field, populated only for invitations created before the multi-team join existed. New invitations use `teams`.
role String! Organisation role assigned on acceptance.
teamRole String Legacy single-team role. Use `teams` for new invitations.
teams [InvitationTeam!]! Team assignments granted to the invitee on acceptance. Empty list means org-only access (no team).
expiresAt DateTime! —
acceptedAt DateTime —
invitedBy User! —
createdAt DateTime! —
status InvitationStatus! Computed from acceptedAt and expiresAt.

InvitationInfo object

Public invitation info returned by token lookup (limited fields).

FieldTypeDescription
id String! —
email String! —
organisationName String! —
teamName String Legacy single-team name (populated only for old invitations).
role String! —
teamRole String Legacy single-team role (populated only for old invitations).
teams [InvitationInfoTeam!]! Team assignments the invitee will be granted on acceptance.
expiresAt DateTime! —
status InvitationStatus! —

InvitationInfoTeam object

One (team, role) assignment as returned by the public token lookup.

FieldTypeDescription
teamId String! —
teamName String! —
teamRole TeamMemberRole! —

InvitationTeam object

One (team, role) assignment attached to an invitation.

FieldTypeDescription
team Team! —
teamRole TeamMemberRole! —

KnowledgebaseHit object

One hit from `searchKnowledgebase`. Carries enough source provenance (report title, url, page range) that a UI can render a citation without a follow-up fetch, plus the parameter arrays so the caller can highlight which filters matched.

FieldTypeDescription
id String! —
tier KnowledgebaseTier! Tier this hit came from (ADR-0006). Consumers should weight/caveat `incident` hits as lower-tier (possibly unverified) and MUST NOT let incident figures feed the same datapoint aggregation as report figures.
reportId String! For a `report` hit, the ReliefWeb report id; for an `incident` hit, `event:<event id>`.
reportTitle String! —
sourceUrl String! —
publishedAt DateTime Report publication date, or — for an incident — the event's onset (`startedAt`), the recency signal used to order the incident band.
pageStart Int! 0 for an incident hit (page range is report-only).
pageEnd Int! —
chunkText String! Report chunk excerpt, or — for an incident — the synthesised event card.
score Float! Merge score, larger is better. Ordering/membership only — NOT comparable across queries or (post-ADR-0006) across tiers: it is a positional `1/(k+rank)` from the tier-aware merge, plus a small recency term on incidents, not the raw RRF sum.
locationIds [String!]! —
eventTypes [String!]! —
needSectors [String!]! —
figureS3Key String When this hit is a figure transcription, the cropped image's S3 key and its kind (chart/map/table/infographic/photo) — null for text hits. A consumer generating an infographic fetches this image and attaches it to the LLM call; plain Q&A ignores it. Kept as a lightweight REFERENCE (no bytes) so retrieval never pays S3 cost.
figureKind String —
figureImageUrl String Presigned (1-hour) URL to the cropped figure image, for a figure hit; null for a text hit. Resolved lazily — only presigned when the field is actually selected, so ordinary text search never pays the S3 round-trip. This is the infographic-search (Cap 2) payload: pair it with `filters.figuresOnly: true`.

KnowledgebaseIngestJob object

One Dagster run kicked off by `uploadKnowledgebaseDocument`. Returned by both the mutation (initial launch) and the polling query. `reportId` / `reportTitle` / `s3Key` are populated from the run's Dagster tags, which the mutation attaches at launch time — a client that lost track of the initial payload can still recover the identity of the document being ingested.

FieldTypeDescription
runId String! Opaque Dagster run id. Pass to `knowledgebaseIngestJob` to poll for completion.
status KnowledgebaseIngestStatus! —
reportId String The knowledgebase report_id the ingest is targeting. Same value surfaces on `Knowledgebase.reportId` once the run succeeds.
reportTitle String —
s3Key String —
startedAt DateTime —
endedAt DateTime —

Location object

A place in the location hierarchy: country > state > district > point

FieldTypeDescription
id String! —
geoId Int GeoNames identifier.
osmId String OpenStreetMap identifier.
pCode String P-Code identifier.
name String! —
level Int! Hierarchy level: 0 = country, 1 = state, 2 = district, 4 = point (there is no level 3)
geometry GeoJSON Geometry as GeoJSON (Point or MultiPolygon).
parent Location Parent location in the hierarchy.
children [Location!]! Child locations one level below.
ancestorIds [String!]! IDs of all ancestor locations (parent, grandparent, etc.).
ancestors [Location!]! All ancestor locations (parent, grandparent, etc.).
population String Population residing within this location's geometry. Null for point locations or when not yet computed.
pointType String Provenance of this location's geometry. Notable values: - 'landmark-geocoded': L4 created by the pipeline geoparser from a landmark or place name resolved via the GeoNames gazetteer or LocationIQ, including place names read from text-only signals. The location's `name` field is meaningful for display (e.g., 'Nyala Airport'). - 'gps' / 'source-gps' / 'centroid' / 'source-centroid': see schema documentation on the Prisma model. - null: legacy rows (most signal-title L4s from `createPointLocation`).
metadata [LocationMetadata!]! Per-type metadata (IOM DTM, INFORM, etc). Pass a type argument to filter. By default only the current value is returned (validTo is null). Pass current: false to include the full history.
type: Stringcurrent: Boolean
createdAt DateTime! When the row was first created.
updatedAt DateTime! Last write — useful for tracking admin polygon (re-)loads.

LocationCorrectionCounts object

Location challenges filed in range, by status.

FieldTypeDescription
open Int! Awaiting a decision (status `consideration`).
accepted Int! The analyst's proposed point was written onto the Signal.
corrected Int! The decider placed a different point.
declined Int! Declined: the location stood.
superseded Int! Replaced by a newer challenge on the same Signal.

LocationMetadata object

Arbitrary per-location metadata keyed by type. History is preserved: writes close the current row (set validTo = now()) and insert a new one. The CURRENT value for a (location, type) is the row where validTo is null.

FieldTypeDescription
id String! —
location Location! —
type String! Free-form type string (e.g. "iom_dtm_displacement", "acaps_inform").
data JSON! Source-specific payload stored as JSON.
validFrom DateTime! When this value became current.
validTo DateTime When this value was superseded. Null means still current.
createdAt DateTime! —
updatedAt DateTime! —

LocationPrecisionBucket object

One source's ingested Signals located in one bucket of the requested granularity, by the level of their location.

FieldTypeDescription
start DateTime! Start of the bucket: 00:00 UTC of the day, the week's Monday, or the first of the month.
label String! `2026-10-29` for a day, `2026-W44` for an ISO week, `2026-10` for a month.
source String! `DataSource.name`.
total Int! —
noLocation Int! —
country Int! —
state Int! —
district Int! —
point Int! —
isPartial Boolean! True when the range covers only part of the bucket, e.g. the current one.

LocationPrecisionMetrics object

Location precision: how finely CLEAR placed the Signals it ingested, per source and ISO week. Each ingested Signal in range counts once under the level of its location (general location, or for displacement its origin, else its destination): no location, country (0), state (1), district (2) or point (a level-4 landmark or coordinate point). "District or finer" is district plus point. A Signal a person corrected counts at the location the pipeline gave it, not the corrected point. Counts only; shares are the caller's. See ADR-0012. The level and the instant come from the Signal's Live Outcome in the location Outcome log (ADR-0020), not from the live Signal. The instant is when the pipeline first finished the Signal, or its `collectedAt` while no run has finished it. A Signal is in range by that instant. A replay adds rows to the log and changes no past bucket. Ingested means brought in by a pipeline (not submitted or filed by hand), not retracted, not dummy.

FieldTypeDescription
from DateTime! Start of the range measured.
to DateTime! End of the range measured.
signalsInRange Int! Ingested Signals located in range, under the filters.
bySource [LocationPrecisionSource!]! One row per source with a Signal in range, most Signals first.
weekly [LocationPrecisionWeek!]! Each source in `bySource` by ISO week of the instant its Signals were located, zero-filled over every week the range touches, ascending.
corrections LocationCorrectionCounts! Location challenges filed in range, by status: a correctness proxy until an analyst-checked sample exists.
granularity MetricGranularity! The bucket size `series` was read in.
series [LocationPrecisionBucket!]! Each source in `bySource` per bucket of `granularity` (ADR-0014): zero-filled over every bucket the range touches, in `bySource` order then ascending. With `WEEK` it equals `weekly` row for row.

LocationPrecisionSource object

Ingested Signals of one source in range, by the level of their location.

FieldTypeDescription
source String! `DataSource.name`.
total Int! All of the source's ingested Signals in range.
noLocation Int! Signals with no location at all.
country Int! Signals at a country (level 0).
state Int! Signals at a state or province (level 1).
district Int! Signals at a district (level 2).
point Int! Signals at a point: a level-4 landmark or coordinate point inside a district.

LocationPrecisionWeek object

One source's ingested Signals located in one ISO week, by the level of their location.

FieldTypeDescription
isoWeek String! The ISO week, e.g. `2026-W44`.
weekStart DateTime! Monday 00:00 UTC of the week.
source String! `DataSource.name`.
total Int! —
noLocation Int! —
country Int! —
state Int! —
district Int! —
point Int! —
isPartial Boolean! True when the range covers only part of the week, e.g. the current week.

LocationReplayRun object

One Replay run of the pipeline that re-located Signals in the range (ADR-0020). A Replay run re-processes Signals that a run already finished; its results are kept beside the history, never in place of it.

FieldTypeDescription
runId String! The id the pipeline gave the run: a Dagster run id, or a replay job's own id. Pass it as `MetricSeriesInput.replayRunId`.
pipelineVersion String The clear-pipeline git SHA of the run; null when the pipeline sent none.
startedAt DateTime! The instant of the run's first result for a Signal in range.
signals Int! How many ingested Signals in range the run re-processed: the denominator total of its replay series.

MauPoint object

One month in a MAU time series.

FieldTypeDescription
month String! ISO month (YYYY-MM, UTC).
uniqueUsers Int! Number of distinct users who logged in at least once during the calendar month.

MetricAnnotation object

A change that should move a metric, drawn as a marker on the admin /metrics charts (ADR-0016): a deploy, a data import, a prompt change. Rows are per environment, because a change reaches dev and prod at different instants.

FieldTypeDescription
id ID! —
at DateTime! When the change reached this environment (UTC).
label String! Short label on the chart.
description String What changed and why it should move the metric.
link String Where to read more: a pull request, a ticket, an ADR.
metricKeys [MetricKey!]! The registry metrics the change bears on (ADR-0015); at least one.
createdById String! —
createdAt DateTime! —

MetricBucket object

One bucket of one group. The metric is `numerator / denominator`; a bucket with a zero denominator measured nothing.

FieldTypeDescription
start DateTime! Start of the bucket: 00:00 UTC of the day, the week's Monday, or the first of the month.
label String! `2026-10-29` for a day, `2026-W44` for an ISO week, `2026-10` for a month.
isPartial Boolean! True when the range covers only part of the bucket.
group String The group this bucket belongs to; null for an ungrouped series.
numerator Int! —
denominator Int! —

MetricDefinition object

What a client needs to list, group and explain a metric.

FieldTypeDescription
key MetricKey! —
name String! The metric's name, as the Notion Metrics table names it.
dimension MetricDimension! —
unit MetricUnit! —
description String! The method in one paragraph: what counts, over what.
timeBasis String! The instant that puts a row in a bucket.
groupable Boolean! True when the series can be read with `groupBy: SOURCE`.
locationScoped Boolean! True when `locationId` scopes the series. False for a metric that reads every country (Sources on schedule): clients should drop the country filter from its reading and label it so.
adr String! The ADR that owns the definition, e.g. `ADR-0012`.

MetricSeries object

One metric over a range as a share per bucket, read from the service that owns the metric's definition, so it never disagrees with the metric's own query (ADR-0015). Counts only; shares are the caller's to compute.

FieldTypeDescription
metric MetricKey! —
granularity MetricGranularity! The bucket size the series was read in.
from DateTime! —
to DateTime! —
groups [String!]! Group names in the owning query's order; empty when ungrouped.
buckets [MetricBucket!]! Group by group, ascending buckets within each, zero-filled over every bucket the range touches.

NlReportSearch object

Result of `searchReportsNaturalLanguage` — the parsed interpretation plus the matching reports, so the caller sees both the answer and how the question was understood.

FieldTypeDescription
interpreted InterpretedReportQuery! —
reports [ReportHit!]! —

NodeAnalysis object

One taxonomy-node deep-dive result (analysis-node-deepdive). The frame-scoped sibling of `Analysis`, but at NODE granularity — a current row per (frame × taxonomy node × schemaVersion), so a UI can read exactly the L2/L3 leaves a user drilled into. Bitemporal, like `Analysis`.

FieldTypeDescription
id String! —
locationIds [String!]! —
eventTypes [String!]! —
needSectors [String!]! —
windowStart DateTime! —
windowEnd DateTime —
nodeKey String! Stable taxonomy slug path (`task/l1[/l2[/l3]]`) this row answers.
nodeName String! —
task String! —
level Int! Taxonomy depth: 1 = L1, 2 = L2, 3 = L3.
data JSON! The node's descriptive finding. Opaque + versioned by `schemaVersion`.
status String! Per-node generation status (e.g. `ok` / `best_effort`).
sourceReportIds [String!]! —
generatedByModel String! —
generationCostUsd Float —
generationInputTokens Int —
generationOutputTokens Int —
generatedAt DateTime! —
validFrom DateTime! —
validTo DateTime —
schemaVersion String! —

NominatimCacheEntry object

A cached Nominatim-protocol geocoder response.

FieldTypeDescription
id String! —
queryHash String! SHA-256 hex digest of `<endpoint>:<normalised_query>`.
query String! Raw query string (for debugging only).
endpoint String! The Nominatim endpoint that produced this response (e.g. 'search', 'reverse').
responseJson JSON! Raw JSON response from the geocoder.
status String! Lookup outcome: 'ok' / 'no_result' / 'error'.
fetchedAt DateTime! —
expiresAt DateTime! —

Notification object

FieldTypeDescription
id String! —
user User! —
message String! —
notificationType String! —
actionUrl String —
actionText String —
status NotificationStatus! —
emailNotificationStatus NotificationStatus —
smsNotificationStatus NotificationStatus —
createdAt DateTime! —
updatedAt DateTime! —

Organisation object

An organisation that owns teams and has members.

FieldTypeDescription
id String! —
name String! —
slug String! URL-friendly identifier.
isActive Boolean! Whether this organisation is active. Inactive organisations are hidden from non-admin users.
createdAt DateTime! When this organisation was created.
updatedAt DateTime! When this organisation was last updated.
teams [Team!]! Teams belonging to this organisation.
members [OrgMember!]! Members of this organisation.

OrganisationUser object

Links a user to an organisation with a role.

FieldTypeDescription
id String! —
userId String! —
organisationId String! —
role String! —

OrgMember object

Links a user to an organisation with an org-level role.

FieldTypeDescription
id String! —
user User! —
role String! Organisation-level role: org_admin or member.
createdAt DateTime! When this membership was created.

PipelineCountry object

A country the CLEAR pipeline publishes a Situation Analysis for, with the bounding box used to create its level-0 Country location. bbox order matches ensureCountryLocation: [minLng, minLat, maxLng, maxLat].

FieldTypeDescription
name String! —
iso3 String! ISO 3166-1 alpha-3 code (e.g. "SDN"). Used by pipeline ingests that scope external APIs by country (HAPI location_code, IOM DTM Admin0Pcode).
pcode String! The admin-0 location's pcode (ISO 3166-1 alpha-2, e.g. "SD"). The strong, name-independent key for resolving the country's level-0 location — the stored name is often the long official form, which exact-name lookup misses.
bbox [Float!]! —

PlaceAlias object

A spelling that CLEAR maps to a CLEAR location. CLEAR owns it: a GeoNames re-import never touches it.

FieldTypeDescription
id ID! —
nameNorm String! The spelling after the gazetteer's normalisation.
nameDisplay String! The spelling to show.
countryCode String! ISO-3166-1 alpha-2 (SD, VE, AF).
scopeLocationId String The area where the alias applies. Null means the whole country.
scopeLocation Location —
locationId String! The CLEAR location the spelling means.
location Location —
source PlaceAliasSource! —
createdById String Auth user id of whoever created the alias. Null for a seed.
createdByName String —
createdAt DateTime! —
updatedAt DateTime! —
note String —
canEdit Boolean! Whether the caller may change or delete this alias: a platform admin always, a team admin when the scope is inside their team's area.

PlaceAliasesPage object

FieldTypeDescription
items [PlaceAlias!]! —
totalCount Int! Aliases that match the filters, before paging.
hasMore Boolean! —
endCursor String Pass as `after` to read the next page. Null on the last page.

PlaceNameSuggestion object

A place that a queued name can mean.

FieldTypeDescription
kind PlaceNameSuggestionKind! —
geonamesId Int —
locationId String —
name String! —
level Int The level of a CLEAR location: 2 district, 4 landmark.
featureClass String GeoNames feature class (P populated place, A admin area, S spot, ...).
featureCode String —
latitude Float! —
longitude Float! —
score Float! 0 to 1: trigram similarity to the name, 1 for an exact match.
insideArea Boolean Whether the point is inside `withinLocationId`. Null without one.
distanceKm Float Kilometres from `withinLocationId` (0 inside it). Null without one.

PublicEvent object

The slim, unauthenticated view of an event used for share-link rendering. Deliberately a new type — not a slim wrapper around `Event` — so the field set is auditable in one place and field- selection can't accidentally leak signals, comments, alerts, or any other gated data through the public surface. Returned by the `publicEvent(eventId, token)` query when the Redis-cached snapshot for that token is still alive. Cache TTL defaults to 30 days; entries can be evicted earlier under memory pressure, in which case the link expires and the user has to request a new one.

FieldTypeDescription
id String! —
title String Localised event title (resolved to the canonical English text when the snapshot was taken — the public page is not locale-aware).
description String Localised event description (canonical English at snapshot time).
severity Float Severity score (1–5) at snapshot time.
validFrom DateTime! Window during which the event is considered valid.
validTo DateTime Event end / expiry. Null when no real end is known (not invented).
types [String!]! Disaster type codes (e.g. `fl`, `pa`). The frontend resolves these to display names via its own disaster-type catalogue.
primaryLocationName String Human-readable name of the event's primary location (general → origin → destination, first non-null).
primaryLocationCoords [Float!] `[lng, lat]` of the primary location's centroid when that location has a Point geometry. Null for polygon-only locations — the frontend hides the minimap in that case.
populationAffected String Stringified bigint (matches the authenticated `Event` field shape). Null when unknown.
populationDisplaced String —
signalPoints [PublicEventSignalPoint!]! `[lng, lat]` for every Point location attached to the event's constituent signals (origin / destination / general fields, deduped by location id). Polygon-only signal locations are omitted. Empty when no signals carry Point geometry — the frontend hides the markers list in that case.
locationPopulation String Population of the event's administrative area, resolved by walking the primary location's ancestor chain in A2 → A1 → A0 order (district → state → country) and picking the deepest non- null. Mirrors the fallback the in-app event page uses so the share card shows the same number. Stringified bigint; null when no level along the chain has a population. See also `locationPopulationLevel` and `locationPopulationName`.
locationPopulationLevel Int Level the population number came from: `2` (district), `1` (state), `0` (country). Null when `locationPopulation` is null.
locationPopulationName String Name of the location the population number is for (e.g. "South Darfur"). Null when `locationPopulation` is null. Lets the frontend label the figure with context — "Population of South Darfur" reads more honestly than a bare number when we fell back to a country-level figure.
locationIdp String Internally-displaced persons count for the event's admin area, sourced from `locationMetadata(type = "iom_dtm_displacement")`. Same A2 → A1 → A0 fallback as `locationPopulation`. Stringified bigint; null when no displacement metadata exists for any level.
locationIdpLevel Int Level the IDP number came from. Null when `locationIdp` is null.
locationIdpName String Name of the location the IDP figure is for. Null when `locationIdp` is null.
sharedAt DateTime! When the share link was minted.
expiresAt DateTime! Soft expiry — the Redis TTL the cached snapshot was written with. The frontend uses this to render "Link expires in N days".

PublicEventSignalPoint object

One Point location attached to one of the event's signals.

FieldTypeDescription
name String Display name of the location (e.g. "Al Fasher"). Often null for raw point-locations like "Point 15.62, 30.21".
lng Float! Geographic longitude.
lat Float! Geographic latitude.

RecipientList object

A named set of email addresses a Brief is sent to. Addresses need not belong to CLEAR users. Platform admins only.

FieldTypeDescription
id String! —
name String! Unique.
members [RecipientListMember!]! Every address on the list, unsubscribed ones included, by email.
recipientCount Int! Addresses a send would reach: members who haven't unsubscribed.
createdById String! —
createdAt DateTime! —
updatedAt DateTime! —

RecipientListMember object

One address on a Recipient list.

FieldTypeDescription
id String! —
listId String! —
email String! Lower-cased.
unsubscribedAt DateTime Set when the address followed the unsubscribe link in a Brief email. Sends skip it from then on.
createdAt DateTime! —

RefreshAggregatedDatapointsResult object

Summary counts from a `refreshAggregatedDatapoints` run.

FieldTypeDescription
computedBuckets Int! —
supersededBuckets Int! —
situationAnalysesInvalidated Int! Count of `situation_analyses` current rows that had their `validTo` stamped as a cascade of the yearly-country aggregation writes in this run. Zero means either no yearly buckets were touched or no situation-analysis snapshot existed yet for the affected countries.
schemaVersion String! —

ReportDatapoint object

One report's extracted structured datapoints. Keys inside `data` are the six domain names: `timing_and_scope`, `casualties`, `displacement`, `needs_and_funding`, `access_and_incidents`, `narrative_and_confidence`. A domain whose extraction failed is written as `null` - the operator can re-run a targeted extraction on that domain later without touching the successful ones.

FieldTypeDescription
id String! —
reportId String! —
reportTitle String! —
sourceUrl String! —
publishedAt DateTime! —
reportingPeriodStart DateTime Window the report CONTENT describes. Not the publication date.
reportingPeriodEnd DateTime —
locationIds [String!]! Resolved `locations.id` values, deduped.
locationPcodes [String!]! Raw pcodes the LLM emitted that the resolver couldn't tie to a CLEAR location. A nightly backfill re-attempts these.
eventTypes [String!]! Free-text event tags (`conflict`, `flood`, `displacement`, `disease-outbreak`, …). Multi-hazard reports carry multiple.
totalAffected Int Denormalised hot totals - cheap dashboard filter/sort keys. NULL when the report doesn't headline the figure; DO NOT sum these across rows (the JSON blob carries the incident-safe form).
totalDisplaced Int —
totalKilled Int —
data JSON! Exhaustive per-report payload. See the Pydantic sub-schemas in `datapoints_schemas.py` for shape.
schemaVersion String! Extraction schema version, e.g. `v1`. Rows with different versions must not be aggregated together.
extractedByModel String! LLM identifier that produced the extraction (e.g. `claude-sonnet-4-6`). Used by the reviewer-audit workflow.
extractedAt DateTime! —
sourceId String The report's publisher (a `data_sources` id), resolved by the pipeline via `resolveDataSource`. This is the report-level fallback; a figure's own cited origin lives per-figure inside `data`. See clear-pipeline ADR-0004.
source DataSource The resolved publisher, e.g. "IOM DTM" or "WFP". Exposed alongside `sourceId` so a client can label a report without a second round trip. **Null for rows extracted before source attribution landed (schema v1).** Those were never re-extracted, so clients must keep a fallback - deriving a publisher from the `sourceUrl` host yields the aggregator ("reliefweb.int"), not the publisher, so it is a label of last resort.

ReportFigure object

FieldTypeDescription
id String! —
reportId String! —
reportTitle String! —
sourceUrl String! —
pageNumber Int! 1-indexed source page.
bbox [Float!]! Source-page bounding box [x0, top, x1, bottom] in PDF points; empty on full-page fallback.
isFullPage Boolean! —
s3Key String! S3 key of the cropped image.
kind String! chart | map | table | infographic | photo (logos are dropped, not stored).
title String —
description String —
transcription JSON Structured transcription (rows / nested groups / callouts) from the vision pass.
sourceId String Publishing source (data_sources id) for attribution.
locationIds [String!]! —
locationPcodes [String!]! —
eventTypes [String!]! —
needSectors [String!]! —
timeRangeStart DateTime —
timeRangeEnd DateTime —
extractedByModel String! —
extractedAt DateTime! —

ReportFigureForMerge object

One captured figure that belongs in the KB but isn't merged yet — the work item for the figure→KB sync. Report-level fields (title/url/pdf key/date) come from the report's existing knowledgebase rows; the rest from `report_figures`. `transcription` is the raw FigureTranscription object; the caller flattens + embeds it to build the figure chunk.

FieldTypeDescription
reportId String! —
reportTitle String! —
sourceUrl String! —
reportS3Key String! The report PDF's S3 key (carried onto the figure chunk, same as text chunks).
publishedAt DateTime! —
teamId ID Team attribution from the report's KB rows, so the figure→KB sync stamps merged figures with the same team as the report's text. Null for the shared ReliefWeb corpus.
uploadedByUserId ID —
figureS3Key String! The cropped image's S3 key — becomes the chunk's `figureS3Key`.
figureKind String! —
pageNumber Int! —
title String —
transcription JSON —
locationIds [String!]! —
locationPcodes [String!]! —
eventTypes [String!]! —
needSectors [String!]! —
timeRangeStart DateTime —
timeRangeEnd DateTime —

ReportHit object

One report (not a chunk) matched by `searchReports` — the Cap 3 read model. Groups the knowledgebase by `reportId`: when a topical `query` is given, `score`/`snippet` come from the report's best-matching chunk; for a pure filter/date listing they're the report's head chunk and null score. `downloadUrl` is a presigned (1-hour) link to the full PDF.

FieldTypeDescription
reportId String! —
reportTitle String! —
sourceUrl String! —
publishedAt DateTime! Publication date — what date filters (`publishedRange`) and the recency listing order on.
s3Key String! S3 key of the source PDF (join/debug handle).
downloadUrl String! Presigned (1-hour) URL to download the full report PDF. Regenerated per request, so don't cache it past its expiry.
score Float Best chunk similarity for a topical query (larger = better); null for a pure filter/date listing (ordered by recency instead).
matchedChunks Int! How many of the report's chunks matched — a rough relevance-breadth signal. 1 for a pure recency listing (the head chunk).
snippet String! Excerpt from the best-matching chunk (topical) or the report's head chunk (listing) — a preview for the citation.

RotateDevUserApiKeyResult object

Result of the admin-only `rotateDevUserApiKey` mutation.

FieldTypeDescription
user User! The user whose key was rotated.
plaintextKey String! The fresh plaintext API key — same one-time-delivery rules as createDevUser.
notificationEmailSent Boolean! True when the rotation-notice email was successfully handed off.

Signal object

A source observation ingested from a data source or filed manually. Upstream source payloads are stored internally and are not returned on this type.

FieldTypeDescription
id String! —
source DataSource! The data source this signal was collected from.
status SignalStatus! Processing status for the pipeline drain (NEW until downstream runs).
processedAt DateTime When the downstream pipeline finished processing this signal (null while NEW).
contentHash String Fingerprint of the source's raw data, for sources whose records get revised in place (e.g. IDMC). Null for sources that never revise a signal after creation.
lastRevisedAt DateTime When the signal last had a content revision or retraction flip via updateSignalContent. Not set by the first contentHash seed. Null if never revised.
retracted Boolean! Superseded upstream. Reversible. A retracted signal keeps its event links but is excluded from event aggregates and the NEW drain queue.
revision Int! Count of effective changes via updateSignalContent. Compare-and-set token for markSignalsProcessed(items:).
rawS3Key String Pointer to the raw payload blob in the S3 data lake, when landed there.
externalId String Stable upstream identifier (e.g. "acled:{event_id_cnty}"). Used to deduplicate ingestion — (source, externalId) is unique.
publishedAt DateTime! —
collectedAt DateTime! —
url String —
title String —
description String —
severity Int Severity score (1–5). From data source or estimated by pipeline.
casualties Int Reported casualties for the signal. Sourced from ACLED's fatalities field; for some other feeds, parsed from the raw text via regex.
startDate DateTime Real-world event onset extracted from this signal by the shared event-classification LLM. Null when no onset was resolved.
startDateAccuracy DateAccuracy Precision of `startDate` (DAY = exact day; coarser = week/month/year).
endDate DateTime Real-world event close extracted from this signal. Null = ongoing/unknown.
endDateAccuracy DateAccuracy Precision of `endDate`.
magnitude Float Natural-hazard magnitude (e.g. 6.4). Null for non-disaster signals.
magnitudeUnit String Unit for `magnitude` (e.g. "Mw", "km/h"). Null when no magnitude.
actors [String!]! Named conflict actors extracted from this signal. Empty for non-conflict signals.
countries [Location!]! Countries the extracted event touches, resolved to admin-0 locations.
glideCode String Glide code the pipeline grouped this signal with. Null for signals grouped before it was recorded, or never grouped.
media [String!]! Media URLs (S3 keys for manual uploads, or source URLs for pipeline signals).
isDummy Boolean! Whether this is seed/demo data.
originLocation Location Origin location of the signal.
destinationLocation Location Destination location of the signal.
generalLocation Location General location (when no origin/destination).
events [Event!]! Events this signal is linked to.
feedbacks [UserFeedback!]! User feedback on this signal.
comments [UserComment!]! User comments on this signal.
locationChallenge SignalLocationChallenge Open Location challenge for this signal, if any (null when none).
locationCorrectedAt DateTime When a decided Location challenge last wrote this signal's location (a person corrected it); null when the location is the source's. Source revisions keep a corrected location.

SignalLocationChallenge object

An analyst's Location challenge on a Signal: why its location looks wrong, optionally with a corrected point, filed for one team. That team's admin or a platform admin decides it, even when they filed it. Accepting writes the proposed point onto the Signal, correcting writes a point the admin placed instead, and declining leaves the Signal as it is. A written point becomes the Signal's general location (its origin and destination are cleared and its countries follow), and later source revisions keep it. Which Event the Signal belongs to does not change. A Signal has at most one open challenge: filing a new one supersedes it.

FieldTypeDescription
id ID! —
signalId String! —
signal Signal! The challenged Signal.
teamId String The team it was filed for. Null on challenges filed before teams were recorded; a platform admin decides those.
team Team The team it was filed for, as an object: only for its members and platform admins, null for anyone else.
status String! "consideration" (open), "accepted" (the proposed point was written), "corrected" (the admin placed a different point), "declined", or "superseded" (replaced by a newer challenge on the same Signal).
note String Optional note explaining why the pin looks wrong.
proposedLng Float Proposed corrected point. Both lng and lat are set together, or both null (a bare challenge with no correction).
proposedLat Float —
proposedName String Optional label for the proposed point.
proposedPlacement Location The existing admin area the proposed point falls in (district, else state, else country). Null for a bare challenge, or a point outside the areas CLEAR covers.
previousLocation Location The Signal's location when the challenge was filed.
appliedLocation Location The point written onto the Signal, set when accepted or corrected.
createdBy String! Auth user id of whoever filed the challenge.
createdByName String Display name of whoever filed it.
createdAt DateTime! —
updatedAt DateTime! —
decidedBy String Auth user id of whoever decided it.
decidedAt DateTime When it was decided.
hasProposedPoint Boolean! True when proposedLng/proposedLat are both set.

SignalsPage object

FieldTypeDescription
items [Signal!]! —
totalCount Int! —
hasMore Boolean! —

SituationAnalysis object

One (country × year) situation-analysis snapshot. Cache read path — always current unless `asOf` is supplied for historical reads.

FieldTypeDescription
id String! —
countryLocationId String! FK to `locations.id` — the country (A0) this analysis covers.
windowStart DateTime! —
windowEnd DateTime! —
windowKind String! Granularity of the analysis window — `yearly` today. Part of the bucket key alongside `countryLocationId` and `windowStart`; `windowEnd` is a derived detail and is never matched on.
data JSON! Full analysis blob. Top-level keys: `datapoints`, `ai_summary`, `context_risks`, `hazards_and_vulnerabilities`, `displacement`, `sectors`, `sources`. LLM-generated components carry their own `source_report_ids` for per-component provenance.
sourceReportIds [String!]! Denormalised union of every contributing report id across all components. Same identity as the `report_id` on the underlying `knowledgebase` / `report_datapoints` rows.
aggregatedDatapointId String Aggregated-datapoints snapshot this analysis was generated against, when known. Null for early bootstrap runs.
generatedByModel String! LLM identifier (e.g. `claude-sonnet-4-6`). Deterministic-only Phase B runs record `deterministic:<version>`.
generationCostUsd Float Total LLM cost across all component calls. Null when the generator didn't track cost or the run was deterministic-only.
generatedAt DateTime! —
validFrom DateTime! Bitemporal validity — this snapshot's lifetime as a "current" row. `validTo` is null when the row is still the current one for its bucket; else it carries the timestamp when a newer regeneration superseded it.
validTo DateTime —
schemaVersion String! Bumped when the output taxonomy OR the prompt set changes. Different-version rows never mix on trend views.

StatsBucket object

FieldTypeDescription
key String! Bucket label — depends on groupBy: glide code, severity number as string, or ISO date/week/month.
count Int! —

StockFlowEstimate object

One metric's estimated current total (ADR-0006 §4): the latest authoritative stock plus the flows reported after its reference date T₀. Flows at or before T₀ are already embedded in the stock and are not added again - the invariant that stops returnee/IDP totals from over-counting.

FieldTypeDescription
total Float! `stock` + `flowsSince` - the headline estimated current total.
stock Float! The anchoring latest authoritative stock value (API-reconciled).
flowsSince Float! Deduped sum of the flows whose as-of date is strictly after T₀.
t0 DateTime! T₀ - the anchor stock's reference date. Flows at/before it are treated as already counted inside `stock`.
flowCount Int! Reports contributing forward flows - a provenance count, not a count of distinct flow events.

SyncEventCardsResult object

Result of `syncEventCards` — how many event cards were written vs skipped (an id that no longer resolves to an event).

FieldTypeDescription
synced Int! —
skipped Int! —

Task object

One unit of Worker-performed work (ADR-0010).

FieldTypeDescription
id String! —
kind String! The kind of work, e.g. `event.impact_prior.web` (the web search that proposes signals; the name is historical). A Worker claims by exact kind. One request fans out into one Task per enabled source kind. Older Tasks may carry the retired whole-prior kinds `event.impact_prior` and `event.impact_prior.clear`.
subjectType String! The subject's type, e.g. `event`.
subjectId String! The subject's id, e.g. an Event id.
payload JSON! Per-kind inputs, e.g. `{ "horizonYears": 10 }`.
status TaskStatus! —
origin TaskOrigin! —
requestId String! Shared by every Task one request fanned out into (one per source kind). The per-requester daily cap counts distinct requests, not Tasks.
requesterId String The user who requested it; null for origin `rule`.
requester User —
teamId String The view-scope team passed at request time (an authorisation hint, not an Event team — Events have none).
leaseOwnerId String The Worker (a service user) or person currently holding the lease.
leaseOwner User —
leaseExpiresAt DateTime When the current lease lapses. A heartbeat extends it by TASK_LEASE_MINUTES; past this instant the Task is claimable again.
leaseToken String Secret minted per claim. Returned only to the lease owner (null for everyone else); the Worker presents it on heartbeat, complete and fail. A new claim mints a new token, so a run whose lease lapsed and was reclaimed — even by the same Worker identity — can no longer write.
attempts Int! Times the Task has been claimed.
maxAttempts Int! Claims allowed before the Task is marked FAILED.
lastError String The last Worker-reported error. Visible to the requester and platform admins only; null for everyone else.
cancelRequestedAt DateTime Set when a LEASED Task was cancelled; the Worker learns at its next heartbeat or completion and stops.
cancelledById String —
outcome String Kind-specific result vocabulary. For `event.impact_prior.*`: `produced` or `no_prior_found`; for the web kind also `no_new_cases` (every case found was already proposed for the Event).
result JSON Raw Worker output, kept for audit. The typed result lives beside the subject (see `Event.caseProposals`).
model String Spend as the Worker reported it on completion.
inputTokens Int —
outputTokens Int —
costUsd Float —
completedAt DateTime —
createdAt DateTime! —
updatedAt DateTime! —

Team object

A team within an organisation, scoped to specific locations.

FieldTypeDescription
id String! —
name String! —
slug String! URL-friendly identifier, unique within the organisation.
description String —
organisation Organisation! The organisation this team belongs to.
members [TeamMember!]! Members of this team.
locations [Location!]! Locations this team is scoped to. Empty means global monitoring.
createdAt DateTime! —
updatedAt DateTime! —

TeamMember object

Links a user to a team with a team-level role.

FieldTypeDescription
id String! —
user User! —
role String! Team-level role: lead, analyst, or viewer.
createdAt DateTime! —

TranslationCoverage object

Per-(entity_type, locale) coverage snapshot used by the admin dashboard to see how much of the catalog has been translated. - canonicalCount: total entities of this type that *could* be translated (i.e. exist in the canonical table). - translatedCount: number with a row in the translations sidecar for this locale. The fraction translatedCount / canonicalCount is the live coverage for that (type, locale) cell — anything < 1.0 means the next read of one of the missing entities by a user on that locale will fall back to canonical English (and trigger the lazy-on-read enqueue, see utils/translation-loader.ts).

FieldTypeDescription
entityType String! —
locale String! —
canonicalCount Int! —
translatedCount Int! —

TranslationQueueItem object

A pending (re)translation request — the durable replacement for the lazy-on-read Celery enqueue. Drained by the Dagster translation consumer, which translates the entity at `locale` and writes it back via upsertTranslations (which clears the queue row).

FieldTypeDescription
id String! —
entityType String! 'event' | 'crisis' | 'location' | 'situationAnalysis' | 'analysis' | 'groundMessage'.
entityId String! —
locale String! BCP-47 locale (lowercased) to translate into.
enqueuedAt DateTime! —

TranslationRow object

A single translation row, returned by the admin/pipeline-only translations(entityType, entityId) query so the pipeline can compare stored source-hashes against the canonical row and decide which fields (if any) need re-translating.

FieldTypeDescription
locale String! —
data JSON! Translated payload, same shape as the canonical entity per type.
sourceHashes JSON Per-field SHA-256 hashes of the canonical English source that was used to produce `data`. Null on rows written before hashes were introduced — treat null as "all fields stale".
createdAt DateTime! —
updatedAt DateTime! —

UnresolvedPlaceName object

A place name, as written in a Signal, that geocoding could not place inside the Signal's area. One row per country, normalised spelling and state: the same village name in two states gives two rows.

FieldTypeDescription
id ID! —
nameNorm String! The spelling after the gazetteer's normalisation. Part of the row's key.
nameAsWritten String! The spelling in the first Signal that named it.
nameAr String The Arabic spelling from the Signal's text, when one was found.
countryCode String! ISO-3166-1 alpha-2 (SD, VE, AF).
stateLocationId String The state that holds the Signals' area. Null when the area is the country itself.
stateLocation Location —
countryLocationId String The country that holds the Signals' area.
status UnresolvedPlaceNameStatus! —
signalCount Int! The number of Signals recorded on the row. A Signal counts once.
firstSeenAt DateTime! —
lastSeenAt DateTime! —
resolvedById String Auth user id of whoever closed the row.
resolvedByName String Display name of whoever closed the row.
resolvedAt DateTime —
resolutionNote String —
placeAliasId String The alias that the resolution created.
placeAlias PlaceAlias —
signalsMoved Int! The number of its Signals that a resolution moved to the alias location.
signals [UnresolvedPlaceNameSignal!]! The Signals that named it, newest first.
first: Int — Max rows to return (1 to 50, default 5).

UnresolvedPlaceNameSignal object

One Signal that named an unresolved place name.

FieldTypeDescription
signalId String! —
signal Signal Null when the caller may not read the Signal.
areaLocationId String The area the pipeline chose for the Signal. Geocoding looked inside it.
areaLocation Location —
nameAsWritten String! The spelling in this Signal.
reason UnresolvedPlaceNameReason! —
seenAt DateTime! When the miss happened.
relocatedAt DateTime When a resolution moved the Signal to the alias location.

UnresolvedPlaceNamesPage object

FieldTypeDescription
items [UnresolvedPlaceName!]! —
totalCount Int! Rows that match the filters, before paging.
hasMore Boolean! —

UpsertAnalysisDatapointsResult object

Result of `upsertAnalysisDatapoints` — summary for logs.

FieldTypeDescription
analysisId String! —
schemaVersion String! —
createdOrReplaced Boolean! `true` when the mutation replaced a previously extracted row, `false` when it created the first row for the analysis.

UpsertAnalysisResult object

Summary of an `upsertAnalysis` mutation — whether it superseded a previous row, or was skipped by the 24h regeneration floor (ADR-0008).

FieldTypeDescription
analysisId String! The current analysis row for the frame after the call — the newly-created row, or (on a skip) the existing current row.
supersededPrevious Boolean! `true` when the mutation stamped `validTo` on a previous current row for the same frame, `false` when this was the first row or a skip.
skipped Boolean! `true` when the 24h floor made this a no-op (only `lastSyncedAt` was bumped, no new version written). `false` on an actual (re)generation.
reason String Why the write was skipped (e.g. `within-24h-floor`), else null.

UpsertKnowledgebaseResult object

Result of a knowledgebase upsert — summary counts for logging.

FieldTypeDescription
reportId String! —
chunksDeleted Int! —
chunksInserted Int! —

UpsertNodeAnalysesResult object

Summary of an `upsertNodeAnalyses` mutation.

FieldTypeDescription
upserted Int! Number of node rows written (one current row per input node).

UpsertReportDatapointsResult object

Result of `upsertReportDatapoints` - summary for logs.

FieldTypeDescription
reportId String! —
schemaVersion String! —
createdOrReplaced Boolean! `true` when the mutation replaced a previously extracted row, `false` when it created the first row for the report.

UpsertReportFiguresResult object

FieldTypeDescription
reportId String! —
count Int! Number of figures written.

UpsertSituationAnalysisResult object

Summary of an `upsertSituationAnalysis` mutation — reports whether the write superseded a previously-current row.

FieldTypeDescription
situationAnalysisId String! —
countryLocationId String! —
supersededPrevious Boolean! `true` when the mutation stamped `validTo` on a previous current row for the same bucket, `false` when this was the first row for the (country, window) tuple.

UpsertTranslationsResult object

Result of upserting one or more locale rows for a given entity. Carries the locales that were written so the caller (typically clear-pipeline) can confirm coverage without a follow-up read.

FieldTypeDescription
entityType String! —
entityId String! —
locales [String!]! —

User object

A registered user with role-based access. PII fields (`email`, `phoneNumber`, `role`, `isActive`) and the private relation set (`alerts`, `notifications`, `organisations`, `teamMemberships`, `feedbacks`, `comments`, `escalations`) are gated server-side: - PII: returned when caller IS the user, is a global admin, OR shares at least one organisation with the user. Otherwise null (PII) or empty array (private relations). - Private relations: returned only when caller IS the user OR is a global admin. Sharing an organisation does NOT grant access to another member's inbox / comment history. Schema makes these fields nullable so the gate can return null when the caller is not authorised, instead of throwing — a logged-in analyst browsing an event's comments shouldn't see a hard error on the commenter's email.

FieldTypeDescription
id String! —
email String —
name String! —
emailVerified Boolean! —
phoneNumber String —
image String —
role String Global user role: member, admin, or pending (plus system roles). Null when caller is not authorised to see this user's role. Note: analyst is now a TEAM role (see TeamMemberRole), not a global role.
isActive Boolean Null when caller is not authorised to see this field.
language String! Preferred UI language code (BCP-47 / ISO 639-1, e.g. "en", "ar"). Defaults to "en".
enableInAppNotification Boolean! —
enableEmailNotification Boolean! —
enableSMSNotification Boolean! —
analyticsOptOut Boolean Whether the user has opted out of usage analytics, account-wide. Readable only by the user themselves (null for everyone else, admins included). Set via `updateProfile`.
createdAt DateTime! —
updatedAt DateTime! —
alerts [UserAlert!]! Alerts received by this user. Empty for non-self / non-admin callers.
notifications [Notification!]! Empty for non-self / non-admin callers.
defaultTeam Team The user's default team (last selected). Null for non-self / non-admin callers.
organisations [OrganisationUser!]! Empty for non-self / non-admin callers.
teamMemberships [TeamMember!]! Empty for non-self / non-admin callers.
feedbacks [UserFeedback!]! Empty for non-self / non-admin callers.
comments [UserComment!]! Empty for non-self / non-admin callers.
escalations [EventEscalation!]! Empty for non-self / non-admin callers.

UserActivitySummary object

FieldTypeDescription
user User! —
total Int! —
counts ActivityCountsByAction! —

UserAlert object

Tracks an alert delivered to a user — view status.

FieldTypeDescription
id String! —
user User! —
alert Alert! —
viewedAt DateTime When the user viewed this alert.

UserComment object

A user comment on a signal, event, or crisis, with reply support.

FieldTypeDescription
id String! —
user User! —
event Event —
signal Signal —
crisis Crisis —
comment String! —
isCommentReply Boolean! Whether this comment is a reply to another comment.
repliedToCommentId String ID of the comment being replied to, if any.
tags [CommentTag!]! Users tagged in this comment.
createdAt DateTime! —
updatedAt DateTime! —

UserEngagementMetrics object

Point-in-time engagement summary derived from auth.login activity. All three windows are trailing from `asOf` (inclusive).

FieldTypeDescription
asOf DateTime! Reference moment the windows are anchored to. Defaults to NOW() when the caller doesn't specify it.
dau Int! Unique users with at least one login in the trailing 24 hours.
wau Int! Unique users with at least one login in the trailing 7 days.
mau Int! Unique users with at least one login in the trailing 30 days.
dauMauRatio Float! Stickiness ratio (DAU / MAU) as a percentage. Industry benchmark: ≥20% indicates a frequently-returning user base. Returns 0 when MAU is 0 so the field is safe to chart without null-handling.

UserFeedback object

User feedback on a signal, event, or crisis — rating and optional text.

FieldTypeDescription
id String! —
user User! —
event Event —
signal Signal —
crisis Crisis —
rating Int! Rating from 1 to 5.
text String Optional textual feedback.
createdAt DateTime! —
updatedAt DateTime! —

WebhookDelivery object

A single delivery attempt-sequence to one subscription for one incoming event. attemptNumber advances in place across retries.

FieldTypeDescription
id String! —
subscriptionId String! —
eventId String! GlitchTip's event/issue ID. Useful for correlating a delivery back to the source issue in GlitchTip.
eventType String! Event type extracted from the source payload (e.g. issue.new).
attemptNumber Int! 1-indexed. 1 = first attempt; up to 5 for retries.
responseStatus Int Last response HTTP status code, if the target responded.
responseBody String Truncated response body (max 8 KiB).
error String Network or transport error message, if the request never got a response.
succeededAt DateTime Non-null once a 2xx was received. Terminal state.
nextRetryAt DateTime Scheduled time of the next retry. Null when there is no next attempt (either succeeded, or exhausted 5 attempts = dead-lettered).
createdAt DateTime! —
status WebhookDeliveryStatus! One of: pending, succeeded, retrying, dead. Derived from the fields above so the admin UI doesn't need to reimplement the logic.

WebhookSubscription object

Outbound webhook subscription. Every incoming GlitchTip alert is fanned out to every active subscription whose event-type filter matches. Managed by platform admins.

FieldTypeDescription
id String! —
source String! Which trigger feeds this subscription: "glitchtip" (platform-admin GlitchTip alerts) or "clear_alert" (team-managed alert webhooks).
teamId String Owning team for a clear_alert subscription; null for platform-level glitchtip subscriptions.
alertTypeFilter [String!]! (clear_alert) Glide-code allowlist on the alert's event types. Empty = all types within the team's location scope.
minSeverity Int (clear_alert) Minimum alert severity (1-5). Null = all severities (including null-severity alerts). A set floor excludes null-severity alerts.
name String! Human-readable label shown in the admin UI. Not sent downstream.
targetUrl String! Target URL that receives HMAC-signed POST requests.
secret String HMAC-SHA256 shared secret used to sign outbound requests. Only returned on create + rotate; null on all other reads to keep the secret out of admin browser DevTools tabs. Rotate via rotateWebhookSubscriptionSecret.
active Boolean! Paused subscriptions are skipped during fan-out. Deliveries do NOT resume automatically when re-enabled — only new events fan out.
eventTypeFilter [String!]! Event-type allowlist. Empty = fire on all events. Values match GlitchTip's 'alias' field (e.g. issue.new, issue.regression, issue.resolved).
createdBy String User ID that created this subscription. Kept for audit.
createdAt DateTime! —
updatedAt DateTime! —
recentDeliveries [WebhookDelivery!]! Most-recent delivery attempts for this subscription. Ordered newest first. Capped at 50 in the resolver to keep the admin UI fast.