---
title: "ezgh keys grants create"
description: "Let a user or bot use a key."
---

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

# ezgh keys grants create

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh keys grants create <key> --name n --grantee user:<id>|bot:<id> --action a... [--context key=value]... [flags]
```

Give a user or bot some of a key's use actions, without changing its policy. The grant stands in for the key policy only: IAM must still allow the grantee. You can only pass on what the policy gives you. `--context` limits the grant to requests with those encryption context values. A bot is named by its UUID, in lower case, not its bot\_… slug.

Part of [`ezgh keys grants`](/cli/reference/keys-grants).

## Examples

```sh
ezgh keys grants create kms_… --name ci --grantee bot:0199… --action keys.keys.decrypt
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--action` | string, repeatable |  | a use action, such as keys.keys.decrypt; repeat for more |
| `--context` | string, repeatable |  | only with this encryption context, key=value; repeat for more |
| `--context-file` | string |  | only with this encryption context, from a file holding a JSON object of strings |
| `--grantee` | string |  | who it's for: user:&lt;id&gt; or bot:&lt;id&gt; |
| `--name` | string |  | what the grant is for |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/keys-grants-create/index.mdx
