Organization Ownership
This guide shows you how to link organizations so they act as one — the case it exists for is a merger or an acquisition, where one organization takes over another. Instead of migrating the acquired organization's data into the acquirer's, which would mean rewriting every stored path, the isolation between the two is lifted while the data stays where it is.
Ownership is behind the organization-ownership feature, which is off by default. Add it to enabledFeatures in _features.conf. With the feature off, the ownership API is not registered, stored ownership has no effect, and behaviour is exactly as without it.
Prerequisites
Before you begin, ensure you have:
- The
organization-ownershipfeature enabled. - A Bearer token for an account that holds the relevant permission on the organization you are offering, accepting, or viewing.
When performing operations within an organization, use the organization's Base URL or another valid host alias. For the sandbox organization test, the base URL is https://test.enterprise-sandbox.waltid.dev.
Ownership Groups
Organizations linked by accepted ownership form one group. If organization B is owned by organization A, and organization C by organization B, then A, B, and C are one group; two organizations owned by the same owner are in its group too.
Within a group:
- An account's roles in every organization of the group apply together. Someone with a role in A and a role in B holds both when calling either. Each role still grants only on the paths it names: a role in B grants nothing in A, and nobody gains a right in an organization they have no role in. B's administrators keep deciding what anyone may do in B, with the roles they already manage.
- Services may use services of another organization in the group as dependencies — for example, A's DID service or issuer signing with a key held in B's KMS — given the usual permissions to delegate that service.
With the feature on, a dependency on a service of an organization outside the group is refused, both when it is attached and whenever it is used. So ending an ownership also cuts off dependencies attached while it lasted. The refusal is a 403:
{
"exception": true,
"id": "WebException",
"status": "Forbidden",
"code": "403",
"message": "Service 'bank-a.ops.did' cannot use 'bank-b.ops.kms': organizations 'bank-a' and 'bank-b' are not in the same ownership group"
}
Being in the same group is necessary but not enough. If the caller has no role in the other organization that lets it delegate the dependency, attaching it is also refused with a 403, but with a different error: TreeEntryPermissionException, "User '…' doesn't have permission to read entry of type 'kms' with id bank-b.ops.kms". Seeing this error inside a group means a role is missing on the other side, not that the ownership failed.
Nothing is moved or rewritten, and URLs do not change: each organization keeps its host, paths, and data.
Permissions
| Step | Called on | Permission |
|---|---|---|
| Offer itself to an owner | The owned organization | organization-management-pass-ownership |
| Withdraw the offer, or end its ownership | The owned organization | organization-management-pass-ownership |
| Accept or decline an offer | The owner | organization-management-accept-ownership |
| Release an organization it owns | The owner | organization-management-accept-ownership |
| View ownership | Either | organization-management-view-ownership |
An offer is refused if the organization already has an owner, if the owner does not exist, or if it would make ownership circular (A owned by B while B is owned by A, directly or further up). Accepting checks for a cycle again, in case the owner's own line changed since the offer. An offer changes nothing until it is accepted.
Every change is logged at INFO with both organizations and the account that made it.
View Ownership
All endpoints act on the organization they are called for, under /v1/{orgID}/organization-management-api/ownership. Call each one on a host of that same organization: its Base URL or another host alias of the organization itself. The path is resolved relative to the host's organization, so to act on the other side of an ownership (for example, to accept on bank-a an offer made by bank-b), switch to that organization's host. Calling /v1/bank-a/… on bank-b's host resolves to bank-b.bank-a and fails with 404, even while the two are in one ownership group. A host alias that points to a tenant fails the same way.
Endpoint: GET /v1/{orgID}/organization-management-api/ownership | API Reference
Example Request
curl -X 'GET' \
'https://{orgID}.enterprise-sandbox.waltid.dev/v1/{orgID}/organization-management-api/ownership' \
-H 'accept: application/json' \
-H 'Authorization: Bearer {yourToken}'
Path Parameters
- orgID: String (required) - The organization being viewed, e.g.
bank-a. Call it on a host of this same organization: its Base URL (bank-a.enterprise-sandbox.waltid.dev) or another host alias of the organization itself, not one that points to a tenant.
Header Parameters
- Authorization: String (required) - Bearer token for Enterprise Stack authentication. Format:
Bearer {token}.
Example Response
{
"organization": "bank-a",
"ownershipLine": [],
"group": ["bank-a", "bank-b"],
"owns": ["bank-b"],
"offersReceived": []
}
Response Fields
- organization: String - The organization this view is for.
- owner: String (optional) - The accepted owner. Omitted when this organization has no owner, as in the example above.
- offeredTo: String (optional) - An owner this organization has offered itself to, awaiting acceptance. Omitted when there is no pending offer.
- ownershipLine: Array of Strings - The owners above this organization, nearest first.
- group: Array of Strings - Every organization this one acts as one with, itself included.
- owns: Array of Strings - Organizations this one owns directly.
- offersReceived: Array of Strings - Organizations that have offered themselves to this one.
Response Codes
200— Ownership of this organization.401— Invalid or missing authentication token.403— The caller does not holdorganization-management-view-ownership.
Offer This Organization to an Owner
Takes effect only when the owner accepts. A new offer replaces a pending one.
Endpoint: POST /v1/{orgID}/organization-management-api/ownership/offer | API Reference
Example Request
curl -X 'POST' \
'https://{orgID}.enterprise-sandbox.waltid.dev/v1/{orgID}/organization-management-api/ownership/offer' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {yourToken}' \
-d '{
"owner": "bank-a"
}'
Path Parameters
- orgID: String (required) - The organization offering itself, e.g.
bank-b. Call it on a host of this same organization: its Base URL (bank-b.enterprise-sandbox.waltid.dev) or another host alias of the organization itself, not one that points to a tenant.
Header Parameters
- Authorization: String (required) - Bearer token for Enterprise Stack authentication. Format:
Bearer {token}.
Body Parameters
- owner: String (required) - The organization id to offer this organization to.
Example Response
The response is the ownership view of the organization that was called.
Response Codes
200— Offer recorded. Isolation is unchanged until the owner accepts.400— This organization already has an owner, the owner does not exist, it would own itself, or the offer would make ownership circular.401— Invalid or missing authentication token.403— The caller does not holdorganization-management-pass-ownership.
Accept an Offer
From then on the organizations of both groups act as one: an account's roles in each apply together, and services may use each other's services as dependencies. No data is moved or rewritten.
Endpoint: POST /v1/{orgID}/organization-management-api/ownership/accept | API Reference
Example Request
curl -X 'POST' \
'https://{orgID}.enterprise-sandbox.waltid.dev/v1/{orgID}/organization-management-api/ownership/accept' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {yourToken}' \
-d '{
"organization": "bank-b"
}'
Path Parameters
- orgID: String (required) - The organization accepting the offer, e.g.
bank-a. Call it on a host of this same organization: its Base URL (bank-a.enterprise-sandbox.waltid.dev) or another host alias of the organization itself, not one that points to a tenant.
Header Parameters
- Authorization: String (required) - Bearer token for Enterprise Stack authentication. Format:
Bearer {token}.
Body Parameters
- organization: String (required) - The organization id that offered itself to this one.
Example Response
The response is the ownership view of the organization that was called.
Response Codes
200— Ownership is in effect.400— The named organization does not exist, has not offered itself to this one, or accepting would make ownership circular.401— Invalid or missing authentication token.403— The caller does not holdorganization-management-accept-ownership.
🎉 You've linked two organizations by ownership.
Decline an Offer
Endpoint: POST /v1/{orgID}/organization-management-api/ownership/decline | API Reference
Example Request
curl -X 'POST' \
'https://{orgID}.enterprise-sandbox.waltid.dev/v1/{orgID}/organization-management-api/ownership/decline' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {yourToken}' \
-d '{
"organization": "bank-b"
}'
Path Parameters
- orgID: String (required) - The organization declining the offer, e.g.
bank-a. Call it on a host of this same organization: its Base URL (bank-a.enterprise-sandbox.waltid.dev) or another host alias of the organization itself, not one that points to a tenant.
Header Parameters
- Authorization: String (required) - Bearer token for Enterprise Stack authentication. Format:
Bearer {token}.
Body Parameters
- organization: String (required) - The organization id whose offer to decline.
Example Response
The response is the ownership view of the organization that was called.
Response Codes
200— Offer declined.400— The named organization does not exist or has not offered itself to this one.401— Invalid or missing authentication token.403— The caller does not holdorganization-management-accept-ownership.
Leave — Withdraw an Offer or End Ownership
Ending ownership restores the isolation between this organization and its former group at once on this pod, and within the permission cache's lifetime on the others.
Endpoint: POST /v1/{orgID}/organization-management-api/ownership/leave | API Reference
Example Request
curl -X 'POST' \
'https://{orgID}.enterprise-sandbox.waltid.dev/v1/{orgID}/organization-management-api/ownership/leave' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {yourToken}' \
-d '{}'
Path Parameters
- orgID: String (required) - The organization withdrawing its offer or ending its ownership, e.g.
bank-b. Call it on a host of this same organization: its Base URL (bank-b.enterprise-sandbox.waltid.dev) or another host alias of the organization itself, not one that points to a tenant.
Header Parameters
- Authorization: String (required) - Bearer token for Enterprise Stack authentication. Format:
Bearer {token}.
Body Parameters
- Empty JSON object.
Example Response
The response is the ownership view of the organization that was called.
Response Codes
200— Offer withdrawn, or ownership ended.400— This organization has no owner and no pending offer.401— Invalid or missing authentication token.403— The caller does not holdorganization-management-pass-ownership.
Release an Organization This One Owns
Restores the isolation between the two, as ending ownership from the owned side does.
Endpoint: POST /v1/{orgID}/organization-management-api/ownership/release | API Reference
Example Request
curl -X 'POST' \
'https://{orgID}.enterprise-sandbox.waltid.dev/v1/{orgID}/organization-management-api/ownership/release' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {yourToken}' \
-d '{
"organization": "bank-b"
}'
Path Parameters
- orgID: String (required) - The organization releasing ownership, e.g.
bank-a. Call it on a host of this same organization: its Base URL (bank-a.enterprise-sandbox.waltid.dev) or another host alias of the organization itself, not one that points to a tenant.
Header Parameters
- Authorization: String (required) - Bearer token for Enterprise Stack authentication. Format:
Bearer {token}.
Body Parameters
- organization: String (required) - The organization id this one currently owns.
Example Response
The response is the ownership view of the organization that was called.
Response Codes
200— Ownership ended.400— The named organization is not owned by this one.401— Invalid or missing authentication token.403— The caller does not holdorganization-management-accept-ownership.404— The named organization does not exist.
A Merger, Step by Step
- Organization B offers itself to organization A:
POST /v1/bank-b/…/ownership/offerwith{"owner": "bank-a"}. - Organization A accepts:
POST /v1/bank-a/…/ownership/acceptwith{"organization": "bank-b"}. - B's administrators give A's staff the roles they need in B, as they would for anyone. From now on those roles also count when A's staff call A.
- A attaches B's services to its own as dependencies, for example B's KMS to A's issuer. A
403here means either the organizations are not in one group or the caller lacks a role in B; the two errors are told apart above.
Releasing restores the isolation at once on the pod that handles the request.
A Merger Across Data Centers
When the organization to be merged runs on another installation, move it first, then merge:
- On its installation, put it into maintenance mode and export it. This requires both the
maintenanceandimport-exportfeatures on that installation, andimport-exporton the target installation too. - On the target installation, create the organization with the same id and import the file.
- Offer and accept ownership there, as above.
Ownership and maintenance state are not part of an export, so the moved organization arrives writable and unowned.
Caching
Permissions are cached per account and organization, and the ownership relations for 5 seconds, on each API pod. The pod that changes an ownership drops both at once. Other pods apply the change when their caches expire: within 5 seconds for the dependency check, and within the permission cache's lifetime (5 minutes) for which roles apply together.
After release or leave, other pods may still apply the former group's roles for up to five minutes, and a cross-group dependency may still be usable for up to five seconds. Plan revocation with that window in mind.
Next Steps
- Add a Service Dependency — Attach a service from another organization in the group.
- Create Roles — Grant the acquired organization's staff the roles they need after acceptance.
- Features — Enable
organization-ownershipin_features.conf.
