Reading Decidim data with the GraphQL API

Pulling Decidim processes, proposals, meetings and budgets into other systems through the public GraphQL API, with the authentication, escaping and rate limit decisions that shape the build.

On this page

Reading Decidim data with the GraphQL API for downstream systems

A reporting, data or partner system often needs current participation data from Decidim without someone exporting files by hand. Decidim exposes a GraphQL API that reads processes, proposals, meetings and budgets, so the integration is a read-only pull that your team designs, scopes and tests before anything depends on it. The API is the supported method for this kind of read access, and the instance documentation is the authoritative schema reference for your own installation. Start there, not from examples copied from another city's deployment, because the fields available depend on which components your organization has enabled and on the version you run.

Before writing queries, confirm three things with your Decidim administrators. First, check the schema exposed by your instance's API documentation and map each downstream field to a concrete GraphQL field, noting which ones are nested under a component or space. Second, decide whether the endpoint should be public or protected: the DECIDIM_API_FORCE_API_AUTHENTICATION setting, which defaults to false, requires authentication to use the endpoint, and your data owners should decide that setting explicitly rather than inherit the default. Third, plan for pagination and rate limits by asking the platform team for the current limits in your version, then testing a full extraction against a staging copy so you know how long a complete pull takes.

What the GraphQL integration needs before the first query

Before the consuming system sends a single request, the team needs to know which Decidim branch the instance runs, where its API lives, whether anonymous reads are allowed, and which network paths are open. Each card below covers one of these prerequisites, and each one should be confirmed on your own instance rather than assumed from this page.

Confirm the Decidim version

Decidim's security support covers only the last two minor versions until version 1.0, which means the 0.32.x and 0.31.x branches today. Check the running version on your instance before you build against its schema, because the GraphQL types and fields can differ between minor releases. If the instance runs 0.30.x or earlier, plan the upgrade first, since the query you write may break on the first update. Ask your platform owner for the exact version string, not a branch label.

Decidim security policy

Record the instance URL and endpoint

Every Decidim organization is served from its own hostname, so the consuming system must point at the exact instance and API path that your team operates. Do not reuse a URL copied from a public example or a different organization on the same platform. Confirm the endpoint path and the schema against your instance's own API documentation, since defaults and the documented routes can vary with configuration and version. Store the base URL in configuration, not in query code.

Decidim API docs

Decide on forced authentication

By default, the DECIDIM_API_FORCE_API_AUTHENTICATION setting is false, so anonymous clients can call the endpoint. If your organization sets it to true, every request must carry valid credentials, and the consuming system needs a machine account or token issued for that purpose. Agree with the platform owner which setting applies to your instance and whether public reads are expected. Document the decision, since it determines what your integration can read without a secret.

Decidim environment variables

Plan the credential lifecycle

Whatever credential the integration uses should belong to a named service identity with the narrowest access that answers the query. Store it in your secrets manager, not in source code or shared spreadsheets, and set an owner who rotates it. Plan for revocation when a team member leaves or the integration is retired. If you later need write operations, treat them as a separate credential with its own review, because a read-only pipeline should not carry mutation rights.

Map outbound network rules

The system that calls the API needs an outbound route to the Decidim hostname over HTTPS, and the firewall, proxy or egress policy of your network must allow it. Ask the platform owner whether the instance sits behind a web application firewall or rate limiting layer that could block your server's address. Test from the same subnet and runtime that will run the job, not from a laptop. Record the source addresses so the platform team can allow them and audit the traffic.

Agree on the response handling

API responses can include HTML that has not been escaped, as the API documentation warns, so the consuming system must not render field values directly into a page or report. Decide which fields carry rich text, then sanitize or escape them at the point of display. Also agree who owns the schema change process, because a field rename in a new Decidim release should trigger a test failure in your pipeline, not a silent gap in your dashboard.

API documentation

How to configure and test a read-only GraphQL pull

This sequence takes a team from the instance's own API documentation to a tested, paginated read-only query that pulls processes, proposals, meetings and budgets into another system. The result is a set of queries that run against staging and return data the team has checked against the admin panel.

  1. Confirm the instance API documentation

    Start by opening the API documentation for your own Decidim instance rather than relying on generic examples, since the schema reflects the version and components you run. The integration owner, with a developer who knows the Decidim version in use, lists the types needed for processes, proposals, meetings and budgets and notes which fields they expect. The step is complete when the team can point to the exact types and fields it will query and has recorded the Decidim version from the staging environment.

  2. Decide on forced API authentication

    Check whether DECIDIM_API_FORCE_API_AUTHENTICATION is set in the staging and production environment files. Its default is false, which means the API endpoint answers without credentials, so public participation data is readable by anyone. Set it to true if the operator wants every request authenticated, and record the decision with the security owner because it changes how the consuming system must be configured. The check is a written note stating the value in each environment and the reason for it.

  3. Create credentials if authentication is required

    If forced authentication is enabled, create the credentials the consuming system will use, following the access method described in the instance API documentation. Store them in the consuming system's secrets manager, not in query files or source control, and limit them to the read scope the pull needs. The platform team confirms the credentials work with a single test request on staging. The step closes when that request returns data and an unauthenticated request is refused.

  4. Build queries for each data type

    Write one query per data type, covering processes, proposals, meetings and budgets, and request only the fields the downstream system needs. Treat any text field returned from the API as possibly containing unescaped HTML, and sanitize or escape it before rendering in a dashboard or web page. Keep queries read-only and store them in version control with a note on the Decidim version they were tested against. The check is that each query runs on staging without errors and returns the fields named in the requirements.

  5. Paginate results and handle limits

    Add cursor or page handling to each query so the consuming system reads large lists in full instead of truncating at the first page. Confirm the rate limits that apply to the instance with the operator, then set the request frequency and retry behavior to stay within them. Log throttled responses so the team can see when the schedule needs adjusting. The check is a complete page-by-page pull of one large data type, with the total count matching the count shown in the admin panel.

  6. Test the pull against staging

    Run the full set of queries against the staging instance and compare the results with known data. For example, a query for processes should return the same number of processes the staging admin panel lists for the same filters (illustrative). Check that unpublished or private content is not returned to an unauthenticated consumer, and that escaped text displays correctly downstream. The step is complete when the results match the expected counts and content, and the test notes are filed with the integration record.

  7. Record the configuration before production

    Write down the Decidim version, the authentication setting, the credential owner, the query files, the pagination approach and the schedule. The integration owner signs off the record and the security owner confirms the authentication decision is documented. Ask the operator which rate limits apply in production, since staging may differ. The step closes when the record exists in version control and the production change is approved against it.

When to force API authentication and what changes for consumers

Set DECIDIM_API_FORCE_API_AUTHENTICATION to true when the instance should not serve its participation data to anonymous callers. The default is false, so a fresh Decidim instance answers GraphQL queries without credentials. Turning the setting on requires every request to the API endpoint to authenticate, which means anonymous reads of processes, proposals, meetings and budgets stop working. Any dashboard, script or partner system that pulls data without a token will start receiving refusals after the change, so inventory those consumers before you flip the variable in production. Confirm the exact behavior on your Decidim version against the Decidim environment variables documentation, and test it in staging first.

The choice is a trade-off between open access and controlled access. Leaving the default in place suits public open data use, where journalists, researchers and civic developers read published results without an account. Forcing authentication suits internal dashboards and partner systems that handle unpublished drafts, participant-facing contact details or data that a governance team has not yet released. Authentication does not make the data private on its own, because the authenticated user's permissions still decide what they can see. Ask the platform owner which content is meant to be public, and check that the consuming system's account only has the read access it needs.

The consuming system then owns credential handling. It must store API credentials in a secrets manager or encrypted configuration, never in source code or shared spreadsheets, and restrict which services can read them. Plan a rotation schedule and a documented procedure for revoking a credential when a system is retired or an engineer leaves. Log the calling identity and watch for failed authentication, since a rising count of refusals may signal a broken integration or a leaked token. Also keep the HTML caveat in mind: the API docs warn that responses may contain unescaped HTML, so authentication does not remove the need to sanitize fields before display. Confirm how your chosen Decidim version issues and scopes tokens with the Decidim API documentation.

How Decidim objects map to fields in the receiving system

This table pairs each Decidim object (processes, proposals, meetings and budgets) with the identifiers, timestamps, state, component and organization fields the receiving system usually keeps. Field names are illustrative until the team confirms them against the instance schema, which can differ by version and by enabled components. The main takeaway is that the composite key, locale and organization scope need explicit decisions before the first sync.

Decidim objectFields to keepMapping decisionConfirm before build
ProcessesId, slug, title, published state, start and end dates, parent spaceStore the Decidim id as the stable key and the slug only as a display valueField names and whether processes are exposed through the schema in your version
ProposalsId, title, body, state, created and updated timestamps, component id, author referenceKey proposals by component id plus proposal id, since ids are unique per instanceWhether withdrawn or hidden proposals are returned and how your team filters them
MeetingsId, title, start and end times, time zone, component id, registration settingsStore timestamps in UTC and keep the time zone field as received for displayHow the API exposes time zone information and whether it applies to every meeting
BudgetsId, title, total budget, projects, voting state, component idTreat budget projects as child rows linked to the parent budgetWhich budget fields are public and which need an authenticated request
OrganizationOrganization id or host, default locale, space scopeAdd an organization column to every table so multi-organization data never mergesWhether one API endpoint serves several organizations or each needs its own
Localized textTitle and body per localeChoose one storage model: one row per locale, or one column per locale with a fallback ruleWhich locales each organization publishes and the fallback order your reports expect
Rich text and HTMLBody fields that may contain markupSanitize or escape on ingestion, since responses may include unescaped HTMLWhether your target system renders HTML or stores plain text
Sync stateLast synced timestamp, source updated timestamp, deleted flagUse the source updated timestamp for incremental pulls and keep soft deletes for removed objectsWhether the API exposes deletions, which often needs a separate reconciliation pass

Handling unescaped HTML and rate limits in responses

The API documentation warns that responses may include HTML that has not been escaped. Titles, bodies and descriptions are written by participants, moderators and administrators, so any of these fields can carry markup that your dashboard or portal did not expect. If a consuming application inserts those strings into a page as HTML, a crafted proposal can run script in a viewer's browser or break the layout of an embedded widget. The data leaves Decidim as text, so the consuming application is responsible for making it safe to display.

  • Stored content: Participant-submitted text reaches your system in the form it was saved, so treat every text field as untrusted input.
  • Embedded views: Pages that show Decidim data in iframes or internal tools inherit the same risk in a different context.
  • Export copies: Anything cached, exported to CSV or loaded into a data warehouse keeps the markup until someone removes it.
  • Downstream readers: Search indexes, email templates and chat notifications may render the string in ways you did not test.

Before you connect the first view, list which fields each query returns and where each one is displayed.

Securing the GraphQL integration

A GraphQL integration reads participant-facing data, so its risk sits in who can call the endpoint, what credentials it holds, and what the responses contain. The cards below cover the controls the instance configuration supports and the checks to run with your Decidim administrators before the integration goes live.

Force API authentication

By default the API endpoint answers without credentials. Setting DECIDIM_API_FORCE_API_AUTHENTICATION changes that so every call must authenticate. Turn it on for any instance that holds non-public processes, unpublished proposals or private spaces, then test an anonymous request and confirm it is refused. Ask your administrators whether the setting also applies to any public exports you plan to use.

Default setting
false
Environment variables

Store and rotate credentials

The integration's token or OAuth credentials should live in your secrets manager or the platform's environment configuration, never in source code, chat logs or dashboard definitions. Record which account owns each credential, when it was issued and who can read it. Rotate on a schedule you set and on any staff change, and confirm with your administrators how credentials are revoked in the admin panel.

Grant least-privilege read access

Use a dedicated machine account for the integration rather than an administrator's personal login. Scope it to the spaces and data the downstream system needs. Because a single account may see more than the target report needs, review what it can read in each process and component, and ask your administrators which role and permission combinations the instance supports for API reads.

Sanitize HTML in responses

The API documentation warns that responses may contain HTML that has not been escaped. Any consumer that renders proposal titles, descriptions or meeting text in a web page must escape or sanitize that content first. Add a test that sends a script-containing value through the pipeline, so the check runs on every change to the integration rather than once at design time.

API documentation

Keep personal data out of logs

Participant names, email addresses and free-text comments can appear in query results. Configure the integration's logging to record query names, status codes and timings but not response bodies or author fields. Check how your log platform retains and indexes these entries, and confirm with your administrators which fields the API returns for authors before you enable request logging.

Restrict network paths

Limit which hosts can reach the GraphQL endpoint, typically to the integration's servers and your monitoring tools, using firewall rules, a reverse proxy allowlist or private networking. Keep the admin interface on a separate path. Ask your infrastructure team to confirm the rate limits your deployment applies, since the instance settings and any proxy in front of it determine how many requests a single client can make.

Common GraphQL pull failures and their fixes

This table lists the failures teams most often hit when pulling Decidim data through the GraphQL API, with the cause and fix for each. Read it as a checklist: match the symptom you see, then confirm the setting or version on your instance before changing code.

FailureLikely causeFix
Requests rejected with an authentication errorDECIDIM_API_FORCE_API_AUTHENTICATION is enabled, so anonymous queries no longer reach the endpointSend a valid token with each request, or confirm with the owner that anonymous access is intentionally off before rewriting the client
HTML breaks a template or shows raw markupAPI responses can include HTML that has not been escaped, and the client inserts it directly into a pageSanitize or escape field content in your own code before rendering, and never trust rich text fields as plain text
Throttled responses during bulk pullsA large export sends many requests in a short window and hits the instance's rate limitSlow the request rate, add retry with backoff, and schedule full pulls outside peak participation periods
Missing records in a paginated pullThe client stops at the first page, or the cursor logic skips records when items change during the pullFollow the end cursor until no further pages exist, and compare record counts against the instance before accepting the dataset
Queries fail after an upgradeA new minor version changed the GraphQL schema, such as renamed fields or removed argumentsIntrospect the schema after each upgrade, update queries, and test them against staging before production
Different results between staging and productionThe two environments run different Decidim versions or different configuration, so the schema and data differPin both to the same release line, record the version of each environment, and check configuration flags such as the authentication setting

Questions buyers ask before connecting Decidim to a GraphQL consumer

What drives the cost of pulling Decidim data through the GraphQL API?

The cost follows the number of data types, the volume of records, how much sanitization the consumer needs and how the API is authenticated. Each data type you pull (processes, proposals, meetings, budgets) needs its own query design, field selection, pagination handling and test cases. Volume matters because large result sets need paging and retry logic that a small export never does. Sanitization matters because the API documentation warns that responses may include HTML that has not been escaped, so your consumer must escape or strip that content before it reaches a dashboard or web page. Authentication adds work when you force it on. Ask any provider for a quote that lists each data type, the expected record volume, the rendering path for text fields, and the authentication model. Those four items explain most of the difference between two quotes.

How long does it take to get a working pull from Decidim?

The time depends on how many data types you need, whether the target environment already has a consumer for this kind of data, and how quickly your Decidim administrators can confirm the instance settings. A single read-only pull of one data type on a test instance is a smaller job than a production feed covering processes, proposals, meetings and budgets with sanitization and monitoring. Delays usually come from access approvals, from confirming which components are enabled on each organization, and from testing against real content rather than sample data. No duration is set here because none has been researched for this work. Ask for a written schedule that separates a staging pull from production cut-over, and confirm which milestones depend on your administrators.

What does the work need from our Decidim administrators?

Your Decidim administrators need to confirm the instance URL and version, the organizations and spaces whose data should be included, and which components hold the content you want to read. They also need to decide whether the API endpoint must require authentication, which is controlled by the environment variable DECIDIM_API_FORCE_API_AUTHENTICATION (default false). If you enable it, the consumer needs a credential that the administrators issue and can revoke. They should also confirm which content is public before a feed goes live, since unpublished or hidden items should not reach outside systems. Plan for a named contact who can answer questions about component settings during build and test.

Can an internal team connect Decidim to a GraphQL consumer on its own?

Yes, a team with experience in Rails or in GraphQL clients can read the public API documentation and build a consumer, provided it has the time and the review capacity. The tasks that most often need outside help are the sanitization rules for unescaped HTML, planning for upgrades that change the schema, and designing authentication if you force it on. Internal teams also tend to underestimate testing across organizations and components. Compare the cost of your staff's time with the cost of a fixed-scope engagement, and include the ongoing work of monitoring the feed after launch. The API documentation is the starting point for your team's own build.

How does a fixed-scope DeployOpen engagement get agreed in writing?

Most DeployOpen engagements are fixed-scope, which means the scope, deliverables and timelines are agreed in writing before work starts. For this topic, the written scope would normally list the data types to pull, the organizations and components covered, the sanitization approach for text fields, the authentication model, the test and handover steps, and what your administrators must provide. A quote follows from that written scope, because DeployOpen does not publish a price list. Ask for the scope to name what is excluded, such as writing back to Decidim or building dashboards, so that later changes can be priced separately. Ongoing support, upgrades and continuous testing are available as retainers and should be quoted as a separate agreement.

What changes when Decidim is upgraded and the consumer is already live?

Upgrades change the exposure of a live consumer, so the consumer should be tested against each new version before it goes into production. Decidim's update guidance says to move one minor version at a time and follow each release's upgrade instructions, because some releases change database structures. The release history includes version 0.32.0, released on July 6, 2026, and the project supports only the last two minor versions with security updates, currently 0.32.x and 0.31.x. Ask whether the consumer's queries and field handling were tested on the target version, and who owns the retest after each upgrade. A consumer without an owner tends to break silently when a field changes.

What should we check before a consumer reads Decidim data in production?

Check four things before production. First, confirm that every text field rendered in your dashboard or site is escaped or sanitized, since the API documentation warns that responses may include HTML that has not been escaped. Second, confirm the authentication setting and the credential handling, including how tokens are stored and rotated. Third, confirm that the consumer respects the API's rate limits and pages through large results instead of requesting everything at once. Fourth, confirm that only published, public content is pulled. Write these checks into the acceptance test so that the handover has evidence, not just a working demo. The sources for these settings are the Decidim environment variables and API documentation.

Does this work help us prepare for a compliance or security review?

It helps, but it does not produce a compliance outcome by itself. DeployOpen prepares systems, controls and evidence for compliance assessments, and it does not issue audit reports, attestations or certifications. For a consumer, useful evidence includes the documented data types, the authentication configuration, sanitization tests, access logs for the credential, and the upgrade test records. Independent auditors and certification bodies decide whether those controls meet a given requirement. Ask your assessor early which evidence they expect from an external data feed, so the build can produce it.

How the consuming system pulls data from Decidim

The flow starts in the consuming system, which sends a GraphQL query with its credentials over HTTPS to the Decidim API on the instance. Decidim returns paginated JSON, and that response crosses the trust boundary into the consumer, where it should be sanitized before storage or display. Check that the credentials are scoped to the data needed, that the consumer treats HTML fields in responses as untrusted, and that pagination is followed to completion before results are served to users.

Data crosses the trust boundary as paginated JSON and is sanitized before the consumer stores it.

How DeployOpen scopes and supports a Decidim API integration

DeployOpen plans and delivers read-only GraphQL integrations for Decidim inside the client's own infrastructure, starting from a written scope. The work covers the query design, the data handling and access controls around the API, and the documentation the client's team needs to run the integration after handover.

How we scope

  • The written scope lists which spaces, components and fields the integration reads, such as processes, proposals, meetings and budgets.
  • Scope records whether the API endpoint must require authentication, using the DECIDIM_API_FORCE_API_AUTHENTICATION setting, and who holds the credentials.
  • Scope defines how unescaped HTML in responses is sanitized before any downstream system displays or stores the text.

How we build

  • We build the queries, pagination and retry logic against the instance's own API documentation, then confirm the rate limits that apply to your deployment.
  • We test the integration on a staging copy of the instance, checking field coverage, large result sets and behavior with unpublished or hidden content.
  • We configure the consuming system's storage, logging and access controls so exported participation data is governed like any other sensitive dataset.

How we hand over

  • Handover includes the query library, configuration notes, sanitization rules and a record of the endpoint settings used in each environment.
  • Documentation explains how to change queries when Decidim releases a new minor version, with the upgrade sequence your team will follow.
  • Your team receives a walkthrough of monitoring, error handling and the steps to rotate API credentials.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and continuous testing are available as a retainer, which can cover queries after each Decidim upgrade.
  • Ask any partner to confirm in the quote which costs are one-time build effort and which are recurring support, hosting and retainer fees.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.