Edit

Share via


External Data Shares Provider - Create External Data Share

Creates an external data share for a given path or list of paths in the specified item.

Permissions

The caller must have read and reshare permissions on the item.

Required Delegated Scopes

Item APIs can have one of these scopes in their token:

  • Generic scope: Item.ExternalDataShare.All
  • Specific scope: itemType.ExternalDataShare.All, for example: Lakehouse.ExternalDataShare.All

For more information about scopes, see scopes article.

Required Tenant Settings

To use this API, enable the External data sharing admin switch for the calling principal.

Limitations

Maximum 10 requests per minute.

Supported item types: See External data sharing in Microsoft Fabric - Supported item types.

Microsoft Entra supported identities

This API supports the Microsoft identities listed in this section.

Identity Support
User Yes
Service principal and Managed identities Yes

Interface

POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items/{itemId}/externalDataShares

URI Parameters

Name In Required Type Description
itemId
path True

string (uuid)

The item ID.

workspaceId
path True

string (uuid)

The workspace ID.

Request Body

Name Required Type Description
paths True

string[]

The path or list of paths that are to be externally shared. You can share up to 100 paths in each share. A valid path to an external data share must start with "Files/" or "Tables/". You can't share the root folder itself (Files or Tables).

For example, these paths are valid:

  • "Files/MyFolder1"

  • "Tables/MySchema"

  • "Tables/MyTable1"

recipient True

ExternalDataShareRecipient

The recipient who is invited to accept the external data share.

Responses

Name Type Description
201 Created

ExternalDataShare

Successfully created.

Headers

Location: string

Other Status Codes

ErrorResponse

Common error codes:

  • UnknownError - An error occurred.

Examples

Create an external data share example
Create an external data share with a specific recipient tenant ID example
Create an external data share with multiple paths example

Create an external data share example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff229/items/5b218778-e7a5-4d73-8187-f10824047715/externalDataShares

{
  "paths": [
    "Files/Sales/Contoso_Sales_2023"
  ],
  "recipient": {
    "userPrincipalName": "lisa@fabrikam.com"
  }
}

Sample response

Location: https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff229/items/5b218778-e7a5-4d73-8187-f10824047715/externalDataShares/dccc162f-7a41-4720-83c3-5c7e81187959
{
  "id": "dccc162f-7a41-4720-83c3-5c7e81187959",
  "paths": [
    "Files/Sales/Contoso_Sales_2023"
  ],
  "creatorPrincipal": {
    "id": "f3052d1c-61a9-46fb-8df9-0d78916ae041",
    "type": "User"
  },
  "recipient": {
    "userPrincipalName": "lisa@fabrikam.com"
  },
  "status": "Pending",
  "expirationTimeUtc": "2024-12-13T00:00:00.000Z",
  "workspaceId": "cfafbeb1-8037-4d0c-896e-a46fb27ff229",
  "itemId": "5b218778-e7a5-4d73-8187-f10824047715",
  "invitationUrl": "https://app.fabric.microsoft.com/externaldatasharing/accept?providerTenantId=34f92457-fe9d-4c36-92a8-499fdfaf0f8f&shareId=dccc162f-7a41-4720-83c3-5c7e81187959"
}

Create an external data share with a specific recipient tenant ID example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff229/items/5b218778-e7a5-4d73-8187-f10824047715/externalDataShares

{
  "paths": [
    "Files/Sales/Contoso_Sales_2023"
  ],
  "recipient": {
    "userPrincipalName": "lisa@fabrikam.com",
    "tenantId": "c51dc03f-268a-4da0-a879-25f24947ab8b"
  }
}

Sample response

Location: https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff229/items/5b218778-e7a5-4d73-8187-f10824047715/externalDataShares/dccc162f-7a41-4720-83c3-5c7e81187959
{
  "id": "dccc162f-7a41-4720-83c3-5c7e81187959",
  "paths": [
    "Files/Sales/Contoso_Sales_2023"
  ],
  "creatorPrincipal": {
    "id": "f3052d1c-61a9-46fb-8df9-0d78916ae041",
    "type": "User"
  },
  "recipient": {
    "userPrincipalName": "lisa@fabrikam.com",
    "tenantId": "c51dc03f-268a-4da0-a879-25f24947ab8b"
  },
  "status": "Pending",
  "expirationTimeUtc": "2024-12-13T00:00:00.000Z",
  "workspaceId": "cfafbeb1-8037-4d0c-896e-a46fb27ff229",
  "itemId": "5b218778-e7a5-4d73-8187-f10824047715",
  "invitationUrl": "https://app.fabric.microsoft.com/externaldatasharing/accept?providerTenantId=34f92457-fe9d-4c36-92a8-499fdfaf0f8f&shareId=dccc162f-7a41-4720-83c3-5c7e81187959"
}

Create an external data share with multiple paths example

Sample request

POST https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff229/items/5b218778-e7a5-4d73-8187-f10824047715/externalDataShares

{
  "paths": [
    "Files/Sales/Contoso_Sales_2023",
    "Files/Sales/Contoso_Sales_2024/SubFolder1",
    "Files/Sales/Contoso_Sales_2024/SubFolder2/SubFolder3"
  ],
  "recipient": {
    "userPrincipalName": "lisa@fabrikam.com"
  }
}

Sample response

Location: https://api.fabric.microsoft.com/v1/workspaces/cfafbeb1-8037-4d0c-896e-a46fb27ff229/items/5b218778-e7a5-4d73-8187-f10824047715/externalDataShares/dccc162f-7a41-4720-83c3-5c7e81187959
{
  "id": "dccc162f-7a41-4720-83c3-5c7e81187959",
  "paths": [
    "Files/Sales/Contoso_Sales_2023",
    "Files/Sales/Contoso_Sales_2024/SubFolder1",
    "Files/Sales/Contoso_Sales_2024/SubFolder2/SubFolder3"
  ],
  "creatorPrincipal": {
    "id": "f3052d1c-61a9-46fb-8df9-0d78916ae041",
    "type": "User"
  },
  "recipient": {
    "userPrincipalName": "lisa@fabrikam.com"
  },
  "status": "Pending",
  "expirationTimeUtc": "2024-12-13T00:00:00.000Z",
  "workspaceId": "cfafbeb1-8037-4d0c-896e-a46fb27ff229",
  "itemId": "5b218778-e7a5-4d73-8187-f10824047715",
  "invitationUrl": "https://app.fabric.microsoft.com/externaldatasharing/accept?providerTenantId=34f92457-fe9d-4c36-92a8-499fdfaf0f8f&shareId=dccc162f-7a41-4720-83c3-5c7e81187959"
}

Definitions

Name Description
CreateExternalDataShareRequest

The request payload for creating an external data share.

ErrorRelatedResource

The error related resource details object.

ErrorResponse

The error response.

ErrorResponseDetails

The error response details.

ExternalDataShare

An external data share object.

ExternalDataShareRecipient

A representation of the the external data share recipient.

ExternalDataShareStatus

The status of a given external data share. Additional ExternalDataShareStatus types may be added over time.

GroupDetails

Group specific details. Applicable when the principal type is Group.

GroupType

The type of the group. Additional group types may be added over time.

Principal

Represents an identity or a Microsoft Entra group.

PrincipalType

The type of the principal. Additional principal types may be added over time.

ServicePrincipalDetails

Service principal specific details. Applicable when the principal type is ServicePrincipal.

ServicePrincipalProfileDetails

Service principal profile details. Applicable when the principal type is ServicePrincipalProfile.

UserDetails

User principal specific details. Applicable when the principal type is User.

CreateExternalDataShareRequest

The request payload for creating an external data share.

Name Type Description
paths

string[]

The path or list of paths that are to be externally shared. You can share up to 100 paths in each share. A valid path to an external data share must start with "Files/" or "Tables/". You can't share the root folder itself (Files or Tables).

For example, these paths are valid:

  • "Files/MyFolder1"

  • "Tables/MySchema"

  • "Tables/MyTable1"

recipient

ExternalDataShareRecipient

The recipient who is invited to accept the external data share.

ErrorRelatedResource

The error related resource details object.

Name Type Description
resourceId

string

The resource ID that's involved in the error.

resourceType

string

The type of the resource that's involved in the error.

ErrorResponse

The error response.

Name Type Description
errorCode

string

A specific identifier that provides information about an error condition, allowing for standardized communication between our service and its users.

message

string

A human readable representation of the error.

moreDetails

ErrorResponseDetails[]

List of additional error details.

relatedResource

ErrorRelatedResource

The error related resource details.

requestId

string

ID of the request associated with the error.

ErrorResponseDetails

The error response details.

Name Type Description
errorCode

string

A specific identifier that provides information about an error condition, allowing for standardized communication between our service and its users.

message

string

A human readable representation of the error.

relatedResource

ErrorRelatedResource

The error related resource details.

ExternalDataShare

An external data share object.

Name Type Description
acceptedByTenantId

string (uuid)

The tenant ID in which the external data share was accepted.

creatorPrincipal

Principal

The principal that created the external data share.

expirationTimeUtc

string (date-time)

The expiration date and time (UTC) of the invitation to the external data share.

id

string (uuid)

The external data share ID.

invitationUrl

string (uri)

The URL for accepting the invitation to the external data share.

itemId

string (uuid)

The item ID.

paths

string[]

The path or list of paths that are externally shared.

recipient

ExternalDataShareRecipient

The recipient who was invited to accept the external data share.

status

ExternalDataShareStatus

The status of the external data share.

workspaceId

string (uuid)

The workspace ID.

ExternalDataShareRecipient

A representation of the the external data share recipient.

Name Type Description
tenantId

string (uuid)

The recipient's tenant ID.

userPrincipalName

string

maxLength: 256

The recipient's email address.

ExternalDataShareStatus

The status of a given external data share. Additional ExternalDataShareStatus types may be added over time.

Value Description
Pending

An invitation was created and is now pending acceptance by the recipient.

Active

The invitation has been accepted by the recipient and the external data share is active.

Revoked

The external data share was revoked.

InvitationExpired

The invitation expired and can no longer be accepted by the recipient.

GroupDetails

Group specific details. Applicable when the principal type is Group.

Name Type Description
groupType

GroupType

The type of the group. Additional group types may be added over time.

GroupType

The type of the group. Additional group types may be added over time.

Value Description
Unknown

Principal group type is unknown.

SecurityGroup

Principal is a security group.

DistributionList

Principal is a distribution list.

Principal

Represents an identity or a Microsoft Entra group.

Name Type Description
displayName

string

The principal's display name.

groupDetails

GroupDetails

Group specific details. Applicable when the principal type is Group.

id

string (uuid)

The principal's ID.

servicePrincipalDetails

ServicePrincipalDetails

Service principal specific details. Applicable when the principal type is ServicePrincipal.

servicePrincipalProfileDetails

ServicePrincipalProfileDetails

Service principal profile details. Applicable when the principal type is ServicePrincipalProfile.

type

PrincipalType

The type of the principal. Additional principal types may be added over time.

userDetails

UserDetails

User principal specific details. Applicable when the principal type is User.

PrincipalType

The type of the principal. Additional principal types may be added over time.

Value Description
User

Principal is a Microsoft Entra user principal.

ServicePrincipal

Principal is a Microsoft Entra service principal.

Group

Principal is a security group.

ServicePrincipalProfile

Principal is a service principal profile.

EntireTenant

Principal represents all tenant users.

ServicePrincipalDetails

Service principal specific details. Applicable when the principal type is ServicePrincipal.

Name Type Description
aadAppId

string (uuid)

The service principal's Microsoft Entra AppId.

ServicePrincipalProfileDetails

Service principal profile details. Applicable when the principal type is ServicePrincipalProfile.

Name Type Description
parentPrincipal

Principal

The service principal profile's parent principal.

UserDetails

User principal specific details. Applicable when the principal type is User.

Name Type Description
userPrincipalName

string

The user principal name.