Skip to main content
POST
/
api
/
v1
/
subscribers
/
{id}
/
change-pin
curl -X POST "https://olive-gateway-a6ba.onrender.com/api/v1/subscribers/sub_abc123/change-pin" \
  -H "Authorization: Bearer olive_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "current_pin": "1234",
    "new_pin": "5678"
  }'
{
  "success": true,
  "message": "PIN changed successfully"
}
Changing PIN requires verification of the current PIN first.

Request

Authorization
string
required
Bearer olive_live_xxx or Bearer eyJ... (JWT)

Path Parameters

id
string
required
Subscriber UUID (e.g., sub_abc123)

Body Parameters

current_pin
string
required
Current 4-digit PIN
new_pin
string
required
New 4-digit PIN

Response

success
boolean
Whether change succeeded
message
string
Result message

Examples

curl -X POST "https://olive-gateway-a6ba.onrender.com/api/v1/subscribers/sub_abc123/change-pin" \
  -H "Authorization: Bearer olive_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "current_pin": "1234",
    "new_pin": "5678"
  }'
{
  "success": true,
  "message": "PIN changed successfully"
}

PIN Rules

Format

  • Exactly 4 digits
  • Numbers only (0-9)
  • No spaces or special characters

Security

  • Cannot be same as current PIN
  • Sequential patterns discouraged
  • Simple patterns (1111) warned

Validation

RuleInvalid ExampleReason
Length123Must be 4 digits
Numeric12abNumbers only
Same as current12341234Must be different

Notifications

A WhatsApp notification is sent to the subscriber when their PIN is changed.

Errors

StatusCodeDescription
400INVALID_PIN_FORMATPIN must be 4 digits
400SAME_PINNew PIN same as current
401UNAUTHORIZEDInvalid or missing API key
401WRONG_CURRENT_PINCurrent PIN incorrect
403ACCOUNT_LOCKEDToo many failed attempts
404NOT_FOUNDSubscriber not found
500INTERNAL_ERRORServer error

Verify PIN

Verify a PIN without changing it