Replace credentials

Sets one of your org's notify provider credentials.

PUT /v1/notify/credentials/{provider}/{key}

Addresshttps://api.hanzo.ai/v1/notify/credentials/{provider}/{key}
MethodPUT
Operationput_notify_credentials_by_provider_by_key
AuthAuthorization: Bearer $HANZO_API_KEY

Sets one of your org's notify provider credentials.

The value is sealed in KMS under your org and read by notify alone, at the moment it sends; no route answers it back, this one included. Setting a key that is already set replaces it, which is how a credential is rotated, and the next send uses the new value. The key must be one the provider reads — Twilio's account-sid, auth-token and from-number, say — and anything else is a 400 naming the keys it does read. An unknown provider is a 404.

Org admin only: a credential set here is what every message the org sends goes out with.

Request

5 fields, body application/json (required).

FieldInTypeRequiredDescription
providerpathstringyesProvider is the delivery provider the credential is for: twilio, plivo, twilio_email or mail.
keypathstringyesKey is one of the credentials that provider reads, such as auth-token or smtp-host.
keybodystring—Key is one of the credentials that provider reads, such as auth-token or smtp-host.
providerbodystring—Provider is the delivery provider the credential is for: twilio, plivo, twilio_email or mail.
valuebodystring—Value is sealed in KMS and never answered, logged or echoed.

Response

StatusBodyMeaning
200notify.notifyStoredok
defaultproblem-detailsrefused

200 body — 3 fields.

FieldInTypeAlwaysDescription
keybodystring—Key is the credential that was set.
providerbodystring—Provider is the provider the credential was set for.
storedbodyboolean—Stored is true: the value is sealed and the next send reads it.

Failure carries the platform error shape — see Errors.

Examples

hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.

import { Configuration, NotifyApi } from 'hanzoai';

const api = new NotifyApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.putNotifyCredentialsByProviderByKey({ provider: 'provider', key: 'key', key: "<key>", provider: "<provider>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import NotifyApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = NotifyApi(client).put_notify_credentials_by_provider_by_key(provider='provider', key='key', key="<key>", provider="<provider>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.NotifyAPI.PutNotifyCredentialsByProviderByKey(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, notify_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = notify_api::put_notify_credentials_by_provider_by_key(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.NotifyApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new NotifyApi(client).putNotifyCredentialsByProviderByKey();
curl -X PUT https://api.hanzo.ai/v1/notify/credentials/<provider>/<key> \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "key": "<key>",
       "provider": "<provider>"
     }'

MCP reaches notify through the notify tool, which names its 4 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "get_notify_health"
         }
       }
     }'

Notify API · All Hanzo APIs · Interactive reference

Was this page useful?