# Operations and Notification Tracking

## Operations

An Operation represents a request that sends push notifications to one or more recipients. When you submit the request, the Push Notifications API validates the input and returns an HTTP `202 Accepted` response that includes an `operationId` in the response body. Use the `operationId` value to monitor the status and progress of the Operation.

As the Operation is processed, it generates a PushNotification with an associated `pushNotificationId` for each recipient. Each PushNotification then creates at least one delivery attempt for each provider (FCM or APNs) that is tried.

## Retrieve an Operation

Make a `GET` request with the Operation ID to retrieve its status.

```bash
curl -X GET 'https://comms.twilio.com/v1/PushNotifications/Operations/{operationId}' \
--header 'Content-Type: application/json' \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

**Sample response**:

```json
{
   "id": "comms_operation_01h2xcejqtf2nbrexx3vqjhp41",
   "status": "COMPLETED",
   "stats": {
       "total": 1,
       "recipients": 1,
       "attempts": 1,
       "queued": 0,
       "sent": 0,
       "delivered": 1,
       "undelivered": 0,
       "failed": 0
   },
   "createdAt": "2024-04-05T06:20:00Z",
   "updatedAt": "2024-04-05T06:20:00Z"
}
```

See the [Push Notifications Operations API reference](/docs/push-notifications/api/operation-resource).

## Retrieve PushNotifications created by an Operation

Use the List PushNotifications endpoint to retrieve the PushNotification resources that an Operation created.

```bash
curl -X GET 'https://comms.twilio.com/v1/PushNotifications?operationId={operationId}' \
--header 'Content-Type: application/json' \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

**Sample response**:

```json
{
   "notifications": [
       {
           "id": "comms_notification_01h2xcejqtf2nbrexx3vqjhp41",
           "to": [
               {
                   "token": "FCM_DEVICE_TOKEN",
                   "provider": "FCM"
               }
           ],
           "status": "SENT",
           "related": [
               {
                   "name": "operation",
                   "id": "comms_operation_01h2xcejqtf2nbrexx3vqjhp41",
                   "uri": "/PushNotifications/Operations/01h2xcejqtf2nbrexx3vqjhp41"
               }
           ],
           "tags": {},
           "createdAt": "2023-08-24T14:15:22Z",
           "updatedAt": "2023-08-24T14:15:22Z",
           "deletedAt": null
       }
   ],
   "pagination": {
       "next": null,
       "self": "https://comms.twilio.com/v1/PushNotifications"
   }
}
```

For more details, see the [List PushNotifications API reference](/docs/push-notifications/api/notification-resource#list-pushnotifications).

## Next steps

See the [Personalization guide](/docs/push-notifications/personalization) to learn how to personalize push notifications for each recipient.
