Upsert membership

Request

Creates or updates (upserts) a membership with a specified organization ID and user ID. Only the organization owner can grant organization membership to new users.

Security
SecretApiKey or JWT
Path
organizationIdstring, <= 50 characters(ResourceId)required

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

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

ID of the user.

Example:4f6cf35x-2c4y-483z-a0a9-158621f77a21
Bodyapplication/jsonrequired
allowedIpsArray of strings or null, (ip)(AllowedIps)

List of IP addresses that are permitted access. Private subnets are prohibited. To remove restrictions, set this value to null.

Example:
[ "153.12.32.33", "201.54.122.0/24", "2001:0db8:abcd:0012:0000:0000:0000:ffff", "2001:db8:abcd:12::0/64" ]
permissionsArray of strings, (operationId)(AclPermissions)

Permissions that the user has within the organization. Use the wildcard character * for full access.

Example:
[ "PostFile", "StorefrontGetAccount", "StorefrontGetWebsite", "StorefrontGetKycDocument", "StorefrontPostKycDocument" ]
isOwnerboolean

Specifies if the user is the owner of the organization.

roleIdsArray of strings

Role IDs associated with the user. Role IDs specify the roles that the user performs within the organization. For example, the user may be an organization admin.

curl -i -X PUT \
  https://www.rebilly.com/_mock/catalog/all/memberships/4f6cf35x-2c4y-483z-a0a9-158621f77a21/4f6cf35x-2c4y-483z-a0a9-158621f77a21 \
  -H 'Content-Type: application/json' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE' \
  -d '{
    "allowedIps": [
      "153.12.32.33",
      "201.54.122.0/24",
      "2001:0db8:abcd:0012:0000:0000:0000:ffff",
      "2001:db8:abcd:12::0/64"
    ],
    "permissions": [
      "PostFile",
      "StorefrontGetAccount",
      "StorefrontGetWebsite",
      "StorefrontGetKycDocument",
      "StorefrontPostKycDocument"
    ],
    "isOwner": true,
    "roleIds": [
      "string"
    ]
  }'

Responses

Membership updated.

Headers
X-RateLimit-Limitinteger

Total number of rate limit tokens for this request within a rate limit period. For more information, see Rate limits.

Example:3600
X-RateLimit-Remaininginteger

Remaining number of rate limit tokens for this request within the rate limit period. For example, in the sandbox environment, rate limits for non-GET endpoints are set at 3000 requests per 10 minutes.

Example:3600
Bodyapplication/json
organizationobjectread-onlyrequired

Organization membership.

userobjectread-onlyrequired

Membership user.

allowedIpsArray of strings or null, (ip)(AllowedIps)

List of IP addresses that are permitted access. Private subnets are prohibited. To remove restrictions, set this value to null.

Example:
[ "153.12.32.33", "201.54.122.0/24", "2001:0db8:abcd:0012:0000:0000:0000:ffff", "2001:db8:abcd:12::0/64" ]
permissionsArray of strings, (operationId)(AclPermissions)

Permissions that the user has within the organization. Use the wildcard character * for full access.

Example:
[ "PostFile", "StorefrontGetAccount", "StorefrontGetWebsite", "StorefrontGetKycDocument", "StorefrontPostKycDocument" ]
isOwnerboolean

Specifies if the user is the owner of the organization.

isDefaultbooleanread-only

Specifies if the organization is the default organization for the user.

roleIdsArray of strings

Role IDs associated with the user. Role IDs specify the roles that the user performs within the organization. For example, the user may be an organization admin.

aclArray of objects(Acl)read-only

Access Control List (ACL) information.

_embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

Response
{ "organization": { "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21", "name": "string", "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z" }, "user": { "id": "usr_0YVCEENYJ3D7Q9EN6BN16HA0G4", "name": "string", "email": "user@example.com" }, "allowedIps": [ "153.12.32.33", "201.54.122.0/24", "2001:0db8:abcd:0012:0000:0000:0000:ffff", "2001:db8:abcd:12::0/64" ], "permissions": [ "PostFile", "StorefrontGetAccount", "StorefrontGetWebsite", "StorefrontGetKycDocument", "StorefrontPostKycDocument" ], "isOwner": true, "isDefault": true, "roleIds": [ "string" ], "acl": [ {} ], "_links": [ {} ], "_embedded": { "roles": [] } }