Skip to main content

connection_memberships

Creates, updates, deletes, gets or lists a connection_memberships resource.

Overview​

Nameconnection_memberships
TypeResource
Idfivetran.users.connection_memberships

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe membership entity unique identifier (example: resource_id)
created_atstring (date-time)The timestamp that the user created their Fivetran account (example: 2024-01-01T00:00:00Z)
rolestringThe role the user has within the entity (example: Role Title)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectuser_id, connection_idReturns the details of a user's membership in a connection.
listselectuser_idcursor, limitReturns all connection membership for a user within your Fivetran account.
createinsertuser_id, id, roleAdds a connection membership
updateupdateuser_id, connection_id, roleUpdates user membership in a connection.
deletedeleteuser_id, connection_idRemoves 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.

NameDatatypeDescription
connection_idstringThe 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_idstringThe unique identifier for the user within the account.
cursorstringPaging cursor, [read more about pagination](https:​//fivetran.com/docs/rest-api/pagination)
limitinteger (int32)Number of records to fetch per page. Accepts a number in the range 1..1000; the default value is 100.

SELECT examples​

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
;

INSERT examples​

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
;

UPDATE examples​

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​

Removes user membership in a connection.

DELETE FROM fivetran.users.connection_memberships
WHERE user_id = '{{ user_id }}' --required
AND connection_id = '{{ connection_id }}' --required
;