Skip to main content

system_keys

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

Overview​

Namesystem_keys
TypeResource
Idfivetran.account.system_keys

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique identifier for the system key within the Fivetran system (example: key_id)
namestringThe system key name within the account (example: MySystemKey)
created_atstring (date-time)The system key creation timestamp (example: 2023-08-20T10:15:20.677566Z)
expired_atstring (date-time)The system key expiration timestamp (example: 2024-08-20T10:15:20.677566Z)
keystringThe key value of the system key (example: ft_rDefAFDSgFdAGdFG)
last_used_atstring (date-time)The timestamp of last usage (example: 2023-08-20T10:15:20.677566Z)
permissionsarray
secretstringThe secret value of rotated system key (example: uytFfdSfDADFgfCgFBVsdCSFg4fsGfFg87fhRuuFASuTHkETSfg)
updated_atstring (date-time)The system key update timestamp (example: 2023-08-20T10:15:20.677566Z)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectkey_idRetrieves a system key object within your Fivetran account.
listselectcursor, limitReturns a list of system keys within your Fivetran account.
createinsertCreates a new system key with your Fivetran account.
updateupdatekey_idUpdates an existing system key within your Fivetran account.
deletedeletekey_idDeletes a system key from your Fivetran account.
rotateexeckey_idUpdates the secret value and expired_at date for an existing system key within your Fivetran account.

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
key_idstringThe unique identifier for the system key within your Fivetran 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​

Retrieves a system key object within your Fivetran account.

SELECT
id,
name,
created_at,
expired_at,
key,
last_used_at,
permissions,
secret,
updated_at
FROM fivetran.account.system_keys
WHERE key_id = '{{ key_id }}' -- required
;

INSERT examples​

Creates a new system key with your Fivetran account.

INSERT INTO fivetran.account.system_keys (
name,
expiration_period,
permissions
)
SELECT
'{{ name }}',
'{{ expiration_period }}',
'{{ permissions }}'
RETURNING
id,
name,
created_at,
expired_at,
key,
last_used_at,
permissions,
secret,
updated_at
;

UPDATE examples​

Updates an existing system key within your Fivetran account.

UPDATE fivetran.account.system_keys
SET
name = '{{ name }}',
permissions = '{{ permissions }}'
WHERE
key_id = '{{ key_id }}' --required
RETURNING
id,
name,
created_at,
expired_at,
key,
last_used_at,
permissions,
secret,
updated_at;

DELETE examples​

Deletes a system key from your Fivetran account.

DELETE FROM fivetran.account.system_keys
WHERE key_id = '{{ key_id }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Updates the secret value and expired_at date for an existing system key within your Fivetran account.

EXEC fivetran.account.system_keys.rotate
@key_id='{{ key_id }}' --required
@@json=
'{
"expiration_period": "{{ expiration_period }}"
}'
;