# UpdateProjectRequestAccess

## Parameters

The following URL, Headers and Parameters are required for requests to this API endpoint. Where a parameter is optional, it will be indicated. Otherwise treat all parameters as mandatory.

### Headers

```
PATCH /api/ss/request/{id}/access HTTP/1.1
Host: demo.attackforge.com
X-SSAPI-KEY: APIKey
Content-Type: application/json
Connection: close
```

### Path

**id (*****string*****)**

Id of the project.

Example:

```
PATCH /api/ss/request/5eac95f1e594ea09107e9bb5/access HTTP/1.1
```

### **Body**

**operations (*****array of objects*****)**

ACL operations to be applied.&#x20;

* type: must be either 'add' or 'remove'.
* roles: list of roles. Must be 'client', 'consultant' or 'librarymod'.
* user\_ids: list of user ids.
* group\_ids: list of group ids.
* access\_level: mandatory when adding an ACL operation. Must be either 'view', 'edit' or 'action'.

Example:

```json
{
  "operations": [
    {
      "type": "add",
      "roles": [
        "client",
        "consultant"
      ],
      "access_level": "view" 
    },
    {
      "type": "add",
      "user_ids": [
        "638fb228640930001c4705ff",
        "6662a9677ad9f6923e3fd46c"
      ],
      "access_level": "view" 
    },
    {
      "type": "add",
      "group_ids": [
        "67aafc15f6e776e62bf8aacf",
        "67aafc1bd5fb39fec060265d"
      ]
    },
    {
      "type": "remove",
      "roles": [
        "consultant"
      ]
    },
    {
      "type": "remove",
      "user_ids": [
        "638fb228640930001c4705ff"
      ]
    },
    {
      "type": "remove",
      "group_ids": [
        "67aafc1bd5fb39fec060265d"
      ]
    }
  ]
}
```

## Example

The following example is a cURL request to update access to a project request.

### Request

Include API Token instead of stars in 'X-SSAPI-KEY: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*' parameter.

```
curl -X PATCH 'https://demo.attackforge.com/api/ss/request/5eac95f1e594ea09107e9bb5/access' -H 'Host: demo.attackforge.com' -H 'X-SSAPI-KEY: ***************************************' -H 'Content-Type: application/json' -H 'Connection: close' -d '{
  "operations": [
    {
      "type": "add",
      "roles": [
        "client",
        "consultant"
      ],
      access_level: "view" 
    },
    {
      type: "add",
      user_ids: [
        "638fb228640930001c4705ff",
        "6662a9677ad9f6923e3fd46c"
      ],
      access_level: "view" 
    },
    {
      type: "add",
      group_ids: [
        "67aafc15f6e776e62bf8aacf",
        "67aafc1bd5fb39fec060265d"
      ]
    },
    {
      type: "remove",
      roles: [
        "consultant"
      ]
    },
    {
      type: "remove",
      user_ids: [
        "638fb228640930001c4705ff"
      ]
    },
    {
      type: "remove",
      group_ids: [
        "67aafc1bd5fb39fec060265d"
      ]
    }
  ]
}'
```

### Response

Response contains a status.

```
{
   "status": "ok | error",
   "error": "..."
}
```
