# Deploy Keys

### What is a Deploy Key?

A **deploy key** is a special token that is **automatically created** when you create a new subgraph. It is used by the system to authorize deploy and removal operations for your subgraph.

* You do not need to create a deploy key manually — it is generated for you and linked to your account and the specific network (endpoint).
* The deploy key is **not used for regular blockchain queries**. It is only used for deploying and removing subgraphs, both via the UI and API.

### Where is the Deploy Key Used?

* In the subgraph deployment command:

  ```bash
  graph deploy --node https://<GRAPH_NODE_URL> --ipfs https://<IPFS_URL> --version-label 0.0.1 <SUBGRAPH_NAME> --access-token=DEPLOY_KEY
  ```
* When removing a subgraph via API (the system uses it automatically)

### How to Get a Deploy Key?

1. Go to the **Subgraphs** section in the main navigation
2. Click on the **API keys** tab
3. Select the **Deploy Keys** sub-tab — here you will see all your deploy tokens for each network
4. Copy the required key for the selected network

#### UI Example:

<div align="center" data-full-width="false"><figure><img src="https://1171493456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPWuDHqT5CRbrc5eu4gbw%2Fuploads%2Fgit-blob-67cef27abaa6f30b772b4f4f773636356e9f082b%2Fdeploy-keys-tab.png?alt=media" alt="Deploy Keys Tab" width="400"><figcaption><p>Deploy Keys tab within API Keys section</p></figcaption></figure></div>

### How to Use a Deploy Key?

#### For deploying a subgraph:

1. Get the deploy key for the required network
2. Run the command:

   ```bash
   graph deploy --node https://<GRAPH_NODE_URL> --ipfs https://<IPFS_URL> --version-label 0.0.1 <SUBGRAPH_NAME> --access-token=DEPLOY_KEY
   ```

   Where `DEPLOY_KEY` is your deploy token

#### For removing a subgraph:

* The deploy key is used by the system automatically when deleting via UI or API
* You do not need to manually provide the token — everything is handled transparently

### Difference from Other Keys

* **Query key** — used for regular blockchain queries (RPC, GraphQL)
* **API key** — for administrative actions (creating query keys, viewing statistics)
* **Deploy key** — only for deploying and removing subgraphs

### Security

* Do not share your deploy key with third parties
* The deploy key is visible only to the account owner
* If needed, you can regenerate a new deploy key for the selected network

***
