ZeroCopyZeroCopy
ReferenceManagement API

Pause a customer key

POST
/customer-keys/{id}/pause

Requires the partner:write scope. Pauses a customer key without changing its secret and returns the key with its current ETag. Paused keys reject sending requests with key_paused. No request body is needed. An already paused key returns 400 invalid_request unless this request replays a saved idempotent response. A revoked key returns 404 not_found.

Authorization

managementKey
headerAuthorizationBearer <zc_mgmt_>

Path Parameters

id*string
Match^key_[0-9a-f]{12}$

Header Parameters

If-Match?string

Change only the key version last read; a stale validator returns 412

Idempotency-Key?string

Makes a retry return the first successful response instead of repeating the state change

Length1 <= length <= 255

Response Body

The paused customer key

application/json
  1. response
id*string
name*string|null
products*array<>
created_at*|null
expires_at*|null
paused_at*|

When the key was paused, or null. Use the customer-key pause and resume endpoints to change it

revoked*boolean
revoked_at*|null
rules*

Rules for a key's read products; a request must also pass the endpoint's own

send*|

The key's sending settings; null without the send product

customer_ref*|

Customer reference, or null for an unassigned key

Length1 <= length <= 100
Example request
// src/bin/management_pause_customer_key.rs
// Builds on the example project (/reference/json-rpc#example-project).
use swqos_examples::swqos::{Result, required};

#[tokio::main]
async fn main() -> Result<()> {
    let key_id: String = required("KEY_ID")?;
    let mut endpoint = reqwest::Url::parse("https://console.zerocopy.sh/api/v1/customer-keys/")?;
    endpoint.path_segments_mut().map_err(|_| "invalid base URL")?
        .pop_if_empty().push(&key_id);
    endpoint.path_segments_mut().map_err(|_| "invalid base URL")?.push("pause");
    let request = reqwest::Client::new()
        .post(endpoint)
        .bearer_auth(required("MANAGEMENT_API_KEY")?);
    let request = if let Ok(etag) = std::env::var("KEY_ETAG") {
        request.header("If-Match", etag)
    } else {
        request
    };
    // Reuse this key when retrying the same state change.
    let request = request.header("Idempotency-Key", required("KEY_REQUEST_ID")?);
    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
{
  "id": "key_012345abcdef",
  "name": "Acme primary",
  "products": [
    "send"
  ],
  "created_at": "2026-11-12T09:00:00Z",
  "expires_at": null,
  "paused_at": "2026-11-13T02:14:00Z",
  "revoked": false,
  "revoked_at": null,
  "rules": {
    "endpoints": {
      "mode": "all"
    },
    "ips": [],
    "origins": [],
    "methods": {
      "mode": "all",
      "list": []
    }
  },
  "send": {
    "rate_per_second": 15,
    "min_tip_lamports": 1000000
  },
  "customer_ref": "acme-123"
}