EstateHub

Administrator SMS Integration API

Available since v1.0.1.

Base URL: http://localhost:8000/api/v1
Prefix: /admins/platform-settings/integrations
Auth: Administrator JWT required
Headers: Content-Type: application/json

1. Get SMS Configuration

Retrieve the saved integration state and sanitized configuration.

GET/admins/platform-settings/integrations/sms/

Auth: Required

Headers

HTTP
Authorization: Bearer {{admin_access_token}}
Content-Type: application/json

Success Example

JSON
{
  "success": true,
  "message": "Integration retrieved successfully.",
  "data": {
    "integration": {
      "type": "sms",
      "is_enabled": true,
      "configured": true,
      "config": {
        "provider": "twilio",
        "twilio_account_sid": "replace-with-account-sid",
        "twilio_phone_number": "+15125550100",
        "has_twilio_api_key": true,
        "has_twilio_api_secret": true,
        "has_vonage_private_key": false,
        "has_infobip_api_key": false,
        "has_sinch_api_token": false
      },
      "updated_at": "2026-11-24T10:00:00Z"
    }
  }
}

Notes

Sensitive values are returned as has_* flags. configured means encrypted configuration exists; it does not verify provider credentials. A missing integration record is created disabled.

Applicable errors: 401 missing/invalid JWT; 403 administrator access required; 406 unsupported response format.

Unauthorized - HTTP 401

JSON
{
  "success": false,
  "message": "Authentication credentials were not provided.",
  "errors": {}
}

Forbidden - HTTP 403

JSON
{
  "success": false,
  "message": "You do not have permission to perform this action.",
  "errors": {}
}

2. Update SMS Configuration

Save provider configuration and optionally enable or disable the integration.

PATCH/admins/platform-settings/integrations/sms/

Auth: Required

Headers

HTTP
Authorization: Bearer {{admin_access_token}}
Content-Type: application/json

Request Body

FieldTypeRequirement
is_enabledbooleanOptional; preserves the saved state when omitted.
configobjectOptional; merges the submitted fields with saved configuration.

Twilio

JSON
{
  "is_enabled": true,
  "config": {
    "provider": "twilio",
    "twilio_account_sid": "replace-with-account-sid",
    "twilio_api_key": "replace-with-api-key",
    "twilio_api_secret": "replace-with-api-secret",
    "twilio_phone_number": "+15125550100"
  }
}

Vonage

JSON
{
  "is_enabled": true,
  "config": {
    "provider": "vonage",
    "vonage_application_id": "replace-with-application-id",
    "vonage_private_key": "-----BEGIN PRIVATE KEY-----\nreplace-with-your-private-key\n-----END PRIVATE KEY-----",
    "vonage_from_number": "+15125550100"
  }
}

Infobip

JSON
{
  "is_enabled": true,
  "config": {
    "provider": "infobip",
    "infobip_api_key": "replace-with-api-key",
    "infobip_base_url": "https://your-subdomain.api.infobip.com",
    "infobip_from_number": "+15125550100"
  }
}

Sinch

JSON
{
  "is_enabled": true,
  "config": {
    "provider": "sinch",
    "sinch_service_plan_id": "replace-with-service-plan-id",
    "sinch_api_token": "replace-with-api-token",
    "sinch_from_number": "+15125550100",
    "sinch_region": "us"
  }
}

Success Example

JSON
{
  "success": true,
  "message": "Integration updated successfully.",
  "data": {
    "integration": {
      "type": "sms",
      "is_enabled": true,
      "configured": true,
      "config": {
        "provider": "twilio",
        "twilio_account_sid": "replace-with-account-sid",
        "twilio_phone_number": "+15125550100",
        "has_twilio_api_key": true,
        "has_twilio_api_secret": true,
        "has_vonage_private_key": false,
        "has_infobip_api_key": false,
        "has_sinch_api_token": false
      },
      "updated_at": "2026-11-24T10:00:00Z"
    }
  }
}

Notes

Both is_enabled and config are optional. PATCH merges with saved configuration; omit unchanged secrets to retain them. Required values must exist in the merged configuration when enabled. Saving does not verify provider connectivity. Disable with { "is_enabled": false }; re-enable with { "is_enabled": true } when configuration is complete.

Select one provider at a time. Send only its configuration fields in each PATCH. Switching providers retains saved credentials for other providers. Vonage uses the Messages API application ID and PEM private key; encode PEM newlines as \n in raw JSON. Sinch regions: us, eu, au, br, ca. Infobip requires an absolute base URL. Use Send Test SMS after enabling; a successful submission does not confirm delivery.

Required fields when enabled

ProviderRequired fields
twiliotwilio_account_sid, twilio_api_key, twilio_api_secret, twilio_phone_number
vonagevonage_application_id, vonage_private_key, vonage_from_number
infobipinfobip_api_key, infobip_base_url, infobip_from_number
sinchsinch_service_plan_id, sinch_api_token, sinch_from_number, sinch_region

The selected provider is also required.

Configuration fields

FieldTypeDetails
providerenumOptional in a partial update
twilio_account_sidstringMaximum length: 255; blank allowed
twilio_api_keystringMaximum length: 255; blank allowed; write-only
twilio_api_secretstringMaximum length: 255; blank allowed; write-only
twilio_phone_numberstringMaximum length: 50; blank allowed
vonage_application_idstringMaximum length: 255; blank allowed
vonage_private_keystringblank allowed; write-only
vonage_from_numberstringMaximum length: 50; blank allowed
infobip_api_keystringMaximum length: 2048; blank allowed; write-only
infobip_base_urlURL stringblank allowed
infobip_from_numberstringMaximum length: 50; blank allowed
sinch_service_plan_idstringMaximum length: 255; blank allowed
sinch_api_tokenstringMaximum length: 2048; blank allowed; write-only
sinch_from_numberstringMaximum length: 50; blank allowed
sinch_regionenumOptional in a partial update

Disable without deleting configuration

JSON
{
  "is_enabled": false
}

Re-enable with complete saved configuration

JSON
{
  "is_enabled": true
}

Applicable errors: 400 invalid/missing configuration or malformed JSON; 401 missing/invalid JWT; 403 administrator access required; 406 unsupported response format; 415 unsupported content type.

Unauthorized - HTTP 401

JSON
{
  "success": false,
  "message": "Authentication credentials were not provided.",
  "errors": {}
}

Forbidden - HTTP 403

JSON
{
  "success": false,
  "message": "You do not have permission to perform this action.",
  "errors": {}
}

Twilio - Missing credentials (no saved provider values) - HTTP 400

JSON
{
  "success": false,
  "message": "Validation failed.",
  "errors": {
    "config": {
      "twilio_account_sid": "This field is required when enabling the integration.",
      "twilio_api_key": "This field is required when enabling the integration.",
      "twilio_api_secret": "This field is required when enabling the integration.",
      "twilio_phone_number": "This field is required when enabling the integration."
    }
  }
}

Vonage - Missing credentials (no saved provider values) - HTTP 400

JSON
{
  "success": false,
  "message": "Validation failed.",
  "errors": {
    "config": {
      "vonage_application_id": "This field is required when enabling the integration.",
      "vonage_private_key": "This field is required when enabling the integration.",
      "vonage_from_number": "This field is required when enabling the integration."
    }
  }
}

Infobip - Missing credentials (no saved provider values) - HTTP 400

JSON
{
  "success": false,
  "message": "Validation failed.",
  "errors": {
    "config": {
      "infobip_api_key": "This field is required when enabling the integration.",
      "infobip_base_url": "This field is required when enabling the integration.",
      "infobip_from_number": "This field is required when enabling the integration."
    }
  }
}

Sinch - Missing credentials (no saved provider values) - HTTP 400

JSON
{
  "success": false,
  "message": "Validation failed.",
  "errors": {
    "config": {
      "sinch_service_plan_id": "This field is required when enabling the integration.",
      "sinch_api_token": "This field is required when enabling the integration.",
      "sinch_from_number": "This field is required when enabling the integration.",
      "sinch_region": "This field is required when enabling the integration."
    }
  }
}

3. Send Test SMS

Submit a fixed test message through the enabled SMS provider.

POST/admins/platform-settings/integrations/sms/test-sms/

Auth: Required

Headers

HTTP
Authorization: Bearer {{admin_access_token}}
Content-Type: application/json

Request Body

JSON
{
  "to": "{{sms_to}}"
}

Success Example

JSON
{
  "success": true,
  "message": "Test SMS submitted successfully.",
  "data": {
    "recipient": "{{sms_to}}"
  }
}

Notes

Set sms_to to the intended E.164 recipient: leading +, nonzero first digit, at most 15 digits. SMS must be enabled. The server supplies a fixed test message. 200 confirms submission, not delivery.

Applicable errors: 400 disabled SMS, missing/invalid recipient or malformed JSON; 401; 403; 406; 415. Unhandled provider failures may return 500 without the standard JSON envelope.

SMS integration disabled - HTTP 400

JSON
{
  "success": false,
  "message": "Validation failed.",
  "errors": {
    "non_field_errors": [
      "SMS integration is disabled."
    ]
  }
}

Missing recipient - HTTP 400

JSON
{
  "success": false,
  "message": "Validation failed.",
  "errors": {
    "to": [
      "This field is required."
    ]
  }
}

Invalid E.164 recipient - HTTP 400

JSON
{
  "success": false,
  "message": "Validation failed.",
  "errors": {
    "to": [
      "Enter a valid E.164 phone number."
    ]
  }
}

Unauthorized - HTTP 401

JSON
{
  "success": false,
  "message": "Authentication credentials were not provided.",
  "errors": {}
}

Forbidden - HTTP 403

JSON
{
  "success": false,
  "message": "You do not have permission to perform this action.",
  "errors": {}
}

Integrations Overview | Product Integration Guide