palbaseDocs

Palbase Notify · API

PUT/notify/providers/{channel}/{provider}

Bring a provider

Stores the project's own provider for a channel — its credentials sealed with the project's key, checked as the sender will use them. A project with an active email provider sends its email through it instead of the platform's shared sender. Texts go through the project's own SMS providers only, and its one-time codes through them or through its own verification service (Twilio Verify). An İYS account (channel iys: its brand's API user — username, password, iys_code, brand_code, and recipient_type BIREYSEL unless TACIR) makes a commercial text or email go only to one İYS holds a consent of, and tells İYS of each marketing_sms and marketing_email choice.

Called by your server, with the project's secret key.

Path

channel"email" | "sms" | "verify" | "whatsapp" | "push" | "iys" · requiredThe channel: email, sms, verify (a verification service for one-time codes), whatsapp, push, or iys (the project's own İYS account).
providerstring · requiredThe provider: for email acs, ses, sendgrid or smtp; for sms twilio, vonage or acs; for verify twilio_verify; for whatsapp meta; for push fcm, apns or expo; for iys iys.

Headers

Idempotency-Keystring · optionalMakes the write safe to send again (at most 255 characters). A retry with the same key and the same request gets the first answer back, marked `Idempotent-Replayed: true`, and changes nothing; the same key with a different request is refused with 422, and while the first request still runs a retry gets 409 with Retry-After. Answers are kept for 24 hours.

Request body

activeboolean · optional
credentialsobject · requiredThe provider's credentials, by channel. email — acs {connection_string, from_email}; ses {region, access_key_id, secret_access_key, from_domain}; sendgrid {api_key, from_domain, webhook_public_key: the signed Event Webhook's verification key, for delivery reports}; smtp {host, port, username, password, from_email, use_starttls}. sms — twilio {account_sid, auth_token or api_key_sid + api_key_secret, from_number or messaging_service_sid; with the auth token Twilio reports each text's delivery}; vonage {api_key, api_secret, from, signature_secret + signature_method (md5hash, md5, sha1, sha256, sha512) for its signed delivery receipts}; acs {connection_string, from_number}. verify — twilio_verify {account_sid, auth_token or api_key_sid + api_key_secret, service_sid}. whatsapp — meta {phone_number_id, access_token, api_version, app_secret + verify_token for its webhook}. push — fcm {the service account JSON}; apns {private_key, team_id, key_id: a team-scoped APNs key, asked of Apple when saved; bundle_id and is_production optional — a push goes to the bundle of the app the device registered from, through the APNs environment it said}; expo {access_token}.
priorityinteger · optional
curl
curl -X PUT "https://<your-ref>.palbase.studio/notify/providers/<channel>/<provider>" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"credentials":{}}'

Responses

200The provider

400Validation failed or a required field is missing

401Missing or invalid API key

403Not the project's secret key, or not what the shared sender sends for it (`own_provider_required`; `auth_template_reserved`: auth's templates, which auth's own flows alone send through it, but for an organization's invitation, auth.org_invitation); or a change to the platform's own project (`owner_only`) without its owner's access token (X-Palbase-Owner) or its operator's token (X-Palbase-Operator) beside the key. An owner's sign-in that is not a passkey one from the last 15 minutes is 401 `insufficient_user_authentication`.

404No such provider, template or message

409A request with this Idempotency-Key is still running

422The Idempotency-Key was sent with a different request

429Over the project's request limit, or its shared sends for this window

503Temporarily unavailable; retrying is safe after Retry-After

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation PutNotifyProvider of notify's contract.