Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Add user to group

PUT /groups/{id}/users/{uid}

Adds user {uid} as member of group {id}. Optional privileges can be passed in the request body, otherwise default privileges will be set for the user in this group.

This operation can only be invoked by the user {uid} to add himself to the group (if he is not a member already) and requires group_add_user privilege in the group. If privileges are specified in the request, group_set_privileges privilege is also required.

Administrators having the oz_groups_add_relationships and oz_users_add_relationships admin privileges can add any user to any group, though oz_groups_set_privileges privilege is required if privileges are specified in the request.

Example cURL requests

Generate user group invite token

curl -u admin:password -X PUT \
https://$HOST/api/v3/onezone/groups/$GROUP_ID/users/$USER_ID

Path parameters

Parameter Type & Description
id required
string

Group Id.

uid required
string

User Id.

Request body

PropertyType & Description
privileges
array of strings

A list of privileges in the group.

Request Examples

Shell
onezone-rest-cli addGroupUser id=a4d3bc73aada63052310652d421609f1 uid=a5b469a2b0516b662a49da74d6d7d7bc

Responses

application/json
201

URI of the added user in form https://$HOST/api/onezone/v3/groups/{id}/users/{uid} is returned in the response Location header.

400

Invalid request.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
401

Authentication error.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
403

Authorization error.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
404

Resource not found.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
500

Internal server Error.

PropertyType & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}