Developers
API v1.0
Referral Partner Integration

Lead Intake API

Submit qualified referral leads securely to Defiant Law using a straightforward HTTPS JSON endpoint.

ProtocolHTTPS
FormatJSON / UTF-8
MethodPOST
Typical responseWithin 60 seconds
Credential notice

The complete Power Automate endpoint contains a SAS signature and must be treated as a secret. The production URL is delivered separately to approved partners and is intentionally excluded from this public documentation package.

01

Authentication

Access is controlled through the Microsoft Power Automate SAS-signed endpoint.

SAS-signed endpoint

No separate API key or OAuth token is currently required. The complete endpoint URL—including its query string—is the credential.

  • Use HTTPS only.
  • Do not publish, log, or share the endpoint outside the authorized integration team.
  • Do not place the endpoint in browser-side JavaScript or public source control.
  • Contact Defiant Law immediately if the URL may have been exposed.
02

Endpoint

Send one lead per request using HTTP POST.

POST [PARTNER-SPECIFIC-POWER-AUTOMATE-ENDPOINT]

Required header

Content-Type: application/json

Recommended header

Accept: application/json
03

Request body

Send a JSON object using the field names below.

Example request
{
  "externalLeadId": "LGT-123456",
  "firstName": "John",
  "lastName": "Doe",
  "phone": "9095551234",
  "email": "john.doe@example.com",
  "state": "CA",
  "bestTime": "Afternoon",
  "preferredLanguage": "English",
  "campaign": "California Solar Campaign",
  "notes": "Customer requested an afternoon callback.",
  "submittedAt": "2026-07-27T21:30:00Z"
}
FieldTypeRequiredDescription
externalLeadIdstringRecommendedUnique identifier assigned by the referral partner.
firstNamestringYesLead's first name.
lastNamestringYesLead's last name.
phonestringYesPrimary telephone number.
emailstringYesValid email address.
statestringYesTwo-letter supported state abbreviation.
bestTimestringNoPreferred time for contact.
preferredLanguagestringNoPreferred language: English or Spanish.
campaignstringNoPartner campaign name or identifier.
notesstringNoAdditional information about the lead.
submittedAtstringRecommendedISO 8601 UTC submission timestamp.
04

Validation rules

Requests that fail validation return a 400 or 422 response.

Names

firstName and lastName are required, cannot be blank, and should not exceed 100 characters.

Phone

Common US formats are accepted, including 9095551234, (909) 555-1234, and +1 909-555-1234.

Email

A syntactically valid email address is required and should not exceed 254 characters.

State

Supported values: AZ, CA, NM, NV, and TX.

Language

Supported values: English and Spanish. Values are normalized without case sensitivity.

Timestamp

Use ISO 8601 UTC, for example 2026-07-27T21:30:00Z.

05

Success response

A successful request creates a lead and returns its Defiant Law Intake ID.

201Created
application/json
{
  "success": true,
  "intakeId": "lgt-a63f1358-79db-4f3b-9d23-8f26994a4852",
  "message": "Lead created."
}
06

Error codes

Use the HTTP status and machine-readable error code to determine the appropriate action.

StatusCodeMeaningRetry?
400INVALID_REQUESTMalformed JSON or missing required field.No
409DUPLICATE_LEADThe same external lead ID was already received.No
422VALIDATION_ERROROne or more values failed validation.No
429RATE_LIMIT_EXCEEDEDMore than 100 requests were submitted in one minute.Yes
500INTERNAL_ERRORThe lead could not be processed.Yes
503SERVICE_UNAVAILABLEThe service is temporarily unavailable.Yes
View validation error example
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "One or more fields failed validation.",
    "details": [
      {
        "field": "state",
        "message": "State must be one of: AZ, CA, NM, NV, or TX."
      }
    ]
  }
}
07

Rate limits & retries

Apply exponential backoff only to temporary failures.

Rate limit100requests per minute
Expected response≤ 60sfor most requests
Client timeout90srecommended minimum
InitialImmediately
Retry 1After 2 seconds
Retry 2After 4 seconds
Retry 3After 8 seconds
Retry these statuses: 429, 500, 502, 503, and 504. Do not automatically retry 400, 409, or 422.
08

Request examples

Replace the endpoint placeholder with the secure URL provided by Defiant Law.

curl --request POST \
  --url "[PARTNER-SPECIFIC-POWER-AUTOMATE-ENDPOINT]" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --data @lead.json
const response = await fetch(process.env.DEFIANT_LEAD_ENDPOINT, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Accept": "application/json"
  },
  body: JSON.stringify(lead)
});

if (!response.ok) {
  throw new Error(`Lead submission failed: ${response.status}`);
}

const result = await response.json();
import os
import requests

response = requests.post(
    os.environ["DEFIANT_LEAD_ENDPOINT"],
    json=lead,
    headers={"Accept": "application/json"},
    timeout=90,
)
response.raise_for_status()
result = response.json()
09

Downloads

Use these files to accelerate implementation and testing.

Integration Support

Questions or testing assistance?

Contact Defiant Law Intake Operations and include the partner name, external lead ID, request timestamp, and HTTP status received. Do not send the complete SAS endpoint in ordinary email threads.

Isaac Ramirez Intake Operations Manager Jonathan@defiant-law.com