# Post Servicepermissions

## Request

```CURL
POST [[[<REST API URL>|Hub-Rest-Api-URL.html]]]/roles/role id/servicepermissions?add=boolean&amp;remove=boolean
```

|  Parameter  |  Description  |
| --- | --- |
|  `add`  |                              Query parameter of type boolean.  |
|  `remove`  |                              Query parameter of type boolean.  |

### Request Body

#### service

extends [authorityHolder](HUB-REST-API_JSON-Scheme.html#authorityHolder)

```JSON
{
  "key": string, 
  "homeUrl": string, 
  "baseUrls": [string, ...], 
  "userUriPattern": string, 
  "groupUriPattern": string, 
  "redirectUris": [string, ...], 
  "audienceSwitchTargets": [[[[service|HUB-REST-API_JSON-Scheme.html#service]]], ...], 
  "untrustedRedirectUris": [[[[untrustedRedirectURI|HUB-REST-API_JSON-Scheme.html#untrustedRedirectURI]]], ...], 
  "applicationName": string, 
  "description": string, 
  "vendor": string, 
  "releaseDate": calendar, 
  "version": string, 
  "audience": string, 
  "iconUrl": string, 
  "permissions": [[[[permission|HUB-REST-API_JSON-Scheme.html#permission]]], ...], 
  "defaultRoles": [[[[role|HUB-REST-API_JSON-Scheme.html#role]]], ...], 
  "viewers": [[[[authorityHolder|HUB-REST-API_JSON-Scheme.html#authorityHolder]]], ...], 
  "trusted": boolean, 
  "consentRequired": boolean, 
  "immutable": boolean, 
  "secret": string, 
  "apiVersion": string, 
  "scopeItems": [string, ...], 
  "clientCredentialsFlowEnabled": boolean, 
  "authCodeFlowEnabled": boolean, 
  "pkceRequired": boolean, 
  "implicitFlowEnabled": boolean, 
  "resourceOwnerFlowEnabled": boolean, 
  "orgId": string, 
    "name": string , 
    "projectRoles": [[[[projectRole|HUB-REST-API_JSON-Scheme.html#projectRole]]], ...] , 
    "transitiveProjectRoles": [[[[projectRole|HUB-REST-API_JSON-Scheme.html#projectRole]]], ...] , 
    "sourcedProjectRoles": [[[[sourcedProjectRole|HUB-REST-API_JSON-Scheme.html#sourcedProjectRole]]], ...] , 
    "id": string , 
    "aliases": [[[[alias|HUB-REST-API_JSON-Scheme.html#alias]]], ...] 
}
```

## Response

|  Response Code  |  Meaning  |
| --- | --- |
|  200 OK  |  Successful request.  |
|  400 Bad Request  |  At least one of the request parameters is invalid. For example, a required field in the passed JSON object is missing. For details, check the error message in the response.  |
|  403 Forbidden  |  The requester has no access to the requested resource.  |
|  404 Not Found  |  The requested resource was not found.  |
|  500 Internal Server Error  |  Failed to process request because of the server error. For details, check the error message in the response.  |

### Response body

```JSON
{
  "key": string, 
  "name": string, 
  "description": string, 
  "permissions": [[[[permission|HUB-REST-API_JSON-Scheme.html#permission]]], ...], 
    "id": string , 
    "aliases": [[[[alias|HUB-REST-API_JSON-Scheme.html#alias]]], ...] 
}
```

