Create membership
PlatformLink a user to a tenant with an approved role and initial membership status.
Identity
One user identity
Membership
Tenant affiliation
Role
Functional access
Context
Tenant + membership
POST
/v1/membershipsScope: memberships.writeEndpoint summary
POST
/v1/memberships requires memberships.write.Request body
| Field | Type | Description |
|---|---|---|
| user_id | uuid | Existing Mediloop user |
| tenant_id | uuid | Target tenant |
| roles | string[] | Initial approved roles |
| status | enum | Usually active for direct provisioning or invited for invitation-led flow |
Validation
The caller must be allowed to manage members in the target tenant and may assign only roles permitted by policy.
Example request
JSONCopy
{
"user_id": "usr_123",
"tenant_id": "tnt_123",
"roles": ["doctor"]
}Example response
201 CreatedCopy
{
"id": "mbr_456",
"status": "active",
"roles": ["doctor"]
}