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. 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://monitoring.safeturf.ai/api/applications/invite" \
  -H "Authorization: Basic <base64(client_id:client_secret)>" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "YOUR_PARTNER_CODE",
    "type": "ONBOARDING",
    "form_data": {
      "business_name": "Test Solar Co"
    }
  }'
When email is included, Safeturf sends the magic-link to the applicant automatically.
curl -X POST "https://monitoring.safeturf.ai/api/applications/invite" \
  -H "Authorization: Basic <base64(client_id:client_secret)>" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "test@example.com",
    "source": "YOUR_PARTNER_CODE",
    "type": "ONBOARDING",
    "form_config": {
      "google_drive_folder_id": "your-gdrive-folder-id",
      "SFAccountId": "your-sf-account-id",
      "SFOpportunityId": "your-sf-opportunity-id",
      "terms_url": "https://example.com/terms",
      "privacy_url": "https://example.com/privacy"
    },
    "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://example.com/onboarding/complete",
    "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).

Advanced Options

type
string
default:"ONBOARDING"
Application type. Determines which form flow the applicant sees. Use "ONBOARDING" unless Safeturf gives you a different value.
redirect_url
string
URL to redirect the applicant to after they submit the form (e.g. back to your portal).
callback_url
string
HTTPS webhook URL on a server you control. When the applicant submits, Safeturf POSTs:
{
  "event": "application.submitted",
  "application_id": "uuid",
  "business_uuid": "uuid",
  "source": "YOUR_PARTNER_CODE",
  "flow_run_id": "uuid",
  "form_data": { "...": "the submitted application" }
}
form_data is the full submitted application, including owner and bank details. Treat the payload as sensitive and only use an HTTPS endpoint you own.
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