Memberships

Membership describe the relationships between organizations and users. For example, one user could have more than one organization.

Retrieve a list of memberships

Retrieve a list of memberships.

Request
Security:
query Parameters
limit
integer [ 0 .. 1000 ]

The collection items limit.

offset
integer >= 0

The collection items offset.

filter
string

The collection items filter requires a special format. Use "," for multiple allowed values. Use ";" for multiple fields. See the filter guide for more options and examples about this format.

sort
Array of strings

The collection items sort field and order (prefix with "-" for descending sort).

Responses
200

A list of memberships was retrieved successfully.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

get/memberships
Request samples
curl -i -X GET \
  'https://api-sandbox.rebilly.com/organizations/unknown/memberships?limit=1000&offset=0&filter=string&sort=string' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Response samples
application/json
[
  • {
    }
]

Retrieve the membership

Retrieve the membership using organization and user identifiers.

Request
Security:
path Parameters
organizationId
required
string (ResourceId) <= 50 characters

Organization identifier.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
userId
required
string (ResourceId) <= 50 characters

User identifier.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Responses
200

Membership was retrieved successfully.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

404

Resource was not found.

get/memberships/{organizationId}/{userId}
Request samples
curl -i -X GET \
  'https://api-sandbox.rebilly.com/organizations/unknown/memberships/{organizationId}/:userId' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "organization": {
    },
  • "user": {
    },
  • "allowedIps": [
    ],
  • "permissions": [
    ],
  • "isOwner": true,
  • "isDefault": true,
  • "roleIds": [
    ],
  • "_links": [
    ]
}

Create or update membership

Create or update membership using organization and user identifiers. Only membership's owner can add other users in the membership.

Request
Security:
path Parameters
organizationId
required
string (ResourceId) <= 50 characters

Organization identifier.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
userId
required
string (ResourceId) <= 50 characters

User identifier.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Request Body schema: application/json
isOwner
boolean
permissions
Array of strings <operationId>

The memberships's permissions. See the format in example. Use wildcard * for full access.

roleIds
Array of strings

The membership's roles identifiers.

Responses
200

Membership was updated.

201

Membership was created.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

409

Conflict.

put/memberships/{organizationId}/{userId}
Request samples
application/json
{
  • "isOwner": true,
  • "permissions": [
    ],
  • "roleIds": [
    ]
}
Response samples
application/json
{
  • "organization": {
    },
  • "user": {
    },
  • "allowedIps": [
    ],
  • "permissions": [
    ],
  • "isOwner": true,
  • "isDefault": true,
  • "roleIds": [
    ],
  • "_links": [
    ]
}

Delete the membership

Delete the membership using organization and user identifiers.

Request
Security:
path Parameters
organizationId
required
string (ResourceId) <= 50 characters

Organization identifier.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
userId
required
string (ResourceId) <= 50 characters

User identifier.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Responses
204

Membership message was deleted.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

404

Resource was not found.

409

Conflict.

delete/memberships/{organizationId}/{userId}
Request samples
curl -i -X DELETE \
  'https://api-sandbox.rebilly.com/organizations/unknown/memberships/{organizationId}/:userId' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "status": 400,
  • "title": "string",
  • "detail": "string",
  • "error": "string"
}