Add Group

General Information


ServiceAPIMethod
urac/admin/group/addPOST


Data Model: Groups

Workflow: Add Group Flow

Input


Type: application/json
NameSourceMandatoryTypeSpecial FormatDescription
codeBodyYESStringAlphanumeric - String - 20 letters Maximum
nameBodyYESStringN/A
descriptionBodyYESStringN/A
configBodyYESObjectN/A

allowedPackages
YESObjectN/A


^([A-Za-z0-9]+)$
YESArray of strings

Then keys should follow the pattern : 
^([A-Za-z0-9]+)$



allowedEnvironments
NOObjectN/A


^([A-Za-z]+)$
YESObjectN/Afor it is just an empty object


Output


Valid Response

Valid Response Sample
{
	"result": true,
	"data": true
}


Invalid Response

Error Response Sample
{
    "result":false,
    "errors":{
        "codes":[421],
        "details":[
            {
                "code":421,
                "message":"Group code already exists. Choose another"
            }
        ]
    }
}



Error Codes



Code
Description
400Database connection error
421Group code already exists. Choose another
611invalid tenant id provided


Example (CURL)


Request

Calling Add Group API
 > CURL -X POST http://127.0.0.1:4000/urac/admin/group/add -d {
	"code": "silver",
	"name": "Silver Group",
	"description": "grp description",
	"config": {
		"allowedPackages": {
			"prod": ["pack"]
		},
		"allowedEnvironments": {
			"PROD": {}
		}
	}
} 

Response

Add Group API response
{
	"result": true,
	"data": {
		"code": "ADMIN",
		"name": "Administration",
		"description": "This is the admin group etc...",
		"config": {
			"allowedPackages": {
				"MOBI": ["MOBI_BASIC"]
			}
		},
		"tenant": {
			"id": "5cadea196d44342107efe52c",
			"code": "TEST"
		},
		"_id": "5cc835c0d7fc2f9c75b9f5ed"
	}
}