Mediloop

Create membership

Platform

Link 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.write

Endpoint summary

POST /v1/memberships requires memberships.write.

Request body

FieldTypeDescription
user_iduuidExisting Mediloop user
tenant_iduuidTarget tenant
rolesstring[]Initial approved roles
statusenumUsually 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"]
}