# Recipients ## List share recipients by share ID `client.resourceSharing.recipients.list(stringshareID, RecipientListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/shares/{share_id}/recipients` List share recipients by share ID. ### Parameters - `shareID: string` Share identifier tag. - `params: RecipientListParams` - `account_id: string` Path param: Account identifier. - `include_resources?: boolean` Query param: Include resources in the response. - `page?: number` Query param: Page number. Defaults to `1` when `per_page` is supplied without `page`. May be omitted entirely along with `per_page` to receive a non-paginated response. - `per_page?: number` Query param: Number of objects to return per page. Defaults to `20` when `page` is supplied without `per_page`. May be omitted entirely along with `page` to receive a non-paginated response. ### Returns - `RecipientListResponse` - `id: string` Share Recipient identifier tag. - `account_id: string` Account identifier. - `association_status: "associating" | "associated" | "disassociating" | "disassociated"` Share Recipient association status. - `"associating"` - `"associated"` - `"disassociating"` - `"disassociated"` - `created: string` When the share was created. - `modified: string` When the share was modified. - `resources?: Array` - `error: string` Share Recipient error message. - `resource_id: string` Share Resource identifier. - `resource_version: number` Resource Version. - `terminal: boolean` Whether the error is terminal or will be continually retried. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const recipientListResponse of client.resourceSharing.recipients.list( '3fd85f74b32742f1bff64a85009dda07', { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, )) { console.log(recipientListResponse.id); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "id": "3fd85f74b32742f1bff64a85009dda07", "account_id": "023e105f4ecef8ad9ca31a8372d0c353", "association_status": "associating", "created": "2023-09-21T18:56:32.624632Z", "modified": "2023-09-21T18:56:32.624632Z", "resources": [ { "error": "Recipient is missing necessary entitlement", "resource_id": "023e105f4ecef8ad9ca31a8372d0c353", "resource_version": 0, "terminal": true } ] } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 50 } } ``` ## Get share recipient by ID `client.resourceSharing.recipients.get(stringrecipientID, RecipientGetParamsparams, RequestOptionsoptions?): RecipientGetResponse` **get** `/accounts/{account_id}/shares/{share_id}/recipients/{recipient_id}` Get share recipient by ID. ### Parameters - `recipientID: string` Share Recipient identifier tag. - `params: RecipientGetParams` - `account_id: string` Path param: Account identifier. - `share_id: string` Path param: Share identifier tag. - `include_resources?: boolean` Query param: Include resources in the response. ### Returns - `RecipientGetResponse` - `id: string` Share Recipient identifier tag. - `account_id: string` Account identifier. - `association_status: "associating" | "associated" | "disassociating" | "disassociated"` Share Recipient association status. - `"associating"` - `"associated"` - `"disassociating"` - `"disassociated"` - `created: string` When the share was created. - `modified: string` When the share was modified. - `resources?: Array` - `error: string` Share Recipient error message. - `resource_id: string` Share Resource identifier. - `resource_version: number` Resource Version. - `terminal: boolean` Whether the error is terminal or will be continually retried. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const recipient = await client.resourceSharing.recipients.get('3fd85f74b32742f1bff64a85009dda07', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', share_id: '3fd85f74b32742f1bff64a85009dda07', }); console.log(recipient.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "3fd85f74b32742f1bff64a85009dda07", "account_id": "023e105f4ecef8ad9ca31a8372d0c353", "association_status": "associating", "created": "2023-09-21T18:56:32.624632Z", "modified": "2023-09-21T18:56:32.624632Z", "resources": [ { "error": "Recipient is missing necessary entitlement", "resource_id": "023e105f4ecef8ad9ca31a8372d0c353", "resource_version": 0, "terminal": true } ] } } ``` ## Create a new share recipient `client.resourceSharing.recipients.create(stringshareID, RecipientCreateParamsparams, RequestOptionsoptions?): RecipientCreateResponse` **post** `/accounts/{account_id}/shares/{share_id}/recipients` Adds a recipient to a resource share, granting them access to the shared resources. ### Parameters - `shareID: string` Share identifier tag. - `params: RecipientCreateParams` - `body_account_id?: string` Body param: Deprecated alias for `recipient_account_id`. Use `recipient_account_id` instead. The body field collided with the URL path parameter of the same name, which prevented SDK generators from distinguishing the source account (in the URL) from the recipient account (in the body). Both names will continue to be accepted until 2027-05-26 (see `x-sunset`). - `organization_id?: string` Body param: Organization identifier. - `recipient_account_id?: string` Body param: The account that will receive the share. ### Returns - `RecipientCreateResponse` - `id: string` Share Recipient identifier tag. - `account_id: string` Account identifier. - `association_status: "associating" | "associated" | "disassociating" | "disassociated"` Share Recipient association status. - `"associating"` - `"associated"` - `"disassociating"` - `"disassociated"` - `created: string` When the share was created. - `modified: string` When the share was modified. - `resources?: Array` - `error: string` Share Recipient error message. - `resource_id: string` Share Resource identifier. - `resource_version: number` Resource Version. - `terminal: boolean` Whether the error is terminal or will be continually retried. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const recipient = await client.resourceSharing.recipients.create( '3fd85f74b32742f1bff64a85009dda07', { path_account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, ); console.log(recipient.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "3fd85f74b32742f1bff64a85009dda07", "account_id": "023e105f4ecef8ad9ca31a8372d0c353", "association_status": "associating", "created": "2023-09-21T18:56:32.624632Z", "modified": "2023-09-21T18:56:32.624632Z", "resources": [ { "error": "Recipient is missing necessary entitlement", "resource_id": "023e105f4ecef8ad9ca31a8372d0c353", "resource_version": 0, "terminal": true } ] } } ``` ## Delete a share recipient `client.resourceSharing.recipients.delete(stringrecipientID, RecipientDeleteParamsparams, RequestOptionsoptions?): RecipientDeleteResponse` **delete** `/accounts/{account_id}/shares/{share_id}/recipients/{recipient_id}` Deletion is not immediate, an updated share recipient object with a new status will be returned. ### Parameters - `recipientID: string` Share Recipient identifier tag. - `params: RecipientDeleteParams` - `account_id: string` Account identifier. - `share_id: string` Share identifier tag. ### Returns - `RecipientDeleteResponse` - `id: string` Share Recipient identifier tag. - `account_id: string` Account identifier. - `association_status: "associating" | "associated" | "disassociating" | "disassociated"` Share Recipient association status. - `"associating"` - `"associated"` - `"disassociating"` - `"disassociated"` - `created: string` When the share was created. - `modified: string` When the share was modified. - `resources?: Array` - `error: string` Share Recipient error message. - `resource_id: string` Share Resource identifier. - `resource_version: number` Resource Version. - `terminal: boolean` Whether the error is terminal or will be continually retried. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const recipient = await client.resourceSharing.recipients.delete( '3fd85f74b32742f1bff64a85009dda07', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', share_id: '3fd85f74b32742f1bff64a85009dda07' }, ); console.log(recipient.id); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "3fd85f74b32742f1bff64a85009dda07", "account_id": "023e105f4ecef8ad9ca31a8372d0c353", "association_status": "associating", "created": "2023-09-21T18:56:32.624632Z", "modified": "2023-09-21T18:56:32.624632Z", "resources": [ { "error": "Recipient is missing necessary entitlement", "resource_id": "023e105f4ecef8ad9ca31a8372d0c353", "resource_version": 0, "terminal": true } ] } } ``` ## Domain Types ### Recipient List Response - `RecipientListResponse` - `id: string` Share Recipient identifier tag. - `account_id: string` Account identifier. - `association_status: "associating" | "associated" | "disassociating" | "disassociated"` Share Recipient association status. - `"associating"` - `"associated"` - `"disassociating"` - `"disassociated"` - `created: string` When the share was created. - `modified: string` When the share was modified. - `resources?: Array` - `error: string` Share Recipient error message. - `resource_id: string` Share Resource identifier. - `resource_version: number` Resource Version. - `terminal: boolean` Whether the error is terminal or will be continually retried. ### Recipient Get Response - `RecipientGetResponse` - `id: string` Share Recipient identifier tag. - `account_id: string` Account identifier. - `association_status: "associating" | "associated" | "disassociating" | "disassociated"` Share Recipient association status. - `"associating"` - `"associated"` - `"disassociating"` - `"disassociated"` - `created: string` When the share was created. - `modified: string` When the share was modified. - `resources?: Array` - `error: string` Share Recipient error message. - `resource_id: string` Share Resource identifier. - `resource_version: number` Resource Version. - `terminal: boolean` Whether the error is terminal or will be continually retried. ### Recipient Create Response - `RecipientCreateResponse` - `id: string` Share Recipient identifier tag. - `account_id: string` Account identifier. - `association_status: "associating" | "associated" | "disassociating" | "disassociated"` Share Recipient association status. - `"associating"` - `"associated"` - `"disassociating"` - `"disassociated"` - `created: string` When the share was created. - `modified: string` When the share was modified. - `resources?: Array` - `error: string` Share Recipient error message. - `resource_id: string` Share Resource identifier. - `resource_version: number` Resource Version. - `terminal: boolean` Whether the error is terminal or will be continually retried. ### Recipient Delete Response - `RecipientDeleteResponse` - `id: string` Share Recipient identifier tag. - `account_id: string` Account identifier. - `association_status: "associating" | "associated" | "disassociating" | "disassociated"` Share Recipient association status. - `"associating"` - `"associated"` - `"disassociating"` - `"disassociated"` - `created: string` When the share was created. - `modified: string` When the share was modified. - `resources?: Array` - `error: string` Share Recipient error message. - `resource_id: string` Share Resource identifier. - `resource_version: number` Resource Version. - `terminal: boolean` Whether the error is terminal or will be continually retried.