---
source_url: https://www.pubnub.com/docs/sdks/php/api-reference/objects
title: App Context API for PHP SDK
updated_at: 2026-05-21T15:47:11.220Z
sdk_name: PubNub PHP SDK
sdk_version: 9.0.0
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# App Context API for PHP SDK

PubNub PHP SDK, use the latest version: 9.0.0

Install:

```bash
composer require pubnub/pubnub@9.0.0
```

This page describes App Context (formerly Objects v2). To upgrade from Objects v1, refer to the [migration guide](https://www.pubnub.com/docs/general/resources/migration-guides/objects-v2-migration).

App Context provides easy-to-use, serverless storage for user and channel data you need to build innovative, reliable, scalable applications. Use App Context to store metadata about your application users and channels, and their membership associations, without the need to stand up your own databases.

PubNub also triggers events when object data is changed: set, updated, or removed from the database. Making a request to set the same data that already exists doesn't trigger an event. Clients can receive these events in real time and update their front-end application accordingly.

## User

Manage UUID metadata: list, fetch, set, and remove. Include only the fields you need to reduce payload size.

### Get metadata for all users

Get a paginated list of UUID metadata. Use filters and sorting to narrow results.

Commonly used to list chat users, build user directories, populate dropdowns for user selection, or display member profiles with names, emails, and custom data. Retrieves users whose profile information has been stored in App Context.

:::warning Required keyset configuration
To get all channel and user metadata, you must uncheck the
Disallow Get All Channel Metadata
and
Disallow Get All User Metadata
checkboxes in the App Context section of your keyset configuration in the
[Admin Portal](https://admin.pubnub.com)
.
:::

#### Method(s)

To `Get All UUID Metadata` you can use the following method(s) in the PHP SDK:

```php
getAllUUIDMetadata()
    ->includeFields(Array[String => Boolean])
    ->filter(String)
    ->sort(String | Array[String])
    ->limit(Integer)
    ->page(Array[String => String])
    ->sync()
```

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| includeFields() | Array[String | Optional |  | Whether to include additional fields. Set `customFields` to include the Custom object. Set `totalCount` to include the total count in the paginated response (default is false). |
| filter() | String | Optional |  | Filter expression. Only matching objects are returned. See [filtering](https://www.pubnub.com/docs/general/metadata/filtering). |
| sort() | String | Optional |  | Sort by `id`, `name`, `updated` with `asc`/`desc` for sort direction (for example, `name:asc`). |
| limit() | integer | Optional | `100` | Number of objects to return. Default/Max: 100. |
| page() | Array[String | Optional |  | Cursor-based pagination. Use `prev` and `next` tokens returned by the server. |

#### Sample code

:::tip Reference code
This example is a self-contained code snippet ready to be run. It includes necessary imports and executes methods with console logging. Use it as a reference when working with other examples in this document.
:::

```php
$publishKey = getenv('PUBLISH_KEY') ?: 'demo';
$subscribeKey = getenv('SUBSCRIBE_KEY') ?: 'demo';

$config = new PNConfiguration();
$config->setSubscribeKey($subscribeKey);
$config->setPublishKey($publishKey);
$config->setUserId("php-app-context-sample-" . time());

$pubnub = new PubNub($config);
$getAllUserMetadataResult = $pubnub->getAllUuidMetadata()
    ->includeFields(['customFields' => true, 'totalCount' => true])
    ->limit(10)
    ->sync();
assert(count($getAllUserMetadataResult->getData()) >= 2);
assert($getAllUserMetadataResult->getTotalCount() >= 2);
assert(isInstanceOf($getAllUserMetadataResult->getData()[0], PNGetUUIDMetadataResult::class));
```

#### Response

The `getAllUUIDMetadata()` operation returns a `PNGetAllUUIDMetadataResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getData()`Type: Array[PNGetUUIDMetadataResult] | List of uuid metadata results |
| `getTotalCount()`Type: Integer | Number of items returned in the data |
| `getPrev()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for backward pagination, it fetches the previous page, enabling access to earlier data. |
| `getNext()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for forward pagination, it fetches the next page, allowing you to continue from where you left off. |

Data is an array of `PNGetUUIDMetadataResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getId()`Type: String | Unique user identifier |
| `getName()`Type: String | Display name for the user |
| `getExternalId()`Type: String | User's identifier in an external system |
| `getProfileUrl()`Type: String | The URL of the user's profile picture |
| `getEmail()`Type: String | The user's email address |
| `getCustom()`Type: stdClass | Object containing your custom fields |

### Get user metadata

Fetch metadata for a single UUID. Include the Custom object if you need custom fields.

#### Method(s)

To `Get UUID Metadata` you can use the following method(s) in the PHP SDK:

```php
getUUIDMetadata()
    ->uuid(String)
    ->sync()
```

| Parameter | Description |
| --- | --- |
| `uuid()` *Type: StringDefault: n/a | UUID |

#### Sample code

```php
$getUserMetadataResult = $pubnub->getUuidMetadata()
    ->uuid($sampleUsers[0]['id'])
    ->sync();
assert($getUserMetadataResult->getId() === $sampleUsers[0]['id']);
assert($getUserMetadataResult->getName() === $sampleUsers[0]['name']);
assert($getUserMetadataResult->getEmail() === $sampleUsers[0]['email']);
```

#### Response

The `getUUIDMetadata()` operation returns a `PNGetUUIDMetadataResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getId()`Type: String | Unique user identifier |
| `getName()`Type: String | Display name for the user |
| `getExternalId()`Type: String | User's identifier in an external system |
| `getProfileUrl()`Type: String | The URL of the user's profile picture |
| `getEmail()`Type: String | The user's email address |
| `getCustom()`Type: stdClass | Object containing your custom fields |

### Set user metadata

Create or update metadata for a UUID. Use the eTag to avoid overwriting concurrent updates.

:::warning Unsupported partial updates of custom metadata
The value of the custom metadata parameter sent in this method always overwrites the value stored on PubNub servers. If you want to add new custom data to an existing one, you must:
1. Get the existing metadata and store it locally.
2. Append the new custom metadata to the existing one.
3. Set the entire updated custom object.
:::

Set metadata for a UUID in the database, including the Custom object.

#### Method(s)

To `Set UUID Metadata` you can use the following method(s) in the PHP SDK:

```php
setUUIDMetadata()
    ->uuid(String)
    ->meta(Array | StdClass)
    ->ifMatchesEtag(String)
    ->sync()
```

| Parameter | Description |
| --- | --- |
| `uuid()` *Type: StringDefault: n/a | UUID |
| `meta()` *Type: Array or StdClassDefault: n/a | UUID metadata to set. |
| `ifMatchesEtag`Type: StringDefault: n/a | Use the eTag from an applicable get metadata call to ensure updates only apply if the object hasn’t changed. If the eTags differ, the server returns HTTP 412. |

UUID metadata contains the following fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | String | Optional | Display name for the user. |
| `externalId` | String | Optional | User's identifier in an external system. |
| `profileUrl` | String | Optional | The URL of the user's profile picture. |
| `email` | String | Optional | The user's email address. |
| `custom` | Array or StdClass | Optional | Custom JSON values. Can be strings, numbers, or booleans. Filtering by Custom isn’t supported. |

:::tip API limits
To learn about the maximum length of parameters used to set user metadata, refer to [REST API docs](https://www.pubnub.com/docs/sdks/rest-api/set-user-metadata).
:::

#### Sample code

```php
foreach ($sampleUsers as $user) {
    $setUserMetadataResult = $pubnub->setUuidMetadata()
        ->uuid($user['id'])
        ->name($user['name'])
        ->email($user['email'])
        ->externalId($user['externalId'])
        ->profileUrl($user['profileUrl'])
        ->custom($user['custom'])
        ->sync();
    assert($setUserMetadataResult->getId());
    assert($setUserMetadataResult->getName() === $user['name']);
    assert($setUserMetadataResult->getEmail() === $user['email']);
    assert($setUserMetadataResult->getExternalId() === $user['externalId']);
    assert($setUserMetadataResult->getProfileUrl() === $user['profileUrl']);
    assert(json_encode($setUserMetadataResult->getCustom()) === json_encode($user['custom']));
}
```

#### Response

The `setUUIDMetadata()` operation returns a `PNSetUUIDMetadataResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getId()`Type: String | Unique user identifier |
| `getName()`Type: String | Display name for the user |
| `getExternalId()`Type: String | User's identifier in an external system |
| `getProfileUrl()`Type: String | The URL of the user's profile picture |
| `getEmail()`Type: String | The user's email address |
| `getCustom()`Type: stdClass | Object containing your custom fields |

### Remove user metadata

Delete metadata for the specified UUID.

#### Method(s)

To `Remove UUID Metadata` you can use the following method(s) in the PHP SDK:

```php
removeUUIDMetadata()
    ->uuid(String)
    ->sync()
```

| Parameter | Description |
| --- | --- |
| `uuid()` *Type: StringDefault: n/a | UUID |

#### Sample code

```php
$removeUserMetadataResult = $pubnub->removeUuidMetadata()
    ->uuid($sampleUsers[1]['id'])
    ->sync();
assert($removeUserMetadataResult);
```

#### Response

Returns a boolean, `true` for success otherwise `false`

## Channel

Manage channel metadata: list, fetch, set, and remove.

### Get metadata for all channels

Get a paginated list of channel metadata. Use filters and sorting to narrow results.

:::warning Required keyset configuration
To get all channel and user metadata, you must uncheck the
Disallow Get All Channel Metadata
and
Disallow Get All User Metadata
checkboxes in the App Context section of your keyset configuration in the
[Admin Portal](https://admin.pubnub.com)
.
:::

#### Method(s)

To `Get All Channel Metadata` you can use the following method(s) in the PHP SDK:

```php
getAllChannelMetadata()
    ->includeFields(Array[String => Boolean])
    ->filter(String)
    ->sort(String | Array[String])
    ->limit(Integer)
    ->page(Array[String => String])
    ->sync()
```

| Parameter | Description |
| --- | --- |
| `includeFields()`Type: Array[String => Boolean]Default: n/a | Whether to include additional fields. Set `customFields` to include the Custom object. Set `totalCount` to include the total count in the paginated response (default is false). |
| `filter()`Type: StringDefault: n/a | Filter expression. Only matching objects are returned. See [filtering](https://www.pubnub.com/docs/general/metadata/filtering). |
| `sort()`Type: String or Array[String]Default: n/a | Sort by `id`, `name`, `updated` with `asc`/`desc` for sort direction (for example, `name:asc`). |
| `limit()`Type: integerDefault: `100` | Number of objects to return. Default/Max: 100. |
| `page()`Type: Array[String => String]Default: n/a | Cursor-based pagination. Use `prev` and `next` tokens returned by the server. |

#### Sample code

```php
$getAllChannelMetadataResult = $pubnub->getAllChannelMetadata()
    ->includeFields(['customFields' => true, 'totalCount' => true])
    ->limit(10)
    ->sync();
assert(count($getAllChannelMetadataResult->getData()) >= 2);
```

#### Response

The `getAllChannelMetadata()` operation returns a `PNGetAllChannelMetadataResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getData()`Type: Array[PNGetChannelMetadataResult] | List of channel metadata results |
| `getTotalCount()`Type: Integer | Number of items returned in the data |
| `getPrev()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for backward pagination, it fetches the previous page, enabling access to earlier data. |
| `getNext()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for forward pagination, it fetches the next page, allowing you to continue from where you left off. |

Data is an array of `PNGetChannelMetadataResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getId()`Type: String | Unique channel identifier |
| `getName()`Type: String | Display name for the channel |
| `getDescription()`Type: String | Description of a channel |
| `getCustom()`Type: stdClass | Object containing your custom fields |

### Get channel metadata

Fetch metadata for a single channel. Include the Custom object if you need custom fields.

#### Method(s)

To `Get Channel Metadata` you can use the following method(s) in the PHP SDK:

```php
getChannelMetadata()
    ->channel(String)
    ->sync()
```

| Parameter | Description |
| --- | --- |
| `channel()` *Type: StringDefault: n/a | Unique channel identifier |

#### Sample code

```php
$getChannelMetadataResult = $pubnub->getChannelMetadata()
    ->channel($sampleChannels[0]['id'])
    ->sync();
assert($getChannelMetadataResult->getId() === $sampleChannels[0]['id']);
assert($getChannelMetadataResult->getName() === $sampleChannels[0]['name']);
```

#### Response

The `getChannelMetadata()` operation returns a `PNGetChannelMetadataResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getId()`Type: String | Unique channel identifier |
| `getName()`Type: String | Display name for the channel |
| `getDescription()`Type: String | Description of a channel |
| `getCustom()`Type: stdClass | Object containing your custom fields |

### Set channel metadata

Create or update metadata for a channel. Use the eTag to avoid overwriting concurrent updates.

:::warning Unsupported partial updates of custom metadata
The value of the custom metadata parameter sent in this method always overwrites the value stored on PubNub servers. If you want to add new custom data to an existing one, you must:
1. Get the existing metadata and store it locally.
2. Append the new custom metadata to the existing one.
3. Set the entire updated custom object.
:::

Set metadata for a channel in the database, including the Custom object.

#### Method(s)

To `Set Channel Metadata` you can use the following method(s) in the PHP SDK:

```php
setChannelMetadata()
    ->channel(String)
    ->meta(Array | StdClass)
    ->ifMatchesEtag(String)
    ->sync()
```

| Parameter | Description |
| --- | --- |
| `channel()` *Type: StringDefault: n/a | Unique channel identifier |
| `meta()` *Type: Array or StdClassDefault: n/a | Channel metadata to set. |
| `ifMatchesEtag`Type: StringDefault: n/a | Use the eTag from an applicable get metadata call to ensure updates only apply if the object hasn’t changed. If the eTags differ, the server returns HTTP 412. |

Channel metadata contains the following fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | String | Optional | Display name for the channel. |
| `description` | String | Optional | Description of a channel. |
| `custom` | Array or StdClass | Optional | Custom JSON values. Can be strings, numbers, or booleans. Filtering by Custom isn’t supported. |

:::tip API limits
To learn about the maximum length of parameters used to set channel metadata, refer to [REST API docs](https://www.pubnub.com/docs/sdks/rest-api/set-channel-metadata).
:::

#### Sample code

```php
foreach ($sampleChannels as $channel) {
    $setChannelMetadataResult = $pubnub->setChannelMetadata()
        ->channel($channel['id'])
        ->setName($channel['name'])
        ->setDescription($channel['description'])
        ->setCustom($channel['custom'])
        ->sync();
    assert($setChannelMetadataResult->getId() === $channel['id']);
    assert($setChannelMetadataResult->getName() === $channel['name']);
    assert($setChannelMetadataResult->getDescription() === $channel['description']);
}
```

#### Response

The `setChannelMetadata()` operation returns a `PNSetChannelMetadataResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getId()`Type: String | Unique channel identifier |
| `getName()`Type: String | Display name for the channels |
| `getDescription()`Type: String | Description of a channel |
| `getCustom()`Type: stdClass | Object containing your custom fields |

#### Other examples

```php
// Writing the updated object back to the server
$pubnub->setChannelMetadata()
    ->channel($sampleChannels[0]['id'])
    ->meta([
        "name" => $updateChannelMetadataResult->getName(),
        "description" => $updateChannelMetadataResult->getDescription(),
        "custom" => $updatedChannelCustom,
    ])
    ->sync();
print("Object has been updated.\n");
```

##### Update existing channel metadata

This example shows how to update existing channel metadata by modifying the name, description, and custom fields.

```php
$updatedChannelCustom = [
    'category' => 'company-updated',
    'public' => true,
    'lastModified' => date('Y-m-d H:i:s')
];

$updateChannelMetadataResult = $pubnub->setChannelMetadata()
    ->channel($sampleChannels[0]['id'])
    ->setName($sampleChannels[0]['name'] . ' - Updated')
    ->setDescription($sampleChannels[0]['description'] . ' - Updated')
    ->setCustom($updatedChannelCustom)
    ->sync();
assert($updateChannelMetadataResult->getName() === $sampleChannels[0]['name'] . ' - Updated');
```

### Remove channel metadata

Delete metadata for the specified channel.

#### Method(s)

To `Remove Channel Metadata` you can use the following method(s) in the PHP SDK:

```php
removeChannelMetadata()
    ->channel(String)
    ->sync()
```

| Parameter | Description |
| --- | --- |
| `channel()` *Type: StringDefault: n/a | Unique channel identifier |

#### Sample code

```php
$removeChannelMetadataResult = $pubnub->removeChannelMetadata()
    ->channel($sampleChannels[1]['id'])
    ->sync();
assert($removeChannelMetadataResult);
```

#### Response

Returns a boolean, `true` for success otherwise `false`

## Channel memberships

Manage the channels a UUID belongs to: list, set, remove, and manage in bulk.

### Get channel memberships

List channel memberships for a UUID. This doesn't return subscriptions.

#### Method(s)

To `Get Memberships` you can use the following method(s) in the PHP SDK:

```php
getMemberships()
    ->uuid(String)
    ->include(PNMembershipIncludes)
    ->filter(String)
    ->sort(String | Array[String])
    ->limit(Integer)
    ->page(Array[String => String])
    ->sync();
```

| Parameter | Description |
| --- | --- |
| `uuid()` *Type: StringDefault: n/a | UUID |
| `include()`Type: `PNMembershipIncludes`Default: n/a | Whether to include additional fields. |
| → `custom`Type: BooleanDefault: `False` | Whether to include the Custom object in the response. |
| → `status`Type: BooleanDefault: `False` | Whether to include the status field. |
| → `type`Type: BooleanDefault: `False` | Whether to include the type field. |
| → `total_count`Type: BooleanDefault: `False` | Whether to include the total count in the paginated response. |
| → `channel`Type: BooleanDefault: `False` | Whether to include channel fields. |
| → `channelCustom`Type: BooleanDefault: `False` | Whether to include the channel Custom object. |
| → `channelType`Type: BooleanDefault: `False` | Whether to include the channel type field. |
| → `channelStatus`Type: BooleanDefault: `False` | Whether to include the channel status field. |
| `filter()`Type: StringDefault: n/a | Filter expression. Only matching objects are returned. See [filtering](https://www.pubnub.com/docs/general/metadata/filtering). |
| `sort()`Type: String or Array[String]Default: n/a | Sort by `id`, `name`, `updated` with `asc`/`desc` for sort direction (for example, `name:asc`). |
| `limit()`Type: integerDefault: `100` | Number of objects to return. Default/Max: 100. |
| `page()`Type: Array[String => String]Default: n/a | Cursor-based pagination. Use `prev` and `next` tokens returned by the server. |

#### Sample code

```php
$membershipIncludes = new PNMembershipIncludes();
$membershipIncludes->custom()->channel()->channelCustom();

$getMembershipsResult = $pubnub->getMemberships()
    ->uuid($sampleUsers[0]['id'])
    ->include($membershipIncludes)
    ->sync();
assert(count($getMembershipsResult->getData()) >= 1);
```

#### Response

The `getMemberships()` operation returns a `PNMembershipsResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getData()`Type: Array[PNMembershipsResultItem] | List of membership metadata results |
| `getTotalCount()`Type: Integer | Number of items returned in the data |
| `getPrev()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for backward pagination, it fetches the previous page, enabling access to earlier data. |
| `getNext()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for forward pagination, it fetches the next page, allowing you to continue from where you left off. |

Data is an array of `PNMembershipsResultItem` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getChannel()`Type: PNMembership | Channel metadata |
| `getCustom()`Type: String | stdClass object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

Channel is a `PNMembership` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getId()`Type: String | Unique channel identifier |
| `getName()`Type: String | Display name for the channel |
| `getDescription()`Type: String | Description of a channel |
| `getCustom()`Type: stdClass | Object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

### Set channel memberships

Replace or add memberships for a UUID. Provide channels (optionally with custom data).

#### Method(s)

To `Set Memberships` you can use the following method(s) in the PHP SDK:

```php
setMemberships()
    ->uuid(String)
    ->memberships(Array[PNChannelMembership])
    ->custom(Array | StdClass)
    ->include(PNMembershipIncludes)
    ->filter(String)
    ->sort(String | Array[String])
    ->limit(Integer)
    ->page(Array[String => String])
    ->sync();
```

| Parameter | Description |
| --- | --- |
| `uuid()` *Type: StringDefault: n/a | UUID |
| `memberships()` *Type: Array[PNChannelMembership]Default: n/a | Array of memberships to set. |
| `custom()` *Type: Array or StdClassDefault: n/a | Custom JSON values. Can be strings, numbers, or booleans. Filtering by Custom isn’t supported. |
| `include()`Type: `PNMembershipIncludes`Default: n/a | Whether to include additional fields. |
| → `custom`Type: BooleanDefault: `False` | Whether to include the Custom object in the response. |
| → `status`Type: BooleanDefault: `False` | Whether to include the status field. |
| → `type`Type: BooleanDefault: `False` | Whether to include the type field. |
| → `total_count`Type: BooleanDefault: `False` | Whether to include the total count in the paginated response. |
| → `channel`Type: BooleanDefault: `False` | Whether to include channel fields. |
| → `channelCustom`Type: BooleanDefault: `False` | Whether to include the channel Custom object. |
| → `channelType`Type: BooleanDefault: `False` | Whether to include the channel type field. |
| → `channelStatus`Type: BooleanDefault: `False` | Whether to include the channel status field. |
| `filter()`Type: StringDefault: n/a | Filter expression. Only matching objects are returned. See [filtering](https://www.pubnub.com/docs/general/metadata/filtering). |
| `sort()`Type: String or Array[String]Default: n/a | Sort by `id`, `name`, `updated` with `asc`/`desc` for sort direction (for example, `name:asc`). |
| `limit()`Type: integerDefault: `100` | Number of objects to return. Default/Max: 100. |
| `page()`Type: Array[String => String]Default: n/a | Cursor-based pagination. Use `prev` and `next` tokens returned by the server. |
| channels() *Type: Array[String or Array]Default: n/a | Array of channels to add to membership. Array can contain strings (channel-name only) or objects (which can include custom data). |

:::tip API limits
To learn about the maximum length of parameters used to set channel membership metadata, refer to [REST API docs](https://www.pubnub.com/docs/sdks/rest-api/set-membership-metadata).
:::

#### Sample code

```php
$memberships = [
    new PNChannelMembership($sampleChannels[0]['id']),
    new PNChannelMembership($sampleChannels[1]['id'])
];

$setMembershipsResult = $pubnub->setMemberships()
    ->uuid($sampleUsers[0]['id'])
    ->memberships($memberships)
    ->sync();
assert(count($setMembershipsResult->getData()) >= 1);
```

#### Response

The `setMemberships()` operation returns a `PNMembershipsResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getData()`Type: Array[PNMembershipsResultItem] | List of membership metadata results |
| `getTotalCount()`Type: Integer | Number of items returned in the data |
| `getPrev()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for backward pagination, it fetches the previous page, enabling access to earlier data. |
| `getNext()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for forward pagination, it fetches the next page, allowing you to continue from where you left off. |

Data is an array of `PNMembershipsResultItem` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getChannel()`Type: PNMembership | Channel metadata |
| `getCustom()`Type: String | stdClass object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

Channel is a `PNMembership` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getId()`Type: String | Unique channel identifier |
| `getName()`Type: String | Display name for the channel |
| `getDescription()`Type: String | Description of a channel |
| `getCustom()`Type: stdClass | Object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

### Remove channel memberships

Remove memberships for a UUID. Provide the channels to remove.

#### Method(s)

To `Remove Memberships` you can use the following method(s) in the PHP SDK:

```php
removeMemberships()
    ->uuid(String)
    ->memberships(Array[PNChannelMembership])
    ->include(PNMembershipIncludes)
    ->filter(String)
    ->sort(String | Array[String])
    ->limit(Integer)
    ->page(Array[String => String])
    ->sync();
```

| Parameter | Description |
| --- | --- |
| `uuid()` *Type: StringDefault: n/a | UUID. |
| `memberships()` *Type: Array[PNChannelMembership]Default: n/a | Array of memberships to remove. |
| `include()`Type: `PNMembershipIncludes`Default: n/a | Whether to include additional fields. |
| → `custom`Type: BooleanDefault: `False` | Whether to include the Custom object in the response. |
| → `status`Type: BooleanDefault: `False` | Whether to include the status field. |
| → `type`Type: BooleanDefault: `False` | Whether to include the type field. |
| → `total_count`Type: BooleanDefault: `False` | Whether to include the total count in the paginated response. |
| → `channel`Type: BooleanDefault: `False` | Whether to include channel fields. |
| → `channelCustom`Type: BooleanDefault: `False` | Whether to include the channel Custom object. |
| → `channelType`Type: BooleanDefault: `False` | Whether to include the channel type field. |
| → `channelStatus`Type: BooleanDefault: `False` | Whether to include the channel status field. |
| `filter()`Type: StringDefault: n/a | Filter expression. Only matching objects are returned. See [filtering](https://www.pubnub.com/docs/general/metadata/filtering). |
| `sort()`Type: String or Array[String]Default: n/a | Sort by `id`, `name`, `updated` with `asc`/`desc` for sort direction (for example, `name:asc`). |
| `limit()`Type: integerDefault: `100` | Number of objects to return. Default/Max: 100. |
| `page()`Type: Array[String => String]Default: n/a | Cursor-based pagination. Use `prev` and `next` tokens returned by the server. |
| channels() *Type: Array[String]Default: n/a | Array of channels to remove from membership. |

#### Sample code

```php
$removeMembershipsList = [new PNChannelMembership($sampleChannels[0]['id'])];

$removeMembershipsResult = $pubnub->removeMemberships()
    ->uuid($sampleUsers[0]['id'])
    ->memberships($removeMembershipsList)
    ->sync();
assert($removeMembershipsResult);
```

#### Response

The `removeMemberships()` operation returns a `PNMembershipsResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getData()`Type: Array[PNMembershipsResultItem] | List of membership metadata results |
| `getTotalCount()`Type: Integer | Number of items returned in the data |
| `getPrev()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for backward pagination, it fetches the previous page, enabling access to earlier data. |
| `getNext()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for forward pagination, it fetches the next page, allowing you to continue from where you left off. |

Data is an array of `PNMembershipsResultItem` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getChannel()`Type: PNMembership | Channel metadata |
| `getCustom()`Type: String | stdClass object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

Channel is a `PNMembership` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getId()`Type: String | Unique channel identifier |
| `getName()`Type: String | Display name for the channel |
| `getDescription()`Type: String | Description of a channel |
| `getCustom()`Type: stdClass | Object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

### Manage channel memberships

Add and remove memberships for a UUID in one request.

To `Manage Channel Memberships` you can use the following method(s) in the PHP SDK:

```php
manageMemberships()
    ->uuid(String)
    ->setMemberships(Array[PNChannelMembership])
    ->removeMemberships(Array[PNChannelMembership])
    ->include(PNMembershipIncludes)
    ->filter(String)
    ->sort(String | Array[String])
    ->limit(Integer)
    ->page(Array[String => String])
    ->sync();
```

| Parameter | Description |
| --- | --- |
| `uuid()` *Type: StringDefault: n/a | Unique user identifier whose memberships to manage |
| `setMemberships()`Type: Array[PNChannelMembership]Default: n/a | Array of `PNChannelMembership` objects to add to the user's memberships. |
| `removeMemberships()`Type: Array[PNChannelMembership]Default: n/a | Array of `PNChannelMembership` objects to remove from the user's memberships. |
| `include()`Type: `PNMembershipIncludes`Default: n/a | The additional information to include in the membership response. |
| → `custom`Type: BooleanDefault: `False` | Indicates whether custom data should be included in the response. |
| → `status`Type: BooleanDefault: `False` | Indicates whether the status should be included in the response. |
| → `type`Type: BooleanDefault: `False` | Indicates whether the type should be included in the response. |
| → `total_count`Type: BooleanDefault: `False` | Indicates whether the total count should be included in the response. |
| → `channel`Type: BooleanDefault: `False` | Indicates whether the channel ID information should be included in the response. |
| → `channelCustom`Type: BooleanDefault: `False` | Indicates whether custom data for the channel should be included in the response. |
| → `channelType`Type: BooleanDefault: `False` | Indicates whether the type of the channel should be included in the response. |
| → `channelStatus`Type: BooleanDefault: `False` | Indicates whether the status of the channel should be included in the response. |
| `filter()`Type: StringDefault: n/a | Expression used to filter the results. Only objects whose properties satisfy the given expression are returned. The filter language is [defined here](https://www.pubnub.com/docs/general/metadata/filtering). |
| `sort()`Type: String or Array[String]Default: n/a | String or Array of String property names to sort by, and an optional sort direction. Available options are `id`, `name`, and `updated`. Use `asc` or `desc` to specify sort direction, or omit to take the default sort direction (ascending). For example: `name:asc` |
| `limit()`Type: integerDefault: `100` | Number of objects to return in response. Default is `100`, which is also the maximum value. |
| `page()`Type: Array[String => String]Default: n/a | Use for pagination. Key value array where keys are one of `next` or `prev` and value is a random string returned from the server, indicating a specific position in a data set. Set `prev` to a previously-returned string for fetching the previous page. Set `next` to a previously-returned string for fetching the next page. |

#### Sample code

```php
$setMembershipsList = [new PNChannelMembership($sampleChannels[0]['id'])];
$removeMembershipsList = [new PNChannelMembership($sampleChannels[1]['id'])];

$manageMembershipsResult = $pubnub->manageMemberships()
    ->uuid($sampleUsers[0]['id'])
    ->setMemberships($setMembershipsList)
    ->removeMemberships($removeMembershipsList)
    ->sync();
assert(count($manageMembershipsResult->getData()) >= 0);
```

#### Response

The `manageMemberships()` operation returns a `PNMembershipsResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getData()`Type: Array[PNMembershipsResultItem] | List of membership metadata results |
| `getTotalCount()`Type: Integer | Number of items returned in the data |
| `getPrev()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for backward pagination, it fetches the previous page, enabling access to earlier data. |
| `getNext()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for forward pagination, it fetches the next page, allowing you to continue from where you left off. |

Data is an array of `PNMembershipsResultItem` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getChannel()`Type: PNMembership | Channel metadata |
| `getCustom()`Type: String | stdClass object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

Channel is a `PNMembership` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getId()`Type: String | Unique channel identifier |
| `getName()`Type: String | Display name for the channel |
| `getDescription()`Type: String | Description of a channel |
| `getCustom()`Type: stdClass | Object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

## Channel members

Manage the users in a channel: list, set, remove, and manage in bulk.

### Get channel members

List users in a channel. Include user metadata if needed.

#### Method(s)

To `Get Channel Members` you can use the following method(s) in the PHP SDK:

```php
getMembers()
    ->channel(String)
    ->include(PNMemberIncludes)
    ->filter(String)
    ->sort(String | Array[String])
    ->limit(Integer)
    ->page(Array[String => String])
    ->sync();
```

| Parameter | Description |
| --- | --- |
| `channel()` *Type: StringDefault: n/a | Unique channel identifier |
| `include()`Type: `PNMemberIncludes`Default: n/a | The additional information to include in the member response. |
| → `custom`Type: BooleanDefault: `False` | Indicates whether custom data should be included in the response. |
| → `status`Type: BooleanDefault: `False` | Indicates whether the status should be included in the response. |
| → `type`Type: BooleanDefault: `False` | Indicates whether the type should be included in the response. |
| → `total_count`Type: BooleanDefault: `False` | Indicates whether the total count should be included in the response. |
| → `user`Type: BooleanDefault: `False` | Indicates whether the user ID information should be included in the response. |
| → `userCustom`Type: BooleanDefault: `False` | Indicates whether custom data for the user should be included in the response. |
| → `userType`Type: BooleanDefault: `False` | Indicates whether the type of the user should be included in the response. |
| → `userStatus`Type: BooleanDefault: `False` | Indicates whether the status of the user should be included in the response. |
| `filter()`Type: StringDefault: n/a | Expression used to filter the results. Only objects whose properties satisfy the given expression are returned. The filter language is [defined here](https://www.pubnub.com/docs/general/metadata/filtering). |
| `sort()`Type: String or Array[String]Default: n/a | String or Array of String property names to sort by, and an optional sort direction. Available options are `id`, `name`, and `updated`. Use `asc` or `desc` to specify sort direction, or omit to take the default sort direction (ascending). For example: `name:asc` |
| `limit()`Type: integerDefault: `100` | Number of objects to return in response. Default is `100`, which is also the maximum value. |
| `page()`Type: Array[String => String]Default: n/a | Use for pagination. Key value array where keys are one of `next` or `prev` and value is a random string returned from the server, indicating a specific position in a data set. Set `prev` to a previously-returned string for fetching the previous page. Set `next` to a previously-returned string for fetching the next page. |

#### Sample code

```php
$memberIncludes = new PNMemberIncludes();
$memberIncludes->custom()->user()->userCustom();

$getMembersResult = $pubnub->getMembers()
    ->channel($sampleChannels[0]['id'])
    ->include($memberIncludes)
    ->sync();
assert(count($getMembersResult->getData()) >= 1);
```

#### Response

The `getMembers()` operation returns a `PNMembersResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getData()`Type: Array[PNMembersResultItem] | List of member metadata results |
| `getTotalCount()`Type: Integer | Number of items returned in the data |
| `getPrev()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for backward pagination, it fetches the previous page, enabling access to earlier data. |
| `getNext()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for forward pagination, it fetches the next page, allowing you to continue from where you left off. |

Data is an array of `PNMembersResultItem` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getUUID()`Type: PNMember | UUID metadata |
| `getCustom()`Type: String | stdClass object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

Channel is a `PNMember` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getId()`Type: String | Unique user identifier |
| `getName()`Type: String | Display name for the user |
| `getExternalId()`Type: String | User's identifier in an external system |
| `getProfileUrl()`Type: String | The URL of the user's profile picture |
| `getEmail()`Type: String | The user's email address |
| `getCustom()`Type: stdClass | Object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

### Set channel members

Set users in a channel. Provide UUIDs (optionally with custom data).

#### Method(s)

To `Set Channel Members` you can use the following method(s) in the PHP SDK:

```php
setMembers()
    ->channel(String)
    ->uuids(Array[String | Array])
    ->custom(Array | StdClass)
    ->include(PNMemberIncludes)
    ->filter(String)
    ->sort(String | Array[String])
    ->limit(Integer)
    ->page(Array[String => String])
    ->sync();
```

| Parameter | Description |
| --- | --- |
| `channel()` *Type: StringDefault: n/a | Unique channel identifier |
| `uuids()` *Type: Array[String or Array]Default: n/a | Array of members to add to the channel. Array can contain strings (uuid only) or arrays/objects (which can include custom data). |
| `custom()` *Type: Array or StdClassDefault: n/a | Object of key-value pairs with supported data types. |
| `include()`Type: `PNMemberIncludes`Default: n/a | The additional information to include in the member response. |
| → `custom`Type: BooleanDefault: `False` | Indicates whether custom data should be included in the response. |
| → `status`Type: BooleanDefault: `False` | Indicates whether the status should be included in the response. |
| → `type`Type: BooleanDefault: `False` | Indicates whether the type should be included in the response. |
| → `total_count`Type: BooleanDefault: `False` | Indicates whether the total count should be included in the response. |
| → `user`Type: BooleanDefault: `False` | Indicates whether the user ID information should be included in the response. |
| → `userCustom`Type: BooleanDefault: `False` | Indicates whether custom data for the user should be included in the response. |
| → `userType`Type: BooleanDefault: `False` | Indicates whether the type of the user should be included in the response. |
| → `userStatus`Type: BooleanDefault: `False` | Indicates whether the status of the user should be included in the response. |
| `filter()`Type: StringDefault: n/a | Expression used to filter the results. Only objects whose properties satisfy the given expression are returned. The filter language is [defined here](https://www.pubnub.com/docs/general/metadata/filtering). |
| `sort()`Type: String or Array[String]Default: n/a | String or Array of String property names to sort by, and an optional sort direction. Available options are `id`, `name`, and `updated`. Use `asc` or `desc` to specify sort direction, or omit to take the default sort direction (ascending). For example: `name:asc` |
| `limit()`Type: integerDefault: `100` | Number of objects to return in response. Default is `100`, which is also the maximum value. |
| `page()`Type: Array[String => String]Default: n/a | Use for pagination. Key value array where keys are one of `next` or `prev` and value is a random string returned from the server, indicating a specific position in a data set. Set `prev` to a previously-returned string for fetching the previous page. Set `next` to a previously-returned string for fetching the next page. |

:::tip API limits
To learn about the maximum length of parameters used to set channel members metadata, refer to [REST API docs](https://www.pubnub.com/docs/sdks/rest-api/set-channel-members-metadata).
:::

#### Sample code

```php
$channelMembers = [
    new PNChannelMember($sampleUsers[0]['id']),
    new PNChannelMember($sampleUsers[1]['id'])
];

$setMembersResult = $pubnub->setMembers()
    ->channel($sampleChannels[0]['id'])
    ->members($channelMembers)
    ->sync();
assert(count($setMembersResult->getData()) >= 1);
```

#### Response

The `setMembers()` operation returns a `PNMembersResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getData()`Type: Array[PNMembersResultItem] | List of member metadata results |
| `getTotalCount()`Type: Integer | Number of items returned in the data |
| `getPrev()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for backward pagination, it fetches the previous page, enabling access to earlier data. |
| `getNext()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for forward pagination, it fetches the next page, allowing you to continue from where you left off. |

Data is an array of `PNMembersResultItem` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getUUID()`Type: PNMember | UUID metadata |
| `getCustom()`Type: String | stdClass object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

Channel is a `PNMember` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getId()`Type: String | Unique user identifier |
| `getName()`Type: String | Display name for the user |
| `getExternalId()`Type: String | User's identifier in an external system |
| `getProfileUrl()`Type: String | The URL of the user's profile picture |
| `getEmail()`Type: String | The user's email address |
| `getCustom()`Type: stdClass | Object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

### Remove channel members

Remove users from a channel. Provide the UUIDs to remove.

#### Method(s)

To `Remove Channel Members` you can use the following method(s) in the PHP SDK:

```php
removeMembers()
    ->channel(String)
    ->members(PNChannelMember[])
    ->include(PNMemberIncludes)
    ->filter(String)
    ->sort(String | Array[String])
    ->limit(Integer)
    ->page(Array[String => String])
    ->sync();
```

| Parameter | Description |
| --- | --- |
| `channel()` *Type: StringDefault: n/a | Unique channel identifier |
| `members()` *Type: PNChannelMember[]Default: n/a | Array of members to remove from the channel |
| `include()`Type: `PNMemberIncludes`Default: n/a | Whether to include additional fields. |
| → `custom`Type: BooleanDefault: `False` | Whether to include the Custom object in the response. |
| → `status`Type: BooleanDefault: `False` | Whether to include the status field. |
| → `type`Type: BooleanDefault: `False` | Whether to include the type field. |
| → `total_count`Type: BooleanDefault: `False` | Whether to include the total count in the paginated response. |
| → `user`Type: BooleanDefault: `False` | Whether to include user fields. |
| → `userCustom`Type: BooleanDefault: `False` | Whether to include the user Custom object. |
| → `userType`Type: BooleanDefault: `False` | Whether to include the user type field. |
| → `userStatus`Type: BooleanDefault: `False` | Whether to include the user status field. |
| `filter()`Type: StringDefault: n/a | Filter expression. Only matching objects are returned. See [filtering](https://www.pubnub.com/docs/general/metadata/filtering). |
| `sort()`Type: String or Array[String]Default: n/a | Sort by `id`, `name`, `updated` with `asc`/`desc` for sort direction (for example, `name:asc`). |
| `limit()`Type: integerDefault: `100` | Number of objects to return. Default/Max: 100. |
| `page()`Type: Array[String => String]Default: n/a | Cursor-based pagination. Use `prev` and `next` tokens returned by the server. |

#### Sample code

```php
$removeMembersList = [new PNChannelMember($sampleUsers[0]['id'])];

$removeMembersResult = $pubnub->removeMembers()
    ->channel($sampleChannels[0]['id'])
    ->members($removeMembersList)
    ->sync();
assert($removeMembersResult);
```

#### Response

The `removeMembers()` operation returns a `PNMembersResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getData()`Type: Array[PNMembersResultItem] | List of member metadata results |
| `getTotalCount()`Type: Integer | Number of items returned in the data |
| `getPrev()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for backward pagination, it fetches the previous page, enabling access to earlier data. |
| `getNext()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for forward pagination, it fetches the next page, allowing you to continue from where you left off. |

Data is an array of `PNMembersResultItem` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getUUID()`Type: PNMember | UUID metadata |
| `getCustom()`Type: String | stdClass object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

Channel is a `PNMember` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getId()`Type: String | Unique user identifier |
| `getName()`Type: String | Display name for the user |
| `getExternalId()`Type: String | User's identifier in an external system |
| `getProfileUrl()`Type: String | The URL of the user's profile picture |
| `getEmail()`Type: String | The user's email address |
| `getCustom()`Type: stdClass | Object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

### Manage channel members

Add and remove users in a channel in one request.

To `Manage Channel Members` you can use the following method(s) in the PHP SDK:

```php
manageMembers()
    ->channel(String)
    ->setUuids(Array[String])
    ->removeUuids(Array[String])
    ->setMembers(Array[PNChannelMember])
    ->removeMembers(Array[PNChannelMember])
    ->custom(Array | StdClass)
    ->include(PNMemberIncludes)
    ->filter(String)
    ->sort(String | Array[String])
    ->limit(Integer)
    ->page(Array[String => String])
    ->sync();
```

| Parameter | Description |
| --- | --- |
| `channel()` *Type: StringDefault: n/a | Unique channel identifier |
| `channel()` *Type: StringDefault: n/a | Unique channel identifier |
| `setUuids()` *Type: Array[String]Default: n/a | Array of UUIDs to add to the channel. |
| `removeUuids()` *Type: Array[String]Default: n/a | Array of UUIDs to remove from the channel. |
| `setMembers()` *Type: Array[PNChannelMember]Default: n/a | Array of `PNChannelMember` objects to add to the channel. |
| `removeMembers()` *Type: Array[PNChannelMember]Default: n/a | Array of `PNChannelMember` objects to remove from the channel. |
| `custom()` *Type: Array or StdClassDefault: n/a | Custom JSON values. Can be strings, numbers, or booleans. Filtering by Custom isn’t supported. |
| `include()`Type: `PNMemberIncludes`Default: n/a | Whether to include additional fields. |
| → `custom`Type: BooleanDefault: `False` | Whether to include the Custom object in the response. |
| → `status`Type: BooleanDefault: `False` | Whether to include the status field. |
| → `type`Type: BooleanDefault: `False` | Whether to include the type field. |
| → `total_count`Type: BooleanDefault: `False` | Whether to include the total count in the paginated response. |
| → `user`Type: BooleanDefault: `False` | Whether to include user fields. |
| → `userCustom`Type: BooleanDefault: `False` | Whether to include the user Custom object. |
| → `userType`Type: BooleanDefault: `False` | Whether to include the user type field. |
| → `userStatus`Type: BooleanDefault: `False` | Whether to include the user status field. |
| `filter()`Type: StringDefault: n/a | Filter expression. Only matching objects are returned. See [filtering](https://www.pubnub.com/docs/general/metadata/filtering). |
| `sort()`Type: String or Array[String]Default: n/a | Sort by `id`, `name`, `updated` with `asc`/`desc` for sort direction (for example, `name:asc`). |
| `limit()`Type: integerDefault: `100` | Number of objects to return. Default/Max: 100. |
| `page()`Type: Array[String => String]Default: n/a | Cursor-based pagination. Use `prev` and `next` tokens returned by the server. |

#### Sample code

```php
$setMembersList = [new PNChannelMember($sampleUsers[0]['id'])];
$removeMembersList = [new PNChannelMember($sampleUsers[1]['id'])];

$manageMembersResult = $pubnub->manageMembers()
    ->channel($sampleChannels[0]['id'])
    ->setMembers($setMembersList)
    ->removeMembers($removeMembersList)
    ->sync();
assert(count($manageMembersResult->getData()) >= 0);
```

#### Response

The `manageMembers()` operation returns a `PNMembersResult` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getData()`Type: Array[PNMembersResultItem] | List of member metadata results |
| `getTotalCount()`Type: Integer | Number of items returned in the data |
| `getPrev()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for backward pagination, it fetches the previous page, enabling access to earlier data. |
| `getNext()`Type: String | Random string returned from the server, indicating a specific position in a data set. Used for forward pagination, it fetches the next page, allowing you to continue from where you left off. |

Data is an array of `PNMembersResultItem` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getUUID()`Type: PNMember | UUID metadata |
| `getCustom()`Type: String | stdClass object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

Channel is a `PNMember` which contains the following fields:

| Parameter | Description |
| --- | --- |
| `getId()`Type: String | Unique user identifier |
| `getName()`Type: String | Display name for the user |
| `getExternalId()`Type: String | User's identifier in an external system |
| `getProfileUrl()`Type: String | The URL of the user's profile picture |
| `getEmail()`Type: String | The user's email address |
| `getCustom()`Type: stdClass | Object containing your custom fields |
| `getUpdated()`Type: String | The last updated date and time |
| `getETag()`Type: String | The entity tag |

## Terms in this document

* **Channel** - A pathway for sending and receiving messages between devices, created automatically when you first use it, that can handle any number of users and messages for different communication needs, like 1-1 text chats, group conversations, and other data streaming.
* **Channel pattern** - A way to group and analyze channel data to track performance metrics like message counts and user engagement over time with PubNub Insights.
* **User** - An individual or entity that interacts with a system, application, or service. In PubNub, a user typically refers to someone who sends or receives messages through the platform, identified by a unique user ID or username.
* **User ID** - UTF-8 encoded, unique string of up to 92 characters used to identify a single client (end user, device, or server) that connects to PubNub.