Gateways - Add Datasource User
Grants or updates the permissions required to use the specified datasource for the specified user.
Required scope: Dataset.ReadWrite.All
To set the permissions scope, see Register an app.
POST https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId}/users
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
gateway
|
path | True |
|
The gateway id |
datasource
|
path | True |
|
The datasource id |
Request Body
Name | Required | Type | Description |
---|---|---|---|
datasourceAccessRight | True |
The user access rights for the datasource. |
|
displayName |
|
Display name of the principal |
|
emailAddress |
|
Email address of the user |
|
identifier |
|
Identifier of the principal |
|
principalType |
The principal type |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK |
Examples
example |
example for giving Read |
example
Sample Request
POST https://api.powerbi.com/v1.0/myorg/gateways/1f69e798-5852-4fdd-ab01-33bb14b6e934/datasources/252b9de8-d915-4788-aaeb-ec8c2395f970/users
{
"emailAddress": "john@contoso.com",
"datasourceAccessRight": "Read"
}
Sample Response
example for giving ReadOverrideEffectiveIdentity access right to a service principal
Sample Request
POST https://api.powerbi.com/v1.0/myorg/gateways/1f69e798-5852-4fdd-ab01-33bb14b6e934/datasources/252b9de8-d915-4788-aaeb-ec8c2395f970/users
{
"identifier": "3d9b93c6-7b6d-4801-a491-1738910904fd",
"datasourceAccessRight": "ReadOverrideEffectiveIdentity"
}
Sample Response
Definitions
Datasource |
A Power BI user access right entry for datasource |
Datasource |
The user access rights for the datasource. |
Principal |
The principal type |
DatasourceUser
A Power BI user access right entry for datasource
Name | Type | Description |
---|---|---|
datasourceAccessRight |
The user access rights for the datasource. |
|
displayName |
|
Display name of the principal |
emailAddress |
|
Email address of the user |
identifier |
|
Identifier of the principal |
principalType |
The principal type |
DatasourceUserAccessRight
The user access rights for the datasource.
Name | Type | Description |
---|---|---|
None |
|
Removes permission to access the datasource. Only applies when updating user permissions. |
Read |
|
Indicates that datasets owned by the user has read access to this datasource. |
ReadOverrideEffectiveIdentity |
|
Indicates that user can override effective identity for Power BI Embedded. |
PrincipalType
The principal type
Name | Type | Description |
---|---|---|
App |
|
Service principal type |
Group |
|
Group principal type |
User |
|
User principal type |