Skip to main content

recipients

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

Overview

Namerecipients
TypeResource
Idcloudflare.resource_sharing.recipients

Fields

The following fields are returned by SELECT queries:

Get account share recipient response.

NameDatatypeDescription
idstringShare Recipient identifier tag. (example: 3fd85f74b32742f1bff64a85009dda07)
account_idstringAccount identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353)
association_statusstringShare Recipient association status. (associating, associated, disassociating, disassociated)
createdstring (date-time)When the share was created. (example: 2023-09-21T18:56:32.624632Z)
modifiedstring (date-time)When the share was modified. (example: 2023-09-21T18:56:32.624632Z)
resourcesarray

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, share_id, recipient_idinclude_resourcesGet share recipient by ID.
listselectaccount_id, share_idinclude_resources, page, per_pageList share recipients by share ID.
share_recipient_createinsertaccount_id, share_idAdds a recipient to a resource share, granting them access to the shared resources.
share_recipients_updatereplaceaccount_id, share_idChanges a share's recipients to match the given list. Returns an error if the share targets an organization.
deletedeleteaccount_id, share_id, recipient_idDeletion is not immediate, an updated share recipient object with a new status will be returned.

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
account_idstringThe Cloudflare account ID.
recipient_idstring
share_idstring
include_resourcesbooleanInclude resources in the response.
pageintegerPage number.
per_pageintegerNumber of objects to return per page.

SELECT examples

Get share recipient by ID.

SELECT
id,
account_id,
association_status,
created,
modified,
resources
FROM cloudflare.resource_sharing.recipients
WHERE account_id = '{{ account_id }}' -- required
AND share_id = '{{ share_id }}' -- required
AND recipient_id = '{{ recipient_id }}' -- required
AND include_resources = '{{ include_resources }}'
;

INSERT examples

Adds a recipient to a resource share, granting them access to the shared resources.

INSERT INTO cloudflare.resource_sharing.recipients (
account_id,
organization_id,
account_id,
share_id
)
SELECT
'{{ account_id }}',
'{{ organization_id }}',
'{{ account_id }}',
'{{ share_id }}'
RETURNING
errors,
result,
success
;

REPLACE examples

Changes a share's recipients to match the given list. Returns an error if the share targets an organization.

REPLACE cloudflare.resource_sharing.recipients
SET
-- No updatable properties
WHERE
account_id = '{{ account_id }}' --required
AND share_id = '{{ share_id }}' --required;

DELETE examples

Deletion is not immediate, an updated share recipient object with a new status will be returned.

DELETE FROM cloudflare.resource_sharing.recipients
WHERE account_id = '{{ account_id }}' --required
AND share_id = '{{ share_id }}' --required
AND recipient_id = '{{ recipient_id }}' --required
;