POST
/
api
/
applications
/
invite
Generate Invite Link
curl --request POST \
  --url https://monitoring.safeturf.ai/api/applications/invite \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "source": "<string>",
  "email": "<string>",
  "form_config": {
    "google_drive_folder_id": "<string>",
    "SFAccountId": "<string>",
    "SFOpportunityId": "<string>",
    "terms_url": "<string>",
    "privacy_url": "<string>"
  },
  "form_data": {
    "business_name": "<string>",
    "dba": "<string>",
    "ein": "<string>",
    "entity_type": "<string>",
    "state_of_incorporation": "<string>",
    "address": "<string>",
    "zip": "<string>",
    "phone": "<string>",
    "website": "<string>",
    "annual_sales_revenue": "<string>",
    "annual_finance_revenue": 123,
    "average_ticket_size": 123,
    "current_financing_provider": "<string>",
    "principals": [
      {
        "first_name": "<string>",
        "last_name": "<string>",
        "email": "<string>",
        "phone": "<string>",
        "ssn": "<string>",
        "date_of_birth": "<string>",
        "address": "<string>",
        "zip": "<string>",
        "is_primary": true
      }
    ]
  },
  "type": "<string>",
  "redirect_url": "<string>",
  "callback_url": "<string>",
  "current_step": "<string>"
}
'
{
  "link": "<string>",
  "application_id": "<string>",
  "token": "<string>",
  "expires_at": "<string>"
}
This endpoint requires HTTP Basic authentication. Use your Keycloak client_id as the username and client_secret as the password.
Authorization: Basic base64(client_id:client_secret)
Contact your Safeturf integration contact to get your client credentials.
Creates a new draft application and returns a magic-link. If email is provided, the link is also emailed to the applicant automatically. If omitted, only the link is returned — useful when you want to embed it in your own email template.

Required Fields

source
string
required
Your partner code (e.g. "PLMT"). Provided by Safeturf during integration setup.

Optional Fields

email
string
Applicant’s email address. When provided, Safeturf sends the magic-link invite email automatically. When omitted, no email is sent — the link is returned in the response for you to distribute however you like.

form_config

Partner integration settings for this application. All fields are optional — only include what applies to your integration.
form_config
object

form_data

Pre-fill the onboarding form with data you already have. Any field you provide will appear pre-populated — the applicant only needs to fill in whatever is missing.
form_data
object

Examples

Use this when you want to embed the link in your own email template.
curl -X POST "https://stage.safeturf.ai/api/applications/invite" \
  -H "Authorization: Basic cGFydG5lci1wYWxtZXR0bzpQeHZDWWhIQzcyMlI2UjNFWm5JdHgzVGJtQWhOZno2aQ==" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "PLMT",
    "type": "EPC",
    "form_data": {
      "business_name": "Test Solar Co"
    }
  }'
When email is included, Safeturf sends the magic-link to the applicant automatically.
curl -X POST "https://stage.safeturf.ai/api/applications/invite" \
  -H "Authorization: Basic cGFydG5lci1wYWxtZXR0bzpQeHZDWWhIQzcyMlI2UjNFWm5JdHgzVGJtQWhOZno2aQ==" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "test@example.com",
    "source": "PLMT",
    "type": "EPC",
    "form_config": {
      "google_drive_folder_id": "your-gdrive-folder-id",
      "SFAccountId": "your-sf-account-id",
      "SFOpportunityId": "your-sf-opportunity-id",
      "terms_url": "https://palmetto.com/legal/terms-and-conditions",
      "privacy_url": "https://palmetto.com/privacy-and-data-requests"
    },
    "form_data": {
      "business_name": "Test Solar Co",
      "phone": "555-123-4567",
      "principals": [
        {
          "first_name": "John",
          "last_name": "Doe",
          "email": "john@example.com",
          "is_primary": true
        }
      ]
    },
    "redirect_url": "https://palmetto.com/success",
    "callback_url": "https://your-webhook-url.com/callback"
  }'

Response

{
  "application_id": "550e8400-e29b-41d4-a716-446655440000",
  "token": "Xk9mP2qRvNzL...",
  "link": "https://onboarding.safeturf.ai/apply?token=Xk9mP2qRvNzL...",
  "expires_at": "2026-05-09T23:00:00+00:00"
}
Magic link for the applicant. Use this in your own email template, or let Safeturf send it by providing email. Expires in 30 days.
application_id
string
Store this for status polling and tracking.
token
string
The raw token. The full link is also returned for convenience.
expires_at
string
ISO 8601 expiration timestamp (30 days from creation).

Application Types

type valueUse case
"EPC"Solar dealer onboarding
"ComfortPlan"HVAC dealer onboarding
"ONBOARDING"Default — general onboarding

Advanced Options

type
string
default:"ONBOARDING"
Application type. Determines which form flow the applicant sees. Use "EPC" for Solar or "ComfortPlan" for HVAC.
redirect_url
string
URL to redirect the applicant to after they submit the form (e.g. back to your portal).
callback_url
string
Webhook URL. When the application is submitted, we POST a notification:
{
  "event": "application.submitted",
  "application_id": "uuid",
  "business_uuid": "uuid",
  "source": "PLMT",
  "flow_run_id": "uuid"
}
current_step
string
Open the form at a specific step (useful when business info is prefilled).
ValueForm opens at
(omit)Business Info (default)
principalsBusiness Info
bank_infoPrincipal
locationsBank Info
reviewLocations
review_submitReview & Submit