---
title: NerdGraph tutorial: Create, list, and revoke public sharing chart URLs
source: https://docs.newrelic.com/docs/apis/nerdgraph/examples/manage-live-chart-urls-via-api
---

Charts are visual representations of data helping you understand and analyze information from your apps, infrastructure, or services. You can convert these charts into URLs and share them publicly. Public chart links allow you to easily share graphs and data with others, even if they don't have a New Relic account.

With the appropriate [access management configured](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/share-charts-publicly/#access-management), you can create, manage, and revoke publicly accessible live chart URLs using queries and mutations in [NerdGraph](https://docs.newrelic.com/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph/). Alternatively, you can perform these actions via the [New Relic UI](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/share-charts-publicly).

> #### ⚠️ CAUTION
>
> Anyone with access to the live chart URLs can view all the information from the underlying chart query. Ensure that information is shared cautiously and in compliance with your company's internal policies and procedures.

For creating, listing, or revoking  a publicly accessible live chart URL from NerdGraph: go to [GraphQL Explorer](https://one.newrelic.com/nerdgraph-graphiql?state=2f361eaf-e5b7-41a4-5eec-e6910bbc7c47) and then follow these instructions.

## Generate a live chart URL

To create a live chart URL, you first need to know your `account ID`. Use the following mutation to fetch your `account ID`, and then you can create your live chart URL.

**Fetch your account id**

For creating public sharing chart URLs, you need an account ID. This API allows you to retrieve your account ID using the actor query.

#### Sample request

```graphql
{
  actor {
    accounts {
      id
    }
  }
}
```

#### Sample response

```json
{
  "data": {
    "actor": {
      "accounts": [
        {
          "id": xxxxxxxx
        },
        {
          "id": xxxxxxxx
        }
      ]
    }
  }
}
```

**Create a live chart URL**

This API allows you to execute NRQL queries on a specified account and retrieve an embedded chart URL based on the query results.

#### Input parameters

| Parameter | Data Type | Is it Required? | Description                                                                                    |
| --------- | --------- | --------------- | ---------------------------------------------------------------------------------------------- |
| `id`      | Integer   | Yes             | Your account ID refers to the unique identifier associated with the account you wish to query. |
| `query`   | String    | Yes             | The NRQL query to execute.                                                                     |

#### Sample request

````graphql
{
  actor {
    account(id: YOUR_ACCOUNT_ID) {
      nrql(query: "$query") {
        embeddedChartUrl
      }
    }
  }
}

# Parameters:
#  {
#    id: xxxxxxxx
#    query: SELECT count(*) FROM Transaction TIMESERIES
#  }
```

#### Sample response

```json
{
"data": {
"actor": {
"account": {
  "nrql": {
    "embeddedChartUrl": "https://chart-embed.xxx-xxx.newrelic.com/charts/e187axxx-xxxx-449e-xxxx-4fb7a520xxxx"
  }
}
}
}
}
````

## Revoke a live chart URL

To revoke a specific live chart URL, you first need to list all live chart URLs. Use the following query to display the list of live chart URLs. Then, you can select the specific chart's UUID to revoke its URL.

**List all live chart URLs**

This API retrieves live URLs for dashboard widgets, providing the title, URL, creation date, and type for each.

#### Sample request

```graphql
{
 actor {
   dashboard {
     liveUrls {
       liveUrls {
         title
         url
         createdAt
         type
       }
       errors {
         description
       }
     }
   }
 }
}
```

#### Sample response

```json
{
  "data": {
    "actor": {
      "dashboard": {
        "liveUrls": {
          "errors": null,
          "liveUrls": [
            {
              "createdAt": 1753xxxx346xx,
              "title": "",
              "type": "WIDGET",
              "url": "ttps://chart-embed.xxx-xxx.newrelic.com/herald/9ac583f4-b43e-4750-841b-9f1aa39cde00"
            },
            {
              "createdAt": 1753xxxx572xx,
              "title": "",
              "type": "WIDGET",
              "url": "https://chart-embed.xxx-xxx.newrelic.com/herald/5d81451a-4dfb-42de-9682-dae4d7fb7962"
            },
            {
              "createdAt": 17289xxxx694xx,
              "title": "",
              "type": "WIDGET",
              "url": "ttps://chart-embed.xxx-xxx.newrelic.com/herald/c1eac5ac-4a93-42d4-8b25-36078ecc8d79"
            }
          ]
        }
      }
    }
  }
}
```

**Revoke a live chart URL**

This API allows you to revoke the live URL associated with a specific dashboard widget.

#### Input parameters

| Parameter | Data Type | Is it Required? | Description                                   |
| --------- | --------- | --------------- | --------------------------------------------- |
| `uuid`    | String    | Yes             | The unique identifier of the public live URL. |

#### Sample request

````graphql
mutation {
  dashboardWidgetRevokeLiveUrl(uuid: "YOUR_LIVE_CHART_UUID") {
    uuid
    errors {
      description
      type
    }
  }
}

# Parameters:
#  {
#    uuid: xxx1afc8-6d1f-xxxx-9a33-373f64212xxx
#  }
```

 #### Sample response

```json
{
"data": {
"dashboardWidgetRevokeLiveUrl": {
  "errors": null,
  "uuid": "xxx1afc8-6d1f-xxxx-9a33-373f64212xxx"
}
}
}
````

## Related topics

[Introduction to public sharing](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/get-started-sharing-dashboards-publicly)

Introduction to public sharing for dashboards and charts, with availability and pricing details.

[Share charts publicly](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/share-charts-publicly)

Share individual charts with external viewers via live URLs.
