Working with memberships:
Membership objects are used for managing access to different resources in Productive. Currently it is used to manage access to projects, docs, dashboards, task views and deals.
Depending on the resource you are giving access for, different attribute is required. Here is a list of resources that can be used with memberships and their required attributes:
| Resource | Required attributes |
|---|---|
| Project | project_id |
| Doc | page_id |
| Dashboard | dashboard_id |
| Task view | filter_id |
| Deal | deal_id |
| Pulse | pulse_id |
There are three types of membership:
type_id: 1, person -> gives access to a specific persontype_id: 2, dynamic_group -> gives access to a system predefined group of peopletype_id: 3, team -> gives access to a teamWhen working with memberships, depending on the type of membership, different attributes should be sent. For person membership, you need to provide person_id, for dynamic group membership, you need to provide dynamic_group_id, and for team membership, you need to provide team_id.
Dynamic groups are predefined groups of people that are created based on the person role and person assignment. There are five types of dynamic groups:
dynamic_group_id: 2 - employees -> all employees in the organizationdynamic_group_id: 6 - project_members -> all members of a resource's projectdynamic_group_id: 8 - project_manager -> project manager of a resource's projectdynamic_group_id: 9 - deal_owner -> owner of a dealdynamic_group_id: 10 - users_that_can_manage_project -> all users who are members of a resource's project and have the Add, edit, and delete projects permissionWhen creating a membership for a dynamic group, you need to provide dynamic_group_id.
Depending on the target resource you are giving access to, different dynamic groups are available, dynamic_group_id available for:
There are multiple access levels membership can have:
access_type_id: 1 - full -> can edit and delete resourceaccess_type_id: 2 - edit -> can edit resourceaccess_type_id: 3 - view -> can only view resourceaccess_type_id: 4 - comment -> can comment on resourceaccess_type_id: 5 - member -> marks a subject as a member of a resourceMore about member access:
Member access is used for resources where there is no need for different levels (projects, deals). Those resources use only one access type and that is member access.
Having member access means you are a member of a resource.
Depending on the target resource you are giving access to, different access levels are available:
Example 1: creating a membership for a person on a project
POST https://api.productive.io/api/v2/memberships
{
"data": {
"attributes": {
"type_id": 1,
"person_id": 123,
"access_type_id": 5,
"project_id": 321
},
"type": "memberships"
}
}
Explanation of the example:
type_id: 1 - membership is for a personperson_id: 123 - person with id: 123 is getting accessaccess_type_id: 5 - person is getting member accessproject_id: 321 - person is getting access to project with id: 321Example 2: creating full access membership for an employees dynamic group on a dashboard
POST https://api.productive.io/api/v2/memberships
{
"data": {
"attributes": {
"type_id": 2,
"dynamic_group_id": 2,
"access_type_id": 1,
"dashboard_id": 321
},
"type": "memberships"
}
}
Explanation of the example:
type_id: 2 - membership is for a dynamic groupdynamic_group_id: 2 - employees dynamic group is getting accessaccess_type_id: 1 - employees are getting full accessdashboard_id: 321 - employees are getting access to dashboard with id: 321Example 3: creating view access membership for a team on a doc
POST https://api.productive.io/api/v2/memberships
{
"data": {
"attributes": {
"type_id": 3,
"team_id": 123,
"access_type_id": 3,
"page_id": 321
},
"type": "memberships"
}
}
Explanation of the example:
type_id: 3 - membership is for a teamteam_id: 123 - team with id: 123 is getting accessaccess_type_id: 3 - team is getting view accesspage_id: 321 - team is getting access to doc with id: 321ID of the access type determining the permission level of this membership (e.g. viewer, editor).
1
2
3
4
5
The AI agent associated with this membership, if the member is an agent rather than a person.
ID of the AI agent associated with this membership, if the member is an agent.
The dashboard this membership grants access to, if the target is a dashboard.
ID of the dashboard this membership grants access to, if the target is a dashboard.
The deal this membership grants access to, if the target is a deal.
ID of the deal this membership grants access to, if the target is a deal.
ID of the dynamic group this membership is assigned to, if assigned via a group rather than an individual.
2
6
8
9
10
11
12
The filter this membership grants access to, if the target is a filter.
ID of the filter this membership grants access to, if the target is a filter.
The unique identifier of this membership.
Additional options and settings for this membership.
The organization this membership belongs to.
The page this membership grants access to, if the target is a page.
The ID of the page this membership grants access to, if applicable.
The person this membership belongs to.
The ID of the person this membership belongs to.
The project this membership grants access to, if applicable.
The ID of the project this membership grants access to, if applicable.
The ID of the pulse (view) this membership applies to, if applicable.
The survey this membership grants access to, if applicable.
The ID of the survey this membership grants access to, if applicable.
The ID of the target resource this membership applies to.
The type of resource this membership applies to (e.g. project, page, survey).
The team this membership applies to, if it grants team-level access.
Numeric identifier for the membership type (e.g. viewer, editor, manager).
1
2
3