---
title: "Moves the customer's subscription to the endpoint and keys its browser renewed it with, in one step, keeping what was pushed to it."
---

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

Path: Sherpo customer API › profile

`POST /v1/stores/{store}/push_subscriptions/renew`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `profile:write`

## Path parameters

- `store` (`renewPushSubscription.path.store`; string, required) — A hostname of the store.

## Request body

_Required._

- `endpoint` (`renewPushSubscription.endpoint`; string, required) — The push service URL the browser's subscription names.
  - minLength 1; maxLength 1024
- `keys` (`renewPushSubscription.keys`; object, required) — The subscription's keys, as the browser hands them over.
  - `p256dh` (`renewPushSubscription.keys.p256dh`; string, required) — The browser's P-256 public key, base64url.
    - minLength 1; maxLength 128
  - `auth` (`renewPushSubscription.keys.auth`; string, required) — The browser's authentication secret, base64url.
    - minLength 1; maxLength 64
- `old` (`renewPushSubscription.old`; string, required) — The push service URL the caller's subscription named before the browser renewed it.
  - minLength 1; maxLength 1024
- `revision` (`renewPushSubscription.revision`; any of, optional) — The revision the caller's last write of this browser answered, or null for none; refused once another write changed it. Left out, nothing is checked.
  - any of: `string`, `null`

## Example request

```json
{
  "endpoint": "string",
  "keys": {
    "p256dh": "string",
    "auth": "string"
  },
  "revision": "string",
  "old": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/customer/v1/stores/<store>/push_subscriptions/renew' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "endpoint": "string",
  "keys": {
    "p256dh": "string",
    "auth": "string"
  },
  "revision": "string",
  "old": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/customer/v1/stores/<store>/push_subscriptions/renew';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    endpoint: 'string',
    keys: {p256dh: 'string', auth: 'string'},
    revision: 'string',
    old: 'string'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/customer/v1/stores/<store>/push_subscriptions/renew"

payload = {
    "endpoint": "string",
    "keys": {
        "p256dh": "string",
        "auth": "string"
    },
    "revision": "string",
    "old": "string"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Moves the customer's subscription to the endpoint and keys its browser renewed it with, in one step, keeping what was pushed to it.

#### Example

```json
{
  "endpoint": "string",
  "created_at": "string",
  "revision": "string"
}
```

- `endpoint` (`renewPushSubscription.response.200.endpoint`; string, required)
- `created_at` (`renewPushSubscription.response.200.created_at`; string, required)
- `revision` (`renewPushSubscription.response.200.revision`; string, required)

### default

A problem; see https://api.sherpo.io/customer/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`renewPushSubscription.response.default.type`; string, required)
  - format `uri`
- `title` (`renewPushSubscription.response.default.title`; string, required)
- `status` (`renewPushSubscription.response.default.status`; integer, required)
- `detail` (`renewPushSubscription.response.default.detail`; string, required)
- `code` (`renewPushSubscription.response.default.code`; string, optional)
- `context` (`renewPushSubscription.response.default.context`; object, optional)
- `reached_core` (`renewPushSubscription.response.default.reached_core`; boolean, optional)
- `core_answer` (`renewPushSubscription.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/customer-api/reference/renew-push-subscription/index.md
