Publishing REST APIs through X-Road with OpenAPI: when providers need it
Choose X-Road when other organizations need to query an information system you operate and the exchange must be authenticated, logged and governed by agreed access rules. A direct connection leaves each consumer to handle its own authentication, logging and permissions, and it makes it harder for the provider to see who calls what. X-Road routes these calls through Security Servers that each member runs, so the provider's side of the exchange is configured and reviewed in one place. This section covers the provider's decision only. Consumer-side setup and the trust services behind X-Road are covered in other sections of this guide.
Publishing a REST service adds three things to the provider's Security Server: a registered service entry, an OpenAPI 3 description or a plain URL that tells the Security Server where the information system is reached, and access rights that decide which client members may call it. Each of these has an owner. The service owner should confirm which endpoints exist and which are meant for other organizations before anything is registered. The Security Server user roles, including Service Administrator and Security Officer, separate the work of maintaining services from the work of granting access, so confirm that split in the user guide before you assign people. Also confirm that the information system can be reached from the Security Server's internal network on the port you plan to use, either 8080 or 8443, and that a PostgreSQL database, local or managed, is available to the Security Server.
Plan for the decisions that come after the first registration. Endpoints change, and each change to the description or the target URL needs a deliberate update and a check that existing consumers still work. Access should follow the data sharing agreement with each consumer, so decide who signs that agreement and who removes access when it ends. Confirm your Security Server release before you commit: the current release is 7.8.3, with 7.7.4 and 7.6.5 also supported, and 7.8.0 is the last new-feature release of the 7 line. Check the X-Road releases page again before you choose a version, because support dates can change.
Every REST call leaves the consumer through its own Security Server
The flow starts in the consumer's information system, which sends its REST request to its own consumer Security Server, so the consumer never calls the provider directly. The two Security Servers exchange the message over TCP 5500, the message exchange port the installation guide lists for external networks. That exchange is the trust boundary between the two organizations. The provider Security Server then passes the request to the provider's information system, and the response returns along the same path. Confirm which port the provider side uses for its internal connection in your environment, and check that TCP 5500 is open between the two Security Servers.
Requests cross the trust boundary only between the two Security Servers on TCP 5500.
Publishing REST APIs with an OpenAPI 3 description or a plain URL: options compared
This table compares the two ways to add a REST service to X-Road: an OpenAPI 3 description that defines the endpoints, or a plain URL where the provider enters endpoints by hand. Read each row as a question the provider must answer before publishing. Choose the OpenAPI route when the API has a maintained contract that consumers build against, and confirm endpoint-level behavior for your X-Road version in the Security Server user guide before deciding.
| Decision point | OpenAPI 3 description | Plain URL |
|---|---|---|
| Provider preparation | A valid OpenAPI 3 description of the service, kept under version control and aligned with the running API | The service base URL and a list of the endpoints to expose, confirmed with the service owner |
| Endpoints after publishing | Endpoints follow the description, so changes start in the file and are then loaded into the Security Server | Each endpoint is added, changed or removed by hand in the Security Server |
| Per-endpoint access | Access rights attach to endpoints defined in the description; confirm the granularity for your version | Access rules follow the endpoint entries, so every entry needs a deliberate access decision; confirm for your version |
| What consumers can discover | The full contract, which consumers can retrieve through the getOpenAPI metaservice; confirm for your version | Only the endpoints the provider entered, with no full contract unless shared separately |
| Drift risk | The description and the running service can diverge, so review the file at each release | A hand-kept endpoint list can drift from the service, so compare it with the code at each release |
| Provider effort | Front-loaded: writing and reviewing the description before the service goes live | Lighter up front: entering a base URL and endpoints, with manual upkeep afterwards |
| Fits when | The API has many endpoints, a maintained contract and consumers who build against it | A small, stable API, or a legacy service with no description file to publish |
| Confirm before choosing | Endpoint-level behavior in the Security Server user guide for your X-Road version | The same check, including how endpoint entries and their access rights are stored |
Publishing REST APIs on a provider Security Server, step by step
This sequence takes a REST service from a running provider Security Server to a verified call from a consumer. Each step ends with a check you can run yourself, so you know the service is registered, exposed only on purpose, and reachable only by authorized clients. Use the Security Server user guide for exact menu paths in the version you installed.
Confirm the provider Security Server is running
The provider's infrastructure team checks that the Security Server is installed on Ubuntu Server 22.04 or 24.04 LTS on x86-64, or on Red Hat Enterprise Linux 8 or 9, with at least 3 GB RAM (4 GB with monitoring add-ons) and 3 GB free disk space. It needs PostgreSQL, either local or remote, including managed services such as AWS RDS or Azure Database for PostgreSQL. Confirm that TCP 5500 and 5577 are open from external networks and that TCP 4000 and 8080 or 8443 are open from internal networks. Done when the admin UI loads on port 4000 from the internal network and the server is registered in your X-Road instance.
Prepare the OpenAPI file or service URL
The API owner supplies either a finished OpenAPI 3 file that describes the paths, methods, parameters and responses, or the reachable URL of the service that the Security Server will forward requests to. Check that the file validates against the OpenAPI 3 specification and that every path matches the running application. Confirm that the service URL answers from the provider Security Server host itself. Remove or document any endpoint that must never be exposed, because each endpoint in the description can later receive its own access decision. Done when a test request from the Security Server host returns the status code the owner expects.
Register the REST service on the Security Server
A user with the Service Administrator role adds the service to the provider's client in the admin UI, either by uploading the OpenAPI 3 file or by entering the service URL. Follow the menu paths in the Security Server user guide, and give the service a clear service code, because consumers include it in their requests. Confirm that the target URL points to the information system. Done when the service appears under the correct provider client in the Security Server's list of services.
Review endpoints and their exposure
The API owner and the provider's security reviewer go through the endpoints the Security Server now lists and confirm that each one matches what the service is meant to expose. Disable or leave out administrative, debug and health endpoints that partners should not reach, and record the reason for each decision. Check that the HTTP methods and paths match the OpenAPI file, since a mismatch usually shows up later as failed calls. Done when the owner has signed off on the endpoint list and the excluded endpoints are documented.
Grant access rights to consumer clients
A user with the role that manages access rights grants each consumer client access to the service, and to specific endpoints where your setup uses per-endpoint access. Start with an internal test client and one partner client, so the first calls test grants that were made on purpose. Align each grant with the data sharing agreement and record who approved it. Done when the access list for the service shows the authorized clients and no others.
Call the service from a consumer Security Server
On the consumer side, the consumer's team sends a request for the published service through its own Security Server, using the service identifiers and the path from the OpenAPI description. The request reaches the provider's information system only after the provider Security Server accepts the authorized test client. Compare the response with the one the service returns when called directly on the provider side. Done when the authorized test client receives the expected response for that path.
Confirm an unauthorized client is refused
Repeat the call from a client that has no access right to the service, or from the test client after its access has been removed for this check. Confirm that the provider Security Server refuses the request and that the information system receives nothing from that client. Check the information system's own log to verify that no request arrived. Done when both the accepted call and the refused call are recorded, and the results are saved with the change record for the service.
Provider and consumer responsibilities for REST services
The provider is the organization that exposes the REST API. Its Security Server publishes the service, so the provider owns the description, the endpoints it exposes and the decision about which consumer subsystems may call each one. Agree the endpoint list in writing before anything is granted.
- Register and expose the Security Server: Install and register the Security Server using the platform, database and port settings in the installation guide. Make sure TCP 5500 and TCP 5577 (OCSP) are open to external networks, because consumer Security Servers need both.
- Add the service from an OpenAPI 3 file or URL: Upload the OpenAPI 3 description or point the Security Server at the URL where it is published. Check the description against the running API, because consumers will build their clients from it.
- Set access per endpoint: Enable only the endpoints that should be callable, then grant each consumer subsystem access to the endpoints it needs. A grant for one read operation does not cover write operations.
- Hand over identifiers and the description: Give each consumer the service identifier (instance, member class, member code, subsystem and service code), the service description, the OpenAPI file and the API version it covers.
- Assign roles for service and access tasks: Name the people who add services and who approve grants, using the roles in the user guide, such as Service Administrator. Confirm which role manages access rights in your version and record each approval.
Before go-live, confirm that a test consumer can call a granted endpoint and receives a refusal for an endpoint it was not granted.
The consumer is the organization that calls the API. Its applications never call the provider's Security Server directly. Each request goes to the consumer's own Security Server, which sends it across X-Road to the provider and returns the response. That Security Server holds the client subsystem, the access rights and the certificates that make the call trusted.
- Register a client subsystem: Your Security Server must have the client subsystem registered, and the provider must grant it access before any call succeeds. Confirm the subsystem identifier with the provider so the grant lands on the right one.
- Get the service identifier and description from the provider: Use the identifier exactly as supplied, including instance, member class, member code, subsystem and service code. Keep the OpenAPI file in your repository so developers work from the same endpoint list.
- Send requests to your own Security Server: Your information system calls the internal interface of its Security Server, which accepts information system traffic on TCP 8080 or 8443 from internal networks. Build request paths from the endpoints in the description, and confirm the REST request format in the user guide.
- Protect the internal leg: Decide whether the connection between your application and the Security Server uses HTTP or HTTPS, and how the application authenticates. Document the choice for your security team before go-live.
- Handle refusals and version changes: Treat a refusal as an access decision to raise with the provider, and do not retry it in a loop. Re-read the description when the provider announces a new API version.
Before you use the service in production, confirm that a test call through your own Security Server succeeds for an allowed endpoint and that your team knows how to read a refusal.
Managing endpoints and access per endpoint after publishing
Endpoint lists drift after publishing. The OpenAPI description is a snapshot of the API on the day it was added, but the provider's team keeps changing the backend afterward: operations are added, paths are retired, parameters are renamed and error responses change. Each change can leave the X-Road side out of step with the service, either exposing an endpoint nobody reviewed or still offering one the provider has already removed. After every backend release, the provider should review three things: which endpoints the published description exposes, which consumer clients may call each endpoint, and whether any endpoint was removed or renamed. Make that review a step in the release checklist, and record its outcome with the release notes so the next reviewer can see what changed and why.
A removed or renamed endpoint breaks every consumer still calling the old path, and those consumers often find out only when their requests start failing. Before a breaking change, the provider should identify which member and client call each affected endpoint, agree a cut-over date with them, and give them time to move to the new path. Where the backend allows it, keep the old and new endpoints running side by side during the transition, and remove the old one only after the consumers confirm they have switched. Keep a current list of who depends on which endpoint, because the access settings alone do not show which business process a client uses or who to contact when a change is planned.
Confirm the endpoint-level permission model in the X-Road user guide before you write a change procedure. Check how access to individual REST endpoints is set, which role manages it (the user guide defines a Service Administrator role among five roles), and whether permissions are granted per client or through groups. Then confirm whether a permission change, or a refreshed OpenAPI description, takes effect immediately for new requests or only after a configuration update reaches the other servers. Those answers determine whether you can cut off one client's access during an incident without a maintenance window, and how long a removed endpoint stays callable after you take it out of the description. Write the answers into your runbook against the X-Road version you tested.
Securing REST services at the endpoint and Security Server layers
Each REST service you publish depends on two components you operate: the Security Server that exposes it and the information system behind it. The cards below cover who can administer the Security Server, how admins sign in, how the server is hardened and how traffic to your information system is protected.
Security Server admin roles
The Security Server splits administration into roles, including Service Administrator, System Administrator and Security Officer. Service Administrators manage the services and access rules for your REST APIs, System Administrators manage server configuration, and the Security Officer handles keys, certificates and tokens. Give each role to a named person and avoid giving one account all three. Compare the assignments with the permission details in the user guide before you go live.
PAM login and LDAP groups
Admin users sign in through PAM, and PAM can use LDAP through SSSD, with LDAP groups mapped to X-Road roles. That mapping decides who receives each role, so review it with the same care as the role assignments. Confirm the group-to-role mapping against your directory, check that disabling a directory account removes Security Server access, and decide how admins sign in if the directory is unavailable. Test each path before relying on it.
Security Server user guideAllowed hostnames setting
The allowed-hostnames setting limits which host names the Security Server accepts, which helps guard against host header injection. A request with a forged Host header can otherwise reach logic that trusts the name it carries. Set it to the names your admins and tools actually use, then send a request with an unlisted name and confirm it is refused. Confirm the setting's location and format in the official documentation for your release before you change it.
Hardening guide baseline
The X-Road security hardening guidelines (version 0.6, dated 09.01.2025) set a baseline for Security Server hosts and admin access. They recommend locking an account for 15 minutes after 3 failed logins, using passwords of at least 16 characters, and requiring key-only SSH. Apply the same baseline to every Security Server you run, and ask your security team to sign off on each exception with its reason. Recheck the guide when you upgrade.
Hardening guidelinesInternal TLS to the information system
Traffic from your information system to the Security Server travels on the internal network, on TCP 8080 or 8443. Decide whether that leg uses HTTP or HTTPS, and if HTTPS, who issues the internal TLS certificate and whether client certificate authentication applies. Confirm which certificate authority the internal leg trusts, and set a renewal reminder before the certificate expires. Test the internal path after each certificate change.
Publish global configuration over HTTPS
Global configuration is the shared set of trust anchors and member data that every Security Server downloads. From version 7.4, it must be published over HTTPS. Before you add a REST service, confirm that the Central Server publishing your configuration and each Security Server you depend on run version 7.4 or later. Check the supported release lines on the X-Road releases page, since only 7.8.3, 7.7.4 and 7.6.5 are listed as supported.
X-Road releasesPublishing REST APIs through X-Road: questions buyers ask
How much does publishing a REST API through X-Road cost?
DeployOpen does not publish a price list, and the cost follows from a written scope that lists the services to publish. The main drivers are the number of services and endpoints, the quality of each OpenAPI file, how many access agreements must be drafted or confirmed, and how much consumer onboarding and testing is included. A single service with a clean description is a small, bounded piece of work. Each additional provider service, endpoint group or consumer adds review, configuration and test cycles. Ask any provider for a quote that separates one-time work (description cleanup, configuration, onboarding and test evidence) from recurring costs such as upgrades, monitoring and support retainers. Ask who pays for the consumer side of testing, and include your own team's time in any comparison, since it is easy to leave out.
Can our own team publish a REST API on X-Road without outside help?
Yes, a team with Security Server experience can usually publish one service with a clear API on its own, provided the description, access rules and a test consumer are ready. Effort rises quickly once several providers, many consumers or several environments are involved. Each new consumer needs its own access rights, a tested client path through its Security Server and agreed handling of errors and versions. Consider outside help when you are launching many services at once, when your consumers sit in other organizations with separate change processes, or when nobody on your team has run the installation and registration before. A useful test is whether your team can rehearse the full path in a non-production environment and document each step, because the same steps will repeat for every endpoint you add later.
What does our organization need to provide before publishing an API?
Your organization needs four things in place before work starts: named owners, current API documentation, a test consumer and a change process. Named owners should include a business owner who approves which data is shared and a technical owner who can answer questions about the service and its endpoints. The OpenAPI file, or the plain URL if you use that route, should match the running service and describe each endpoint, parameter and error response. A test consumer is a system that can call the service in a non-production environment, so access rules and client calls are verified before any partner depends on them. The change process should state how endpoint changes are announced, who approves them and how consumers are told to update. Gaps in these areas tend to move time from the build into discovery, which is where fixed scopes usually grow.
How long does it take to publish a REST API on X-Road?
Duration depends on scope, so ask for a written timeline tied to named deliverables and dates. DeployOpen agrees scope, deliverables and timelines in writing before work starts, and any other partner should do the same. The timeline should list the services and endpoints in scope, the state of each OpenAPI file, the access agreements that must be signed, the environments involved and the consumer testing you expect. Each of these has its own lead time, often set by people outside your team, such as a consumer's security or legal review. Ask which steps the timeline assumes you will complete and which the partner will complete, and what happens if an access agreement arrives late. Also ask how the timeline changes when a consumer requests additional endpoints after go-live. A timeline that cannot name its dependencies usually means the scope is still open.
Which X-Road version should we target for a new REST service?
Target 7.8.3, the current X-Road release, unless your ecosystem has agreed on another supported line. The supported versions are 7.8.3, 7.7.4 and 7.6.5, so a Security Server on any of those lines still receives support. Version 8.0.0 Beta 2 is available for testing only, and the production release of X-Road 8 is scheduled for December 2026, so do not place a beta in a production exchange. Before you choose a line, confirm compatibility between your Security Server and those of your consumers. Also confirm the upgrade path, since 7.8.0 is the last new-feature release of X-Road 7 and the length of maintenance beyond 2026 has not been decided. Check the X-Road releases page on the day you decide, because release status can change.
What makes an OpenAPI file ready for X-Road publication?
A ready file is a valid OpenAPI 3 description that matches the running service and is clear enough to be split into endpoints that can be granted separately. Check that every path, method, parameter, request body and response code in the file exists in the service, and that the schemas match what the service actually returns. Remove stale endpoints, since they can be confused with live services during access reviews. Give each operation a stable, descriptive identifier and a short summary, because consumers and access reviewers read those first. Include authentication requirements and error responses so consumers can handle failures without contacting you. Validate the file with an OpenAPI linter in your pipeline and test it against a staging instance. If you only have a plain URL, expect more manual work to write the description. Confirm the validation and file handling rules for your X-Road version before you start.
What to confirm before publishing REST APIs on X-Road
Each item below is a check you run in your own environment, on the release you plan to deploy, rather than a claim about what the product does. Together they cover the API contract, the authentication path, the database, the host sizing and the release timing that will shape the service after go-live.
Confirm each OpenAPI 3 feature
Your OpenAPI 3 description is the contract consumers build against, so every feature it uses must be handled the way the user guide describes. List the schema, parameter and response constructs your description relies on, then import the exact file into a test Security Server on the version you plan to run. Compare the published paths and methods with what your API actually serves. Any construct that is skipped or interpreted differently should be fixed in the description or documented as a limitation before consumers start.
Security Server user guideTest the provider's authentication scheme
Your API may authenticate callers with API keys, bearer tokens, client certificates or another scheme, and the Security Server sits in front of every call. Confirm which headers and credentials it forwards to your information system, and what a consumer receives when a credential is missing, wrong or revoked. Run each case from a consumer Security Server in a test environment. Record the results, because the behavior depends on your Security Server version and on how the service is registered.
Size PostgreSQL for the new service
The Security Server requires PostgreSQL, either local or remote, including managed services such as AWS RDS and Azure Database for PostgreSQL. Decide whether the database runs on the server or as a managed instance, and confirm that your firewall rules allow the network path from the Security Server to it. Ask the database owner for storage headroom, connection limits, backup and restore timing and patch windows, then compare them with the number of services and consumers you expect. Test with realistic traffic before go-live.
Check RAM and disk minimums
The Security Server needs at least 3 GB RAM, 4 GB with monitoring add-ons, and 3 GB of free disk space. Confirm the host meets these figures before you add the service, because a host sized only for current traffic may not have room for monitoring agents or growing logs. Confirm the operating system is one the installation guide lists: Ubuntu Server 22.04 or 24.04 LTS on x86-64, or Red Hat Enterprise Linux 8 or 9. Check the figures against the release you deploy, since requirements can change between versions.
Installation guidePlan around X-Road 8 timing
X-Road 7.8.3 is the current release, and 7.8.0 was the last new-feature release of the 7 line. NIIS intends to maintain 7 with bug fixes and security patches beyond 2026, but has not decided how long that period will be. X-Road 8 "Spaceship" is available for testing as 8.0.0 Beta 2, with production scheduled for December 2026. Decide whether this service is a long-term 7.x commitment or one that needs a migration plan, and confirm the current schedule on the releases page before you commit.
X-Road releasesHow DeployOpen scopes REST API publishing on X-Road
DeployOpen scopes REST API publishing on X-Road as a fixed-scope piece of work, agreed in writing before any work starts. We map each API to its provider Security Server, its OpenAPI description or plain URL, and the consumers who need access, so the published surface is clear before anything is configured. Work runs inside your own infrastructure, on the Security Server and information systems you already operate.
How we scope
- The written scope lists each REST service, its OpenAPI 3 description or plain URL, and the endpoints to publish.
- Access is defined per endpoint, with the consumer organizations and access groups that will call each one.
- We confirm which supported X-Road release (7.8.3, 7.7.4 or 7.6.5) each Security Server runs before setup begins.
How we build
- Provider side: register the service on the provider Security Server from an OpenAPI 3 description or plain URL.
- Consumer side: confirm each consuming Security Server can reach the provider's message exchange port, TCP 5500, from external networks.
- Test each endpoint with an allowed and a denied client, and record the results before handover.
How we hand over
- Deliverables include the configured service registration, the endpoint and access matrix, and runbook notes for the provider team.
- Consumers receive a guide to calling the service through their own Security Server, with the endpoint paths.
- Operating notes cover where the OpenAPI description is stored, how changes are refreshed, and who approves access changes.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- NIIS has not yet set how long X-Road 7 is maintained, so confirm the period before planning upgrades.
- Changes to endpoints or consumers are scoped in writing before they are applied.

