connection_memberships
Creates, updates, deletes, gets or lists a connection_memberships resource.
Overview
| Name | connection_memberships |
| Type | Resource |
| Id | fivetran.teams.connection_memberships |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The membership entity unique identifier (example: resource_id) |
created_at | string (date-time) | The timestamp that the user created their Fivetran account (example: 2024-01-01T00:00:00Z) |
role | string | The role the user has within the entity (example: Role Title) |
| Name | Datatype | Description |
|---|---|---|
id | string | The membership entity unique identifier (example: resource_id) |
created_at | string (date-time) | The timestamp that the user created their Fivetran account (example: 2024-01-01T00:00:00Z) |
role | string | The role the user has within the entity (example: Role Title) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | team_id, connection_id | Returns details of a team membership in a connection. | |
list | select | team_id | cursor, limit | Returns all connections a team has membership in. |
create | insert | team_id, id, role | Adds a team as a member of a connection. | |
update | update | team_id, connection_id, role | Updates team membership in a connection | |
delete | delete | team_id, connection_id | Removes team membership in a connection. |
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 |
|---|---|---|
connection_id | string | The unique identifier of the connection. Retrieve it from the id field in the [List All Connections](https://fivetran.com/docs/rest-api/api-reference/connections/list-connections) response, or from the id field returned when you [Create a Connection](https://fivetran.com/docs/rest-api/api-reference/connections/create-connection). |
team_id | string | The unique identifier for the team within the account. |
cursor | string | Paging cursor, [read more about pagination](https://fivetran.com/docs/rest-api/pagination) |
limit | integer (int32) | Number of records to fetch per page. Accepts a number in the range 1..1000; the default value is 100. |
SELECT examples
- get
- list
Returns details of a team membership in a connection.
SELECT
id,
created_at,
role
FROM fivetran.teams.connection_memberships
WHERE team_id = '{{ team_id }}' -- required
AND connection_id = '{{ connection_id }}' -- required
;
Returns all connections a team has membership in.
SELECT
id,
created_at,
role
FROM fivetran.teams.connection_memberships
WHERE team_id = '{{ team_id }}' -- required
AND "limit" = '{{ limit }}'
;
INSERT examples
- create
- Manifest
Adds a team as a member of a connection.
INSERT INTO fivetran.teams.connection_memberships (
id,
role,
team_id
)
SELECT
'{{ id }}' /* required */,
'{{ role }}' /* required */,
'{{ team_id }}'
RETURNING
id,
created_at,
role
;
# Description fields are for documentation purposes
- name: connection_memberships
props:
- name: team_id
value: "{{ team_id }}"
description: Required parameter for the connection_memberships resource.
- name: id
value: "{{ id }}"
description: |
The connection unique identifier
- name: role
value: "{{ role }}"
description: |
The team's role
UPDATE examples
- update
Updates team membership in a connection
UPDATE fivetran.teams.connection_memberships
SET
role = '{{ role }}'
WHERE
team_id = '{{ team_id }}' --required
AND connection_id = '{{ connection_id }}' --required
AND role = '{{ role }}' --required
RETURNING
id,
created_at,
role;
DELETE examples
- delete
Removes team membership in a connection.
DELETE FROM fivetran.teams.connection_memberships
WHERE team_id = '{{ team_id }}' --required
AND connection_id = '{{ connection_id }}' --required
;