Add or remove membership permissions from layers, forms, or projects
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Notes
-
Users with a role of Owner always have access to all resources within the organization.
-
The
change_permissionsendpoint accepts a JSON object labeledchangewith three parameters. -
The first parameter is
type, which indicates which object you want to change the membership permissions of. Valid type values areproject_members,form_members, andlayer_members. -
The second parameter is the id of the object you want to change the permission of. Valid ID keys are
project_id,form_idandlayer_id. Values must be valid resource IDs. -
The third parameter is the changeset you would like to add or remove. This is a key of either
addorremovewith the value an array of valid member IDs that you would like to alter. -
Permissions provided from Groups take priority over normal permissions. If you attempt to remove a member's Group-provided access to a form, project, or layer, the request will fail with a 422 status code response and the member's permissions will not change
API Library Examples
Add a Member to a Form
curl --request POST 'https://api.fulcrumapp.com/api/v2/memberships/change_permissions.json' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-ApiToken: {token}' \
--data '{
"change": {
"type": "form_members",
"form_id": "my-form-id",
"add": ["my-member-id"]
}
}'import requests
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"x-apitoken": API_TOKEN
}
body = {
"change": {
"type": "project_members",
"project_id": id_of_project,
"add": [membership_id_1]
}
}
url = "https://api.fulcrumapp.com/api/v2/memberships/change_permissions.json"
try:
res = requests.post(url, headers=headers, json=body)import { FulcrumClient, FulcrumRegion } from '@fulcrumapp/fulcrum-js';
const client = new FulcrumClient({
apiKey: '{token}',
// Use the region configured for your Fulcrum account.
region: FulcrumRegion.US
});
client.memberships.changePermissions({
permissionChangeRequest: {
change: { type: 'form_members', form_id: '{my-form-id}', add: ['{my-member-id}'] }
}
})
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.log(error.message);
});# Not currently supportedRemove a Member from a Project
curl --request POST 'https://api.fulcrumapp.com/api/v2/memberships/change_permissions.json' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-ApiToken: {token}' \
--data '{
"change": {
"type": "project_members",
"project_id": "my-project-id",
"remove": ["my-member-id"]
}
}'# Not currently supportedimport { FulcrumClient, FulcrumRegion } from '@fulcrumapp/fulcrum-js';
const client = new FulcrumClient({
apiKey: '{token}',
// Use the region configured for your Fulcrum account.
region: FulcrumRegion.US
});
client.memberships.changePermissions({
permissionChangeRequest: {
change: { type: 'project_members', project_id: '{my-project-id}', remove: ['{my-member-id}'] }
}
})
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.log(error.message);
});# Not currently supported