# Set directory provisioning

Sets whether a directory sync invites the people it finds (`autoInvite`) and which seat those invites carry (`defaultRole`: admin, team_lead or member - never owner). Both fields are optional and an absent one is left alone. Reach for it to switch automatic provisioning on or off for a connected Google or Microsoft domain.

Access class: `workspace:admin`.

## Endpoint

`PUT /v1/workspace/directory/provisioning`

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "autoInvite": true,
    "defaultRole": "string",
    "provider": "string"
  },
  "params": {},
  "query": {
    "provider": "string"
  }
}
```

## Responses

### 200

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "autoInvite": true,
    "defaultRole": "string",
    "lastSyncedAt": "string",
    "provider": "string"
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
