Skip to main content

Version: latest

Services and Routes

Services and Routes are the fundamental building blocks for traffic routing in API7 Gateway. Together, they define how the gateway matches incoming requests and where it proxies them.

Service

A Service is a logical grouping of routes that share common backend (Upstream) and plugin configurations. In a microservices architecture, a Service typically represents a single business capability or microservice (e.g., "User Service" or "Payment Service").

Key fields

FieldTypeRequiredDescription
namestringYesUnique name for the service. Max 100 characters.
typestringNohttp (default) or stream.
hostsarrayNoList of domain names the service accepts. Max 32 items.
path_prefixstringNoThe listening path prefix. Must start with /.
strip_path_prefixbooleanNoIf true (default), the path_prefix is removed before proxying to the upstream.
upstreamobjectNoBackend target configuration.
pluginsobjectNoPlugins applied to all routes in this service.

Route

A Route defines specific matching rules (URI, HTTP method, host) for incoming requests within a Service. When a request matches a Route, the gateway applies the defined policies and proxies the request to the Service's Upstream.

Key fields

FieldTypeRequiredDescription
namestringYesUnique name for the route.
pathsarrayYesList of URL paths (after path_prefix) to match. Max 64 items. Each must start with /.
methodsarrayNoAllowed HTTP methods (e.g., GET, POST). If empty, all methods are allowed.
varsarrayNoAdvanced matching rules using API7 Expressions.
priorityintegerNoMatching priority. Higher values win. Default is 0.
enable_websocketbooleanNoEnables WebSocket proxying for the route.
pluginsobjectNoPlugins specific to this route.

Request flow

The following diagram shows how a request flows through Routes and Services to the backend:

Enterprise vs. open source workflow

In API7 Enterprise, configuration changes follow a controlled lifecycle to ensure stability and auditability.

FeatureOpen Source APISIXAPI7 Enterprise
PersistenceImmediate update to Data Plane (via etcd).Saved as Service Template in Control Plane database.
VersioningNo built-in versioning for entities.Explicit Service Versions created from templates.
DeploymentChanges take effect as soon as they are saved.Versions must be Published to a Gateway Group.
AuditMinimal change tracking.Full audit logs and version history.

Next steps

API7.ai Logo

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.

Sign up for API7 newsletter

Product

API7 Gateway

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the Apache Software Foundation