Skip to content
DocsOpenAPI spec

    Update Organization Membership

    PATCH/v1/organizations/{organization_id}/memberships/{membership_id}

    Change the role of a member of an organization. Owners may assign any role. Admins may assign admin, billing or member, and cannot change the role of an owner. The last owner cannot be demoted, and members cannot change their own role except for an owner stepping down while another owner remains.

    Path ParametersExpand Collapse
    organization_id: string
    membership_id: string
    Body ParametersJSONExpand Collapse
    role: "owner" or "admin" or "billing" or "member"

    Role of the user in the organization.

    One of the following:
    "owner"
    "admin"
    "billing"
    "member"
    ReturnsExpand Collapse
    OrganizationMembership object { id, created_at, organization_id, 3 more }

    Organization membership details.

    id: string

    Membership ID.

    created_at: string

    When the membership was created.

    formatdate-time
    organization_id: string

    Organization ID.

    role: "owner" or "admin" or "billing" or "member"

    Role of the user in the organization.

    One of the following:
    "owner"
    "admin"
    "billing"
    "member"
    updated_at: string

    When the membership was updated.

    formatdate-time
    user_id: string

    User ID.

    Update Organization Membership

    curl https://api.nirvanalabs.io/v1/organizations/$ORGANIZATION_ID/memberships/$MEMBERSHIP_ID \
        -X PATCH \
        -H 'Content-Type: application/json' \
        -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \
        -d '{
              "role": "owner"
            }'
    {
      "id": "987e6543-e89b-12d3-a456-426614174000",
      "created_at": "2025-01-01T00:00:00Z",
      "organization_id": "123e4567-e89b-12d3-a456-426614174000",
      "role": "owner",
      "updated_at": "2025-01-01T00:00:00Z",
      "user_id": "456e7890-e89b-12d3-a456-426614174000"
    }
    Returns Examples
    {
      "id": "987e6543-e89b-12d3-a456-426614174000",
      "created_at": "2025-01-01T00:00:00Z",
      "organization_id": "123e4567-e89b-12d3-a456-426614174000",
      "role": "owner",
      "updated_at": "2025-01-01T00:00:00Z",
      "user_id": "456e7890-e89b-12d3-a456-426614174000"
    }