Skip to main content
Version: Next Version

Seata API Documentation

1. API Overview

1.1 namingserver open-api

APIMethodPathDescriptionDetail
Health CheckGET/naming/v1/healthnamingserver health checkView
Register InstancePOST/naming/v1/register /api/v1/naming/registerregister a single nodeView
Batch RegisterPOST/naming/v1/batchRegister /api/v1/naming/batchRegisterregister nodes in batchView
Unregister InstancePOST/naming/v1/unregister /api/v1/naming/unregisterunregister a single nodeView
Cluster MonitorGET/naming/v1/clusters /api/v1/naming/clustersquery cluster monitoring viewView
Cluster DataGET/naming/v1/clusterData /api/v1/naming/clusterDataquery raw data of one clusterView
DiscoveryGET/naming/v1/discovery /api/v1/naming/discoverydiscover clusters by vGroupView
Add GroupPOST/naming/v1/addGroup /api/v1/naming/addGroupadd vGroup mappingView
Change GroupPOST/naming/v1/changeGroup /api/v1/naming/changeGroupswitch vGroup mappingView
Namespace (v1)GET/naming/v1/namespace /api/v1/naming/namespacenamespace overview (v1)View
WatchPOST/naming/v1/watch /api/v1/naming/watchlong-poll subscribe to vGroup changesView
Watch ListGET/naming/v1/watchList /api/v1/naming/watchListcurrent watch listView
Namespace (v2)GET/naming/v2/namespace /api/v2/naming/namespacenamespace overview (v2)View

1.2 server admin-api

APIMethodPathDescriptionDetail
Delete Branch SessionDELETE/api/v1/console/branchSession/deleteBranchSessiondelete branch sessionView
Force Delete Branch SessionDELETE/api/v1/console/branchSession/forceDeleteBranchSessionforce delete branch sessionView
Stop Branch SessionPUT/api/v1/console/branchSession/stopBranchSessionstop branch retriesView
Start Branch SessionPUT/api/v1/console/branchSession/startBranchSessionstart branch retriesView
Query Global SessionGET/api/v1/console/globalSession/querypage query global sessionsView
Delete Global SessionDELETE/api/v1/console/globalSession/deleteGlobalSessiondelete global sessionView
Force Delete Global SessionDELETE/api/v1/console/globalSession/forceDeleteGlobalSessionforce delete global sessionView
Stop Global SessionPUT/api/v1/console/globalSession/stopGlobalSessionstop global retriesView
Start Global SessionPUT/api/v1/console/globalSession/startGlobalSessionstart global retriesView
Send Commit/RollbackPUT/api/v1/console/globalSession/sendCommitOrRollbackmanually trigger commit or rollback dispatchView
Change Global StatusPUT/api/v1/console/globalSession/changeGlobalStatuschange global statusView
Query Global LockGET/api/v1/console/globalLock/querypage query global locksView
Delete Global LockDELETE/api/v1/console/globalLock/deletedelete global lockView
Check Global LockGET/api/v1/console/globalLock/checkcheck whether lock exists for a branchView

1.3 server open-api

APIMethodPathDescriptionDetail
Server Health CheckGET (recommended)/healthserver health checkView
Change ClusterPOST/metadata/v1/changeClusterchange raft peersView
Query Cluster MetadataGET/metadata/v1/clusterquery leader/term/nodes/storeModeView
Watch MetadataPOST/metadata/v1/watchlong-poll subscribe to group changesView
Add VGroupGET/vgroup/v1/addVGroupadd vGroup mappingView
Remove VGroupGET/vgroup/v1/removeVGroupremove vGroup mappingView

2. namingserver open-api

2.1 Health Check

  • Purpose: return namingserver availability status.
  • Request: GET /naming/v1/health
  • Parameters: none
  • Response: Result<?>
  • Notes: response body defaults to code="200" and message="success".

2.2 Register Instance

  • Purpose: register a single NamingServerNode under namespace + clusterName + unit.
  • Request: POST /naming/v1/register or POST /api/v1/naming/register
  • Query parameters:
NameTypeRequiredSourceNote
namespacestringYquery (@RequestParam)namespace
clusterNamestringYquery (@RequestParam)cluster name
unitstringYquery (@RequestParam)unit name
  • Body: NamingServerNode
FieldTypeRequiredNote
controlobjectNcontrol endpoint
transactionobjectNtransaction endpoint
internalobjectNinternal endpoint
rolestringNnode role
versionstringNversion
metadataobjectNextended metadata
weightnumberNweight
healthybooleanNhealth status
termlongNnode term
unitstringNnode unit
  • Response: Result<String>
  • Notes: failures are usually represented by code=500, while HTTP status may still be 200.

2.3 Batch Register

  • Purpose: register nodes in batch.
  • Request: POST /naming/v1/batchRegister or POST /api/v1/naming/batchRegister
  • Query parameters: namespace, clusterName (both required, @RequestParam)
  • Body: List<NamingServerNode>
  • Response: Result<String>

2.4 Unregister Instance

  • Purpose: unregister a single node.
  • Request: POST /naming/v1/unregister or POST /api/v1/naming/unregister
  • Query parameters: namespace, clusterName, unit (all required)
  • Body: NamingServerNode
  • Response: Result<String>

2.5 Cluster Monitor

  • Purpose: query cluster monitoring view under a namespace.
  • Request: GET /naming/v1/clusters or GET /api/v1/naming/clusters
  • Parameters:
NameTypeRequiredSourceNote
namespacestringY (recommended)query (default binding)method argument is not explicitly annotated with @RequestParam
  • Response: List<ClusterVO> (clusterName, clusterType, vGroupMapping, unitData)

2.6 Cluster Data

  • Purpose: query raw data for one cluster.
  • Request: GET /naming/v1/clusterData or GET /api/v1/naming/clusterData
  • Parameters: namespace, clusterName (both required, @RequestParam)
  • Response: SingleResult<ClusterData>
  • Notes: when cluster is not found, it returns SingleResult.failure("Cluster not found").

2.7 Discovery

  • Purpose: discover cluster list by vGroup + namespace.
  • Request: GET /naming/v1/discovery or GET /api/v1/naming/discovery
  • Parameters: vGroup, namespace (both required)
  • Response: MetaResponse
FieldTypeNote
clusterListlistmatched cluster list
termlongcurrent vGroup term

2.8 Add Group

  • Purpose: create vGroup-to-cluster mapping.
  • Request: POST /naming/v1/addGroup or POST /api/v1/naming/addGroup
  • Parameters:
NameTypeRequiredSourceNote
namespacestringYquery (@RequestParam)namespace
clusterNamestringYquery (@RequestParam)target cluster
unitNamestringNquery (default binding)no explicit annotation, nullable
vGroupstringYquery (@RequestParam)transaction group
  • Response: Result<String>

2.9 Change Group

  • Purpose: switch a vGroup to a new cluster.
  • Request: POST /naming/v1/changeGroup or POST /api/v1/naming/changeGroup
  • Parameters: namespace, clusterName, vGroup (required) + unitName (optional, default "")
  • Response: Result<String>

2.10 Namespace (v1)

  • Purpose: return aggregated namespace information.
  • Request: GET /naming/v1/namespace or GET /api/v1/naming/namespace
  • Parameters: none
  • Response: SingleResult<Map<String, NamespaceVO>>
NamespaceVO FieldType
clustersList<String>
vgroupsList<String>

2.11 Watch

  • Purpose: subscribe to specified vGroup changes (long polling).
  • Request: POST /naming/v1/watch or POST /api/v1/naming/watch
  • Parameters:
NameTypeRequiredSourceNote
clientTermstringYquery (@RequestParam)must be convertible to long
vGroupstringYquery (@RequestParam)transaction group
timeoutstringYquery (@RequestParam)must be convertible to int
  • Response: void (asynchronous)
  • Key behaviors:
    • Uses request.startAsync() to enable async processing.
    • AsyncContext timeout is set to 0 (container-level infinite timeout).
    • Actual waiting window is controlled by the timeout parameter passed to watcher.

2.12 Watch List

  • Purpose: view registered watchers.
  • Request: GET /naming/v1/watchList or GET /api/v1/naming/watchList
  • Parameters: none
  • Response: List<WatcherVO> (vGroup, watcherIp)

2.13 Namespace (v2)

  • Purpose: return namespace aggregate information in v2 structure.
  • Request: GET /naming/v2/namespace or GET /api/v2/naming/namespace
  • Parameters: none
  • Response: SingleResult<Map<String, org.apache.seata.namingserver.entity.vo.v2.NamespaceVO>>
v2 NamespaceVO FieldType
clustersMap<String, ClusterVO>
v2 ClusterVO FieldType
vgroupsList<String>
unitsList<String>
typeString

3. server admin-api

3.1 Delete Branch Session

  • Request: DELETE /api/v1/console/branchSession/deleteBranchSession
  • Purpose: delete branch session.
  • Parameters: xid, branchId (default binding, recommended via query/form)
  • Response: SingleResult<Void>

3.2 Force Delete Branch Session

  • Request: DELETE /api/v1/console/branchSession/forceDeleteBranchSession
  • Purpose: force delete branch session.
  • Parameters: xid, branchId
  • Response: SingleResult<Void>

3.3 Stop Branch Session

  • Request: PUT /api/v1/console/branchSession/stopBranchSession
  • Purpose: stop branch retries.
  • Parameters: xid, branchId
  • Response: SingleResult<Void>

3.4 Start Branch Session

  • Request: PUT /api/v1/console/branchSession/startBranchSession
  • Purpose: start branch retries.
  • Parameters: xid, branchId
  • Response: SingleResult<Void>

3.5 Query Global Session

  • Request: GET /api/v1/console/globalSession/query
  • Purpose: page query global sessions.
  • Parameter source: @ModelAttribute GlobalSessionParam (query binding)
FieldTypeNote
pageNumintpagination parameter
pageSizeintpagination parameter
timeStartlongstart of time range
timeEndlongend of time range
xidstringfilter condition
applicationIdstringfilter condition
statusintfilter condition
transactionNamestringfilter condition
vgroupstringfilter condition
withBranchbooleaninclude branch details
  • Response: PageResult<GlobalSessionVO>

3.6 Delete Global Session

  • Request: DELETE /api/v1/console/globalSession/deleteGlobalSession
  • Purpose: delete global session.
  • Parameters: xid
  • Response: SingleResult<Void>

3.7 Force Delete Global Session

  • Request: DELETE /api/v1/console/globalSession/forceDeleteGlobalSession
  • Purpose: force delete global session.
  • Parameters: xid
  • Response: SingleResult<Void>

3.8 Stop Global Session

  • Request: PUT /api/v1/console/globalSession/stopGlobalSession
  • Purpose: stop global retries.
  • Parameters: xid
  • Response: SingleResult<Void>

3.9 Start Global Session

  • Request: PUT /api/v1/console/globalSession/startGlobalSession
  • Purpose: start global retries.
  • Parameters: xid
  • Response: SingleResult<Void>

3.10 Send Commit/Rollback

  • Request: PUT /api/v1/console/globalSession/sendCommitOrRollback
  • Purpose: manually trigger commit/rollback dispatch.
  • Parameters: xid
  • Response: SingleResult<Void>

3.11 Change Global Status

  • Request: PUT /api/v1/console/globalSession/changeGlobalStatus
  • Purpose: change global transaction status.
  • Parameters: xid
  • Response: SingleResult<Void>

3.12 Query Global Lock

  • Request: GET /api/v1/console/globalLock/query
  • Purpose: page query global locks.
  • Parameter source: @ModelAttribute GlobalLockParam
FieldTypeNote
pageNumintpagination parameter
pageSizeintpagination parameter
timeStartlongstart of time range
timeEndlongend of time range
xidstringfilter condition
tableNamestringfilter condition
transactionIdstringfilter condition
branchIdstringfilter condition
pkstringfilter condition
resourceIdstringfilter condition
  • Response: PageResult<GlobalLockVO>

3.13 Delete Global Lock

  • Request: DELETE /api/v1/console/globalLock/delete
  • Purpose: delete global lock.
  • Parameter source: @ModelAttribute GlobalLockParam
  • Response: SingleResult<Void>

3.14 Check Global Lock

  • Request: GET /api/v1/console/globalLock/check
  • Purpose: check whether a specified branch has a lock.
  • Parameters: xid, branchId (default binding)
  • Response: SingleResult<Boolean>

4. server open-api

4.1 Health Check

  • Request: /health (@RequestMapping, recommended to call with GET)
  • Purpose: return server startup status.
  • Parameters: none
  • Response: String, value is ok or not_ok

4.2 Change Cluster

  • Request: POST /metadata/v1/changeCluster
  • Purpose: change raft peers configuration.
  • Parameters:
NameTypeRequiredSourceNote
raftClusterStrstringYquery (@RequestParam)jraft Configuration#parse format
  • Response: Result<?>
  • Notes: when parsing fails, only message is set, and code may still remain the default 200.

4.3 Query Cluster Metadata

  • Request: GET /metadata/v1/cluster
  • Purpose: fetch storeMode/term/nodes for a group.
  • Parameters:
NameTypeRequiredSourceNote
groupstringNquery (default binding)if empty, fallback to server.raft.group, default default
  • Response: MetadataResponse
FieldType
storeModestring
termlong
nodesList<Node>

4.4 Watch Metadata

  • Request: POST /metadata/v1/watch
  • Purpose: subscribe to changes by group+term.
  • Parameters:
NameTypeRequiredSourceNote
groupTermsmapYbody (@RequestBody)key=group, value=term
timeoutintNquery (@RequestParam)default 28000
contextHttpContextframework-injectedmethod argnot user input
  • Response: void (asynchronous)
  • Notes: term is converted using Long.parseLong(String.valueOf(term)).

4.5 Add VGroup

  • Request: GET /vgroup/v1/addVGroup
  • Purpose: add vGroup mapping (side effect).
  • Parameters: vGroup, unit (@RequestParam)
  • Response: Result<?>
  • Notes: in non-raft mode, local term is refreshed using System.currentTimeMillis().

4.6 Remove VGroup

  • Request: GET /vgroup/v1/removeVGroup
  • Purpose: remove vGroup mapping (side effect).
  • Parameters: vGroup (@RequestParam)
  • Response: Result<?>
  • Notes: in non-raft mode, local term is refreshed.

5. Common Response Structures

5.1 Result

FieldTypeNote
codestringdefault 200
messagestringdefault success

5.2 SingleResult

FieldTypeNote
codestringinherits from Result
messagestringinherits from Result
dataanybusiness payload

5.3 PageResult

FieldTypeNote
codestringinherits from Result
messagestringinherits from Result
datalistcurrent page data
totalinttotal records
pagesinttotal pages
pageNumintcurrent page
pageSizeintpage size