connection_memberships
Creates, updates, deletes, gets or lists a connection_memberships resource.
Overview
| Name | connection_memberships |
| Type | Resource |
| Id | fivetran.users.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 | user_id, connection_id | Returns the details of a user's membership in a connection. | |
list | select | user_id | cursor, limit | Returns all connection membership for a user within your Fivetran account. |
create | insert | user_id, id, role | Adds a connection membership | |
update | update | user_id, connection_id, role | Updates user membership in a connection. | |
delete | delete | user_id, connection_id | Removes user 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). |
user_id | string | The unique identifier for the user 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 the details of a user's membership in a connection.
SELECT
id,
created_at,
role
FROM fivetran.users.connection_memberships
WHERE user_id = '{{ user_id }}' -- required
AND connection_id = '{{ connection_id }}' -- required
;
Returns all connection membership for a user within your Fivetran account.
SELECT
id,
created_at,
role
FROM fivetran.users.connection_memberships
WHERE user_id = '{{ user_id }}' -- required
AND "limit" = '{{ limit }}'
;
INSERT examples
- create
- Manifest
Adds a connection membership
INSERT INTO fivetran.users.connection_memberships (
id,
role,
user_id
)
SELECT
'{{ id }}' /* required */,
'{{ role }}' /* required */,
'{{ user_id }}'
RETURNING
id,
created_at,
role
;
# Description fields are for documentation purposes
- name: connection_memberships
props:
- name: user_id
value: "{{ user_id }}"
description: Required parameter for the connection_memberships resource.
- name: id
value: "{{ id }}"
description: |
The membership entity unique identifier
- name: role
value: "{{ role }}"
description: |
The role that you would like to assign to the user
UPDATE examples
- update
Updates user membership in a connection.
UPDATE fivetran.users.connection_memberships
SET
role = '{{ role }}'
WHERE
user_id = '{{ user_id }}' --required
AND connection_id = '{{ connection_id }}' --required
AND role = '{{ role }}' --required
RETURNING
id,
created_at,
role;
DELETE examples
- delete
Removes user membership in a connection.
DELETE FROM fivetran.users.connection_memberships
WHERE user_id = '{{ user_id }}' --required
AND connection_id = '{{ connection_id }}' --required
;