> ## Documentation Index
> Fetch the complete documentation index at: https://velt.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Permission Provider Config

Use this API to update the permission provider configuration for a workspace. At least one of `usePermissionProvider` or `permissionProviderConfig` must be provided. The config is merged with the existing value, so e.g. the `authToken` is preserved when only the URL changes.

> [!NOTE]
>
> This endpoint uses **API-key-level auth**: pass `x-velt-api-key` and `x-velt-auth-token` as headers. You can obtain these from the [Get Auth Tokens](https://velt.dev/docs/api-reference/rest-apis/v2/workspace/authtokens-get.md) endpoint.

> [!NOTE]
>
> **Defaults on first enable.** If you enable the provider (`usePermissionProvider: true`) and no `permissionProviderConfig` exists yet, an empty config is seeded (`permissionProviderUrl` and `authToken` set to empty strings) and returned in the response `data`. Any `permissionProviderConfig` values you send in the same request are merged on top.

# Endpoint

`POST https://api.velt.dev/v2/workspace/permissionproviderconfig/update`

# Headers

**x-velt-api-key** `string` *required*

Your API key.

**x-velt-auth-token** `string` *required*

Your [Auth Token](https://velt.dev/docs/security/auth-tokens.md).

# Body

#### Params

**data** `object` *required*

**properties**

**usePermissionProvider** `boolean`

Whether to enable the permission provider.

**permissionProviderConfig** `object`

Permission provider configuration object.

**properties**

**permissionProviderUrl** `string`

Provider URL. Must be an empty string (to clear the value) or a valid `http`/`https` URL. Any other value is rejected.

**authToken** `string`

Auth token sent to the permission provider.

# Example Request

```JSON theme={null}
{
  "data": {
    "usePermissionProvider": true,
    "permissionProviderConfig": {
      "permissionProviderUrl": "https://example.com/permissions",
      "authToken": "provider_auth_token_here"
    }
  }
}
```

# Example Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Permission provider configuration updated successfully."
  }
}
```

#### Failure Response

##### If permissionProviderUrl is not empty and not a valid http(s) URL

```JSON theme={null}
{
  "error": {
    "status": "INVALID_ARGUMENT",
    "message": "Please enter a valid URL"
  }
}
```

```js theme={null}
{
  "result": {
    "status": "success",
    "message": "Permission provider configuration updated successfully."
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.