> Documentation index for AI agents: https://docs.pagerduty.com/llms.txt

# Regenerate a user's calendar feed URL key

`POST https://api.pagerduty.com/users/{id}/regenerate_private_url_key`

Regenerate the private URL key used to construct a user's personal iCal calendar feed URLs
(`http_cal_url` and `web_cal_url`). The old key is immediately invalidated; callers should
update any stored feed subscriptions with the new key.

A user may only regenerate their own key. Account admins may regenerate on behalf of any user.

The calendar feed URLs act as bearer credentials: anyone with the URL can read that user's
on-call calendar without further authentication. Rotate the key here whenever a URL may
have been exposed (for example, if it was shared outside the intended audience or if an
admin with `can_update_user` retrieved it via `GET /users/{id}?include[]=calendar_urls`).

Users are members of a PagerDuty account that have the ability to interact with Incidents and
other data on the account.

For more information see the [API Concepts Document](https://docs.pagerduty.com/developer/api-concepts#users)

Scoped OAuth requires: `users.write`

## Authorization

- **api_key** (apiKey) — `Authorization` header. The API Key with format `Token token=<API_KEY>`

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | The ID of the resource. |

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Accept` | string | yes | The `Accept` header is used as a versioning header. Default: `application/vnd.pagerduty+json;version=2`. |

## Response 200

The user's new private URL key.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `private_url_key` | string | yes | The newly generated private URL key for calendar feed URLs. |

Example: Response Example

```json
{
  "private_url_key": "ABCDEFGHIJKLMNOP"
}
```

## Response 401

Caller did not supply credentials or did not provide the correct credentials.
If you are using an API key, it may be invalid or your Authorization header may be malformed.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 403

Caller is not authorized to view the requested resource.
While your authentication is valid, the authenticated user or token does not have permission to perform this action.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 404

The requested resource was not found.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 429

Too many requests have been made, the rate limit has been reached.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Developer Agreement

Your access to and use of the PagerDuty Developer Services is governed by the [PagerDuty Developer Agreement](https://docs.pagerduty.com/developer/pagerduty-developer-agreement).
