# Callbacks

[Wallet callbacks](/guides/wallet/user-guide/reporting/wallet-callbacks/) provide a pass event notification, e.g., pass install or uninstall, using webhooks.


## Create callback specification {#createcallbackspecification}

Register a callback specification, which includes the remote URL and any HTTP headers required by the remote URL.

Your callback server should expect to receive callbacks at up to three endpoints:
* `{baseUrl}/v1/pass/install` — Receives a [callback](/docs/developer/rest-api/wallet/schemas/others/#callbackobject) when your audience installs passes.
* `{baseUrl}/v1/pass/uninstall` — Receives a [callback](/docs/developer/rest-api/wallet/schemas/others/#callbackobject) when your audience uninstalls passes.
* `{baseUrl}/v1/pass/{passId}/personalize` — Receives a [callback with a personalization object](/docs/developer/rest-api/wallet/schemas/others/#callbackpersonalizationobject) when your audience personalizes a Loyalty pass. You must [add personalization requirements](/docs/developer/rest-api/wallet/operations/apple-wallet-pass-personalization/) to Apple templates before users can personalize passes created from them.

See [Wallet callbacks](/docs/guides/wallet/user-guide/reporting/wallet-callbacks/) for more information.

[Jump to examples ↓](#createcallbackspecification-examples)

### `POST /project/{projectId}/settings/callback`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `string` | Required | The ID of the project. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

**Content-Type:** `application/json`

- **`baseUrl`** `string`

  The URL of your webhook/callback server.

- **`headers`** `object`

  Contains headers required by your webhook/callback server, including authorization, content-type, etc.


By default, Airship appends `content-type: application/json` and sends a JSON payload.

**Responses**

**`200`** A successful call returns the callback specification.

Response body:

**Content-Type:** `application/json`

- **`baseUrl`** `string`

  The URL of your webhook/callback server.

- **`headers`** `object`

  Contains headers required by your webhook/callback server, including authorization, content-type, etc.


By default, Airship appends `content-type: application/json` and sends a JSON payload.

**Examples**

*Example request*

```http
POST /v1/project/12345/settings/callback HTTP/1.1
Authorization: Basic <Base64 key>
Content-Type: application/json

{
   "baseUrl": "https://www.remotehost.example.com/callbacks",
   "headers": {
      "Authorization": "Basic dGVzdEB0ZXN0LmNvbTp0ZXN0",
      "Content-Type": "application/json"
   }
}

```

*Response*

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
   "baseUrl": "https://www.remotehost.example.com/callbacks",
   "headers": {
      "Authorization": "Basic dGVzdEB0ZXN0LmNvbTp0ZXN0",
      "Content-Type": "application/json"
   }
}

```

---

## Delete callback specification {#deletecallbackspecification}

Delete a registered callback specification. Because a project only uses a single callback specification, you specify the `projectId` only.

[Jump to examples ↓](#deletecallbackspecification-examples)

### `DELETE /project/{projectId}/settings/callback`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `string` | Required | The ID of the project. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`204`** A successful request returns no content.

**Examples**

*Example request*

```http
DELETE /v1/project/12345/settings/callback HTTP/1.1
Authorization: Basic <Base64 key>

```

*Response*

```http
HTTP/1.1 204 No Content

```

---

## Get callback specification {#getcallbackspecification}

Return the callback specification for a project.

[Jump to examples ↓](#getcallbackspecification-examples)

### `GET /project/{projectId}/settings/callback`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `string` | Required | The ID of the project. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Responses**

**`200`** A successful call returns the callback specification.

Response body:

**Content-Type:** `application/json`

- **`baseUrl`** `string`

  The URL of your webhook/callback server.

- **`headers`** `object`

  Contains headers required by your webhook/callback server, including authorization, content-type, etc.


By default, Airship appends `content-type: application/json` and sends a JSON payload.

**Examples**

*Example request*

```http
GET /v1/project/12345/settings/callback HTTP/1.1
Authorization: Basic <Base64 key>

```

*Response*

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
   "baseUrl": "https://www.remotehost.example.com/callbacks",
   "headers": {
      "Authorization": "Basic dGVzdEB0ZXN0LmNvbTp0ZXN0",
      "Content-Type": "application/json"
   }
}

```

---

## Update callback specification {#updatecallbackspecification}

Update a callback specification. The payload to update a callback is identical to the payload to create a callback.

[Jump to examples ↓](#updatecallbackspecification-examples)

### `PUT /project/{projectId}/settings/callback`

**Security:**

- [httpBasic]({{< ref "/developer/rest-api/wallet/introduction/" >}}#security-httpBasic)

**Path parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | `string` | Required | The ID of the project. |

**Request headers:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Api-Revision` | `string` | Required | The particular API revision you want to use. In general, this is `1.2`. Possible values: `1.2` |

**Request body**

**Content-Type:** `application/json`

- **`baseUrl`** `string`

  The URL of your webhook/callback server.

- **`headers`** `object`

  Contains headers required by your webhook/callback server, including authorization, content-type, etc.


By default, Airship appends `content-type: application/json` and sends a JSON payload.

**Responses**

**`200`** A successful call returns the callback specification.

Response body:

**Content-Type:** `application/json`

- **`baseUrl`** `string`

  The URL of your webhook/callback server.

- **`headers`** `object`

  Contains headers required by your webhook/callback server, including authorization, content-type, etc.


By default, Airship appends `content-type: application/json` and sends a JSON payload.

**Examples**

*Example request*

```http
PUT /v1/project/12345/settings/callback HTTP/1.1
Authorization: Basic <Base64 key>
Content-Type: application/json

{
   "baseUrl": "https://www.remotehost.example.com/callbacks",
   "headers": {
      "Authorization": "Basic dGVzdEB0ZXN0LmNvbTp0ZXN0",
      "Content-Type": "application/json"
   }
}

```

*Response*

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
   "baseUrl": "https://www.remotehost.example.com/callbacks",
   "headers": {
      "Authorization": "Basic dGVzdEB0ZXN0LmNvbTp0ZXN0",
      "Content-Type": "application/json"
   }
}

```

---

