---
source_url: https://www.pubnub.com/docs/sdks/rest-api/grant-permissions
title: Grant permissions
---

# Grant permissions

> For AI agents: documentation index at https://www.pubnub.com/llms-full.txt

In this request, the `auth-key` is the client that has permissions to modify Access Manager permissions, not the `auth-key` you want to modify permissions on.

The one you are changing permissions for is within the parameters.

| Path Parameters |
| --- |
| `sub_key`string—**REQUIRED**Your app's subscribe key from Admin Portal.Example: sub-c-50264475-1902-558x-d213-7p19052012n2 |

| Query Parameters |
| --- |
| `signature`string—**REQUIRED**Used to verify the request was signed with the secret key associated with the subscribe key. For information on how to compute the signature, refer to Signature generation.Example: v2.k80LsDMD-sImA8rCBj-ntRKhZ8mSjHY8Ivngt9W3Yc4 |
| `auth`string—**REQUIRED**The Auth key that is being granted permissions.Example: myAuthKey |
| `uuid`stringA UTF-8 encoded string of up to 92 characters used to identify the client.Example: myUniqueUserId |
| `timestamp`integer—**REQUIRED**Unix epoch timestamp used as a nonce for signature computation. Must have no more than ± 60 second offset from NTP. This is not associated with the TTL at all.Example: 123456789 |
| `ttl`integerTime to live for permission to be valid.Example: 123456789 |
| `channel`stringThe channel ID to perform the operation on. Comma separated values are accepted.Example: myChannel,myChannel2 |
| `channel-group`stringComma-separated list of channel group names to perform the operation on.Example: myChannelGroup1,myChannelGroup2 |
| `target-uuid`stringSpecifies the channel groups on which to grant permissions. Comma separated values are accepted.Example: user-1,user-2 |
| `w`integerPossible values: [0, 1]Write permissionExample: 1 |
| `r`integerPossible values: [0, 1]Read permission |
| `m`integerPossible values: [0, 1]Manage permission |
| `d`integerPossible values: [0, 1]Delete permission |
| `g`integerPossible values: [0, 1]Get permission |
| `u`integerPossible values: [0, 1]Update permission |
| `j`integerPossible values: [0, 1]Join permission |

| Responses |
| --- |
| `200`OKSchema — OPTIONALstatus number — OPTIONALmessage string — OPTIONALpayload object — OPTIONALauths [object Object] — OPTIONALttl number — OPTIONALchannels — OPTIONALchannel-groups — OPTIONALuuids object — OPTIONALsubscribe_key string — OPTIONALlevel string — OPTIONALchannel string — OPTIONALservice string — OPTIONAL | Schema—**OPTIONAL** | `status`number—**OPTIONAL** | `message`string—**OPTIONAL** | `payload`object—**OPTIONAL**auths [object Object] — OPTIONALttl number — OPTIONALchannels — OPTIONALchannel-groups — OPTIONALuuids object — OPTIONALsubscribe_key string — OPTIONALlevel string — OPTIONALchannel string — OPTIONAL | `auths`[object Object]—**OPTIONAL** | `ttl`number—**OPTIONAL** | `channels`—**OPTIONAL** | `channel-groups`—**OPTIONAL** | `uuids`object—**OPTIONAL** | `subscribe_key`string—**OPTIONAL** | `level`string—**OPTIONAL** | `channel`string—**OPTIONAL** | `service`string—**OPTIONAL** |
| Schema—**OPTIONAL** |
| `status`number—**OPTIONAL** |
| `message`string—**OPTIONAL** |
| `payload`object—**OPTIONAL**auths [object Object] — OPTIONALttl number — OPTIONALchannels — OPTIONALchannel-groups — OPTIONALuuids object — OPTIONALsubscribe_key string — OPTIONALlevel string — OPTIONALchannel string — OPTIONAL | `auths`[object Object]—**OPTIONAL** | `ttl`number—**OPTIONAL** | `channels`—**OPTIONAL** | `channel-groups`—**OPTIONAL** | `uuids`object—**OPTIONAL** | `subscribe_key`string—**OPTIONAL** | `level`string—**OPTIONAL** | `channel`string—**OPTIONAL** |
| `auths`[object Object]—**OPTIONAL** |
| `ttl`number—**OPTIONAL** |
| `channels`—**OPTIONAL** |
| `channel-groups`—**OPTIONAL** |
| `uuids`object—**OPTIONAL** |
| `subscribe_key`string—**OPTIONAL** |
| `level`string—**OPTIONAL** |
| `channel`string—**OPTIONAL** |
| `service`string—**OPTIONAL** |
| `400`Error validating inputs. (E.g. missing required params or invalid input types.) |
| `403`Invalid signature. (E.g. wrong secret key or character set encoding for signature computation.) |

sub_key
*
Type:
string
Your app's subscribe key from
[Admin Portal](https://admin.pubnub.com)
.
signature
*
Type:
string
Used to verify the request was signed with the secret key associated with the subscribe key. For information on how to compute the signature, refer to
[Signature generation](https://www.pubnub.com/docs/sdks/rest-api/access-manager-introduction.md)
.
auth
*
Type:
string
The Auth key that is being granted permissions.
uuid
Type:
string
A UTF-8 encoded string of up to 92 characters used to
[identify the client](https://www.pubnub.com/docs/architecture/core-concepts.md)
.
timestamp
*
Type:
integer
Unix epoch timestamp used as a nonce for signature computation. Must have no more than ± 60 second offset from NTP. This is not associated with the TTL at all.
ttl
Type:
integer
Time to live for permission to be valid.
channel
Type:
string
The channel ID to perform the operation on. Comma separated values are accepted.
channel-group
Type:
string
Comma-separated list of channel group names to perform the operation on.
target-uuid
Type:
string
Specifies the channel groups on which to grant permissions. Comma separated values are accepted.
w
Type:
integer
Write permission
r
Type:
integer
Read permission
m
Type:
integer
Manage permission
d
Type:
integer
Delete permission
g
Type:
integer
Get permission
u
Type:
integer
Update permission
j
Type:
integer
Join permission
status
Type:
number
Example:
200
message
Type:
string
Example:
"Success"
payload
Type:
object
service
Type:
string
Example:
"Access Manager"
Example Response
Example
1
Example
2
Example
3

```
{
  "message": "Success",
  "payload": {
    "level": "uuid",
    "subscribe_key": "sub-key",
    "ttl": 1,
    "uuids": {
      "uuid-1": {
        "auths": {
          "authkey1": {
            "r": 0,
            "w": 0,
            "m": 0,
            "d": 0,
            "g": 0,
            "u": 0,
            "j": 0
          },
          "key2": {
            "r": 0,
            "w": 0,
            "m": 0,
            "d": 0,
            "g": 0,
            "u": 0,
            "j": 0
          }
        }
      },
      "uuid-2": {
        "auths": {
          "key1": {
            "r": 0,
            "authkey2": 0,
            "m": 0,
            "d": 0,
            "g": 0,
            "u": 0,
            "j": 0
          },
          "key2": {
            "r": 0,
            "w": 0,
            "m": 0,
            "d": 0,
            "g": 0,
            "u": 0,
            "j": 0
          }
        }
      }
    }
  },
  "service": "Access Manager",
  "status": 200
}
```
