---
title: "Create a JWT token to get connection metrics in the data plane"
method: POST
path: "/connections/{id}/metrics/token"
tags: ["Data Plane Tokens"]
---

# Create a JWT token to get connection metrics in the data plane

`POST /connections/{id}/metrics/token`

## Request

- Base URL: `https://replace-with-account.api.decodable.co/v1alpha2`
- URL: `https://replace-with-account.api.decodable.co/v1alpha2/connections/{id}/metrics/token`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/decodable/apis/decodable-control-plane/docs/connections/:id/metrics/token/post.ts> (a function with typed inputs; its response is checked against the schema)

Retrieve a token for connection metrics in the data plane

## Response `200`

A request and token issued by the control plane API for use with the data plane API.

- object
  - `token` string, required: A JWT token issued by the control plane API permitting a specific request to the data plane.
  - `data_plane_request` string: A stringified json request body for the data plane API which is permitted and signed by the associated JWT token. It must be sent verbatim (including whitespace) in order to match the token signature.

## Other responses

- `400`: An invalid request was received.
- `403`: Access denied: requesting user lacks a required permission.
- `default`: An error has occurred.

---

[API](https://skmtc.dev/decodable/apis/decodable-control-plane.md) - [All operations](https://skmtc.dev/decodable/apis/decodable-control-plane/llms.txt) - [OpenAPI document](https://skmtc.dev/decodable/apis/decodable-control-plane/revisions/9718a3019da8?raw)
