Set or revoke a SIP peer password
PUT
/v1/peer/{peer}/setpass
const url = 'https://example.com/v1/peer/example/setpass';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"password":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/v1/peer/example/setpass \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "password": "example" }'Computes HA1 from the supplied plaintext password and stores it; returns 204. With ?clear=true (or X-Clear: true) instead revokes the credential — the stored HA1 is reset to empty, so the device can no longer authenticate (checkauth fails closed on an empty HA1) until a new password is set. In clear mode no request body is read. Both modes require the peer:setpass action, held by a grant covering the peer’s owning namespace (namespace, partition, or system scope).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”peer
required
string
SIP peer key: username@realm (URL-encoded)
Query Parameters
Section titled “Query Parameters”clear
boolean
When true, revoke the credential (reset the stored HA1 to empty) instead of setting a password. No request body is read.
Request Body
Section titled “Request Body”Media typeapplication/json
object
password
required
string
Examplegenerated
{ "password": "example"}Responses
Section titled “Responses”Password set or credential revoked
default
Section titled “default”Error response
Media typeapplication/problem+json
RFC 7807 Problem Details
object
type
Problem type slug URI
string
title
string
status
integer
detail
string
key
additional properties
any
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}