members
Creates, updates, deletes, gets or lists a members resource.
Overview
| Name | members |
| Type | Resource |
| Id | pagerduty.teams.members |
Fields
The following fields are returned by SELECT queries:
- list
A paginated array of users within the requested team.
| Name | Datatype | Description |
|---|---|---|
role | string | |
user | object | (opaque JSON object) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | id | limit, offset, total, include[] | Get information about members on a team.<br /><br />A team is a collection of Users and Escalation Policies that represent a group of people within an organization.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#teams)<br /><br />Scoped OAuth requires: teams.read<br /> |
add | insert | id, user_id | Add a user to a team. Attempting to add a user with the read_only_user role will return a 400 error.<br /><br />A team is a collection of Users and Escalation Policies that represent a group of people within an organization.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#teams)<br /><br />Scoped OAuth requires: teams.write<br /> | |
remove | delete | id, user_id | Remove a user from a team.<br /><br />A team is a collection of Users and Escalation Policies that represent a group of people within an organization.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#teams)<br /><br />Scoped OAuth requires: teams.write<br /> |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the resource. |
user_id | string | The user ID on the team. |
include[] | string | Array of additional Models to include in response. |
limit | integer | The number of results per page. |
offset | integer | Offset to start pagination search results. |
total | boolean | By default the total field in pagination responses is set to null to provide the fastest possible response times. Set total to true for this field to be populated. See our [Pagination Docs](https://developer.pagerduty.com/docs/rest-api-v2/pagination/) for more information. |
SELECT examples
- list
Get information about members on a team.<br /><br />A team is a collection of Users and Escalation Policies that represent a group of people within an organization.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#teams)<br /><br />Scoped OAuth requires: teams.read<br />
SELECT
role,
user
FROM pagerduty.teams.members
WHERE id = '{{ id }}' -- required
AND limit = '{{ limit }}'
AND offset = '{{ offset }}'
AND total = '{{ total }}'
AND include[] = '{{ include[] }}'
;
INSERT examples
- add
- Manifest
Add a user to a team. Attempting to add a user with the read_only_user role will return a 400 error.<br /><br />A team is a collection of Users and Escalation Policies that represent a group of people within an organization.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#teams)<br /><br />Scoped OAuth requires: teams.write<br />
INSERT INTO pagerduty.teams.members (
role,
id,
user_id
)
SELECT
'{{ role }}',
'{{ id }}',
'{{ user_id }}'
;
# Description fields are for documentation purposes
- name: members
props:
- name: id
value: "{{ id }}"
description: Required parameter for the members resource.
- name: user_id
value: "{{ user_id }}"
description: Required parameter for the members resource.
- name: role
value: "{{ role }}"
description: |
The role of the user on the team.
valid_values: ['observer', 'responder', 'manager']
DELETE examples
- remove
Remove a user from a team.<br /><br />A team is a collection of Users and Escalation Policies that represent a group of people within an organization.<br /><br />For more information see the [API Concepts Document](https://developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#teams)<br /><br />Scoped OAuth requires: teams.write<br />
DELETE FROM pagerduty.teams.members
WHERE id = '{{ id }}' --required
AND user_id = '{{ user_id }}' --required
;