Organization Memberships

Organization memberships represent the relationship between a single Contentful user and your organization. In other words, this data object defines explicitly who is a member of your organization.

Get all organization memberships

Get all organization memberships

This endpoint returns a paginated collection of all organization memberships for this organization.

All organization members can access this endpoint and will receive a scoped response.

Query Parameters

NameDetailsDescription
skip, limit-Specify requested page of result set. See Pagination for more details.
orderSupported values: role, sys.createdAt, sys.lastActiveAt, sys.user.firstName, sys.user.lastName, sys.user.emailSpecify sort order of result set. See Sorting Results for more details.
includeSupported values: sys.user, sys.createdBy, sys.updatedBySpecify linked resources to include in response. See Including Related Resources for more details.
queryFields searched: sys.user.id, sys.user.firstName, sys.user.lastName, sys.user.emailSpecify a string to search for matching resources against. See Searching Multiple Attributes for more details.
FiltersSee section belowSpecify a value to filter against for the provided attribute. See Filtering Results for more information, and below for details about supported attributes for this endpoint.

Filter Parameters

See Filtering Results for details about how to use attributes and operators to construct query filters.

AttributeSupported OperatorsSupported Values
roleeq, ne, in, ninowner, admin, developer, member
sys.statuseq, ne, in, ninpending, active
sys.user.sys.ideq, ne, in, ninString (id)
sys.user.firstNameeq, ne, existsString
sys.user.lastNameeq, ne, existsString
sys.lastActiveAtlt, lte, gt, gte, existsDatetime string (or Boolean with exists)
sys.sso.lastSignInAtlt, lte, gt, gte, existsDatetime string (or Boolean with exists)
sys.createdAtlt, lte, gt, gteDatetime string
sys.updatedAtlt, lte, gt, gteDatetime string

Response

1{
2 "total": 1,
3 "limit": 25,
4 "skip": 0,
5 "sys": {
6 "type": "Array"
7 },
8 "items": [{
9 "sys": {
10 "type": "OrganizationMembership",
11 "id": "0xWanD4AZI2AR35wW9q51n",
12 "version": 0,
13 "createdAt": "2015-05-18T11:29:46.809Z",
14 "updatedAt": "2015-05-18T11:29:46.809Z",
15 "lastActiveAt": null,
16 "status": "active",
17 "sso": null,
18 "user": {
19 "sys": {
20 "type": "Link",
21 "linkType": "User",
22 "id": "7BslKh9TdKGOK41VmLDjFZ"
23 }
24 },
25 "updatedBy": {
26 "sys": {
27 "type": "Link",
28 "linkType": "User",
29 "id": "7BslKh9TdKGOK41VmLDjFZ"
30 }
31 },
32 "createdBy": {
33 "sys": {
34 "type": "Link",
35 "linkType": "User",
36 "id": "7BslKh9TdKGOK41VmLDjFZ"
37 }
38 }
39 },
40 "role": "admin"
41 "isExemptFromRestrictedMode":true,
42 }]
43}

Get a single organization membership

Get a single organization membership

This endpoint returns details about an existing organization membership.

All organization members can access this endpoint.

Response

1{
2 "sys": {
3 "type": "OrganizationMembership",
4 "id": "0xWanD4AZI2AR35wW9q51n",
5 "version": 0,
6 "status": "active",
7 "createdAt": "2015-05-18T11:29:46.809Z",
8 "updatedAt": "2015-05-18T11:29:46.809Z",
9 "lastActiveAt": "2015-05-18T11:29:46.809Z",
10 "user": {
11 "sys": {
12 "type": "Link",
13 "linkType": "User",
14 "id": "7BslKh9TdKGOK41VmLDjFZ"
15 }
16 },
17 "updatedBy": {
18 "sys": {
19 "type": "Link",
20 "linkType": "User",
21 "id": "7BslKh9TdKGOK41VmLDjFZ"
22 }
23 },
24 "createdBy": {
25 "sys": {
26 "type": "Link",
27 "linkType": "User",
28 "id": "7BslKh9TdKGOK41VmLDjFZ"
29 }
30 },
31 "sso": {
32 "isExemptFromRestrictedMode": false,
33 "lastSignInAt": "2018-09-18T11:29:46.809Z",
34 "exemptionReasons": []
35 }
36 },
37 "role": "admin"
38}

Create an organization membership

It is not possible to create an organization membership directly. To add a user to your organization, you need to invite them to the organization.

Inviting a user to your organization has the indirect side effect of creating an organization membership, with a status of pending.

See the Invitations section below for complete details.

Update a single organization membership

Update a single organization membership

This endpoint allows you to change an organization membership. Use this to update the organizational role associated with this organization member.

Only organization admins and owners can access this endpoint.

Request Body

ParameterTypeUsage
rolestringrequired; one of member, developer, admin, owner

Response

1{
2 "sys": {
3 "type": "OrganizationMembership",
4 "id": "0xWanD4AZI2AR35wW9q51n",
5 "version": 0,
6 "createdAt": "2015-05-18T11:29:46.809Z",
7 "updatedAt": "2015-05-18T11:29:46.809Z",
8 "lastActiveAt": null,
9 "status": "active",
10 "sso": null,
11 "user": {
12 "sys": {
13 "type": "Link",
14 "linkType": "User",
15 "id": "7BslKh9TdKGOK41VmLDjFZ"
16 }
17 },
18 "updatedBy": {
19 "sys": {
20 "type": "Link",
21 "linkType": "User",
22 "id": "7BslKh9TdKGOK41VmLDjFZ"
23 }
24 },
25 "createdBy": {
26 "sys": {
27 "type": "Link",
28 "linkType": "User",
29 "id": "7BslKh9TdKGOK41VmLDjFZ"
30 }
31 }
32 },
33 "role": "admin"
34}

Delete a single organization membership

Delete a single organization membership

This endpoint deletes an organization membership. This action only affects whether a user can access an organization; it does not remove the user account itself.

Only organization admins and owners can access this endpoint. The user associated with the space membership also has access to this endpoint (so that they have permission to remove themselves from an organization).

Note: It is not possible to delete an organization membership with an owner role if there are no other owner memberships remaining in the organization.

Response

Status: 204 No Content