Skip to main content

Create Share Permissions for a Source

Creates a share permission for a source (i.e., the specified user or group is given access to the source).

Authorizations: Sources - ACCESS

Requests

POST /apis/sources/:sourceId/shares
{
"id": "a78758cc-48da-47ad-bc6e-6c8564badb7e",
"shareType": "USER",
"permission": "EDIT",
"name": "viewer"
}

Parameters

Property

JSON Type

Property Type

Description

id

UUID

Immutable

Group ID or user ID. Identifies the share entity.

shareType

String

Required

Immutable

Accepted values, GROUP or USER:

  • GROUP: the share grants access to the members of a group.
  • USER: the share grants access to a specific user.

permission

String

Required

Permission level granted to the group or user. Accepted values: WATCH, EDIT, OWN, or <uuid> of admin-defined access permission.

name

String

Optional

Group name or user name.

Note

Either id or name must be present. If both are provided, id is used. See User Resources and Group Resources.

Response

Success

{
"data": {
"id": "a78758cc-48da-47ad-bc6e-6c8564badb7e",
"shareType": "USER",
"permission": "EDIT",
"name": "viewer",
"email": null
}
}

Error

Code

Payload

 Description

400
{"code":"010001", "name":"InputValidation",
"message":<Error message>,
"httpStatusCode":400}

Supplied data was insufficient or incorrect.

404
{"code":"040009", "name":"SourceNotFound",
"message":"Source not found",
"httpStatusCode":404}

Source with UUID sourceId not found.

404
{"code":"040004", "name":"UserNotFound",
"message":"User not found",
"httpStatusCode":404}

The user with provided id or username was not found.

404
{"code":"040005", "name":"GroupNotFound",
"message":"Group not found",
"httpStatusCode":404}

The group with provided id or groupname was not found.

409
{"code":"060001", "name":"UserHasNoRoles",
"message":"User has no roles assigned",
"httpStatusCode":409}

Make sure a role is assigned to the user or to at least one of the user's groups.

409
{"code":"060002", "name":"GroupHasNoRoles",
"message":"Group has no roles assigned",
"httpStatusCode":409}

Make sure a role is assigned to the group.

500
{"code":"070008", "name":"FindUser",
"message":"Error searching for a user",
"httpStatusCode":500}

An internal  error occurred while searching for user.

500
{"code":"070009", "name":"FindGroup",
"message":"Error searching for a group",
"httpStatusCode":500}

An internal  error occurred while searching for group.

 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.