ZeroCopyZeroCopy
ReferenceManagement API

Retrieve the current key

GET
/me

Requires no additional scope. Returns the current management key, its team and its assigned scopes.

Authorization

managementKey
headerAuthorizationBearer <zc_mgmt_>

Response Body

The key

application/json
  1. response
key*
team*
Example request
// src/bin/management_identity.rs
// Builds on the example project (/reference/json-rpc#example-project).
use swqos_examples::swqos::{Result, required};

#[tokio::main]
async fn main() -> Result<()> {
    let endpoint = reqwest::Url::parse("https://console.zerocopy.sh/api/v1/me")?;
    let request = reqwest::Client::new()
        .get(endpoint)
        .bearer_auth(required("MANAGEMENT_API_KEY")?);
    let response = request.send().await?;
    let status = response.status();
    let request_id = response.headers().get("Request-Id")
        .map(|value| value.to_str()).transpose()?.unwrap_or("<missing>").to_owned();
    if let Some(etag) = response.headers().get("ETag") {
        eprintln!("ETag: {}", etag.to_str()?);
    }
    let body = response.text().await?;
    if !status.is_success() {
        return Err(format!("HTTP {status}; Request-Id: {request_id}; {body}").into());
    }
    eprintln!("Request-Id: {request_id}");
    println!("{body}");
    Ok(())
}
Example response
{
  "key": {
    "id": "mk_0123456789abcdef01234567",
    "name": "Grafana metrics",
    "scopes": [
      "usage:read"
    ],
    "expires_at": "2027-02-11T09:00:00Z"
  },
  "team": {
    "id": "org_012345abcdef",
    "name": "Example team"
  }
}