> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.propexo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.propexo.com/_mcp/server.

# Create Lead: AppFolio

POST https://api.propexo.com/v1/leads/appfolio/
Content-Type: application/json

Create Lead: AppFolio| Method         | Interface |
| -------------- | --------- |
| POST /v0/leads | Leads     |This write operation will set the created_record_id flag on the write-status endpoint and allow for new record to be read back in immediately.

Reference: https://docs.propexo.com/api-reference/appfolio/leads/create-lead-app-folio

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.propexo.com` (Production, default)
- `https://api.sandbox.propexo.com` (Sandbox)

## Request

### Body (application/json)

This endpoint expects a _v1_leads_appfolio__post_input.

- `integration_id` (string, required) — The Propexo unique identifier for the integration
- `property_id` (string, required) — The Propexo unique identifier for the property
- `first_name` (string, required) — The first name associated with the lead
- `last_name` (string, required) — The last name associated with the lead
- `employee_id` (string, optional) — The Propexo unique identifier for the employee
- `desired_unit_ids` (list of string, optional) — An array of the Propexo unit IDs that the lead is interested in
- `unit_id` (string, optional) — The Propexo unique identifier for the unit. If desired_unit_ids is not provided, this will be used as the unit ID. This is inteded to help unify the request payload across all PMSs
- `number_of_additional_occupants` (integer, optional) — The number of additional occupants associated with the lead
- `desired_num_bathrooms` (string, optional) — The desired number of bathrooms
- `desired_num_bedrooms` (integer, optional) — The desired number of bedrooms
- `credit_score` (string, optional) — The credit score of the lead
- `target_move_in_date` (V1LeadsAppfolioPostInputTargetMoveInDate, optional) — The target move in date associated with the lead
- `email_1` (string, optional) — The primary email address associated with the lead
- `has_cats` (boolean, optional) — Whether or not the lead has cats
- `has_dogs` (boolean, optional) — Whether or not the lead has dogs
- `has_other_pets` (boolean, optional) — Whether or not the lead has pets that aren't dogs or cats
- `desired_max_rent_in_cents` (integer, optional) — The maximum rent cost the lead is looking to pay, in cents
- `monthly_income_in_cents` (integer, optional) — The monthly income of the lead, in cents
- `middle_initial` (string, optional) — The middle initial of the lead
- `phone_1` (string, optional) — Primary phone number associated with the lead
- `lead_source` (string, optional) — The name of the source of the lead
- `status` (enum, optional) — The status associated with the lead
  - Allowed values: `ACTIVE`, `COLD`, `INACTIVE`, `WAITLISTED`
- `desired_move_in_date` (V1LeadsAppfolioPostInputDesiredMoveInDate, optional, deprecated) — Deprecated. Use target_move_in_date instead.
- `desired_bathrooms` (string, optional, deprecated) — Deprecated. Use desired_num_bathrooms instead.
- `desired_bedrooms` (integer, optional, deprecated) — Deprecated. Use desired_num_bedrooms instead.

## Response

### 200

Successful response

- `meta` (V1LeadsAppfolioPostOutputMeta, required)
- `result` (V1LeadsAppfolioPostOutputResult, required)

## Errors

### 400 Bad Request Error

Bad Request

- `error` (ErrorResponseError, required)

## Types

### V1LeadsAppfolioPostInputTargetMoveInDate

The target move in date associated with the lead

### V1LeadsAppfolioPostInputDesiredMoveInDate

Deprecated. Use target_move_in_date instead.

### V1LeadsAppfolioPostOutputMeta

- `job_id` (string, required)

### V1LeadsAppfolioPostOutputResult

- `integration_id` (string, required) — The Propexo unique identifier for the integration
- `property_id` (string, required) — The Propexo unique identifier for the property
- `first_name` (string, required) — The first name associated with the lead
- `last_name` (string, required) — The last name associated with the lead
- `employee_id` (string, required, nullable) — The Propexo unique identifier for the employee
- `desired_unit_ids` (list of string, required, nullable)
- `unit_id` (string, required, nullable) — The Propexo unique identifier for the unit. If desired_unit_ids is not provided, this will be used as the unit ID. This is inteded to help unify the request payload across all PMSs
- `number_of_additional_occupants` (integer, required, nullable) — The number of additional occupants associated with the lead
- `desired_num_bathrooms` (string, required, nullable) — The desired number of bathrooms
- `desired_num_bedrooms` (integer, required, nullable) — The desired number of bedrooms
- `credit_score` (string, required, nullable) — The credit score of the lead
- `target_move_in_date` (V1LeadsAppfolioPostOutputResultTargetMoveInDate, required, nullable) — The target move in date associated with the lead
- `email_1` (string, required, nullable) — The primary email address associated with the lead
- `has_cats` (boolean, required, nullable) — Whether or not the lead has cats
- `has_dogs` (boolean, required, nullable) — Whether or not the lead has dogs
- `has_other_pets` (boolean, required, nullable) — Whether or not the lead has pets that aren't dogs or cats
- `desired_max_rent_in_cents` (integer, required, nullable) — The maximum rent cost the lead is looking to pay, in cents
- `monthly_income_in_cents` (integer, required, nullable) — The monthly income of the lead, in cents
- `middle_initial` (string, required, nullable) — The middle initial of the lead
- `phone_1` (string, required, nullable) — Primary phone number associated with the lead
- `lead_source` (string, required, nullable) — The name of the source of the lead
- `status` (enum, required) — The status associated with the lead
  - Allowed values: `ACTIVE`, `COLD`, `INACTIVE`, `WAITLISTED`
- `desired_move_in_date` (V1LeadsAppfolioPostOutputResultDesiredMoveInDate, required, nullable, deprecated) — Deprecated. Use target_move_in_date instead.
- `desired_bathrooms` (string, required, nullable, deprecated) — Deprecated. Use desired_num_bathrooms instead.
- `desired_bedrooms` (integer, required, nullable, deprecated) — Deprecated. Use desired_num_bedrooms instead.

### ErrorResponseError

- `code` (string, required)
- `message` (string, required)
- `details` (map from string to any, optional)

### V1LeadsAppfolioPostOutputResultTargetMoveInDate

The target move in date associated with the lead

### V1LeadsAppfolioPostOutputResultDesiredMoveInDate

Deprecated. Use target_move_in_date instead.

## Examples

**Request**

```json
{
  "integration_id": "intg_9f8b7c6d5e4a3b2c1d0e",
  "property_id": "prop_1234567890abcdef",
  "first_name": "Emily",
  "last_name": "Johnson"
}
```

**Response**

```json
{
  "meta": {
    "job_id": "job_20240615_abcdef123456"
  },
  "result": {
    "integration_id": "intg_9f8b7c6d5e4a3b2c1d0e",
    "property_id": "prop_1234567890abcdef",
    "first_name": "Emily",
    "last_name": "Johnson",
    "employee_id": "emp_9876543210fedcba",
    "desired_unit_ids": [
      "unit_0011223344556677",
      "unit_8899aabbccddeeff"
    ],
    "unit_id": "unit_0011223344556677",
    "number_of_additional_occupants": 2,
    "desired_num_bathrooms": "2",
    "desired_num_bedrooms": 3,
    "credit_score": "720",
    "target_move_in_date": "2024-09-01T00:00:00Z",
    "email_1": "emily.johnson@example.com",
    "has_cats": false,
    "has_dogs": true,
    "has_other_pets": false,
    "desired_max_rent_in_cents": 250000,
    "monthly_income_in_cents": 600000,
    "middle_initial": "A",
    "phone_1": "+14155552671",
    "lead_source": "Zillow",
    "status": "ACTIVE",
    "desired_move_in_date": "2024-09-01",
    "desired_bathrooms": "2",
    "desired_bedrooms": 3
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.propexo.com/v1/leads/appfolio/"

payload = {
    "integration_id": "intg_9f8b7c6d5e4a3b2c1d0e",
    "property_id": "prop_1234567890abcdef",
    "first_name": "Emily",
    "last_name": "Johnson"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.propexo.com/v1/leads/appfolio/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"integration_id":"intg_9f8b7c6d5e4a3b2c1d0e","property_id":"prop_1234567890abcdef","first_name":"Emily","last_name":"Johnson"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.propexo.com/v1/leads/appfolio/"

	payload := strings.NewReader("{\n  \"integration_id\": \"intg_9f8b7c6d5e4a3b2c1d0e\",\n  \"property_id\": \"prop_1234567890abcdef\",\n  \"first_name\": \"Emily\",\n  \"last_name\": \"Johnson\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.propexo.com/v1/leads/appfolio/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"integration_id\": \"intg_9f8b7c6d5e4a3b2c1d0e\",\n  \"property_id\": \"prop_1234567890abcdef\",\n  \"first_name\": \"Emily\",\n  \"last_name\": \"Johnson\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.propexo.com/v1/leads/appfolio/")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"integration_id\": \"intg_9f8b7c6d5e4a3b2c1d0e\",\n  \"property_id\": \"prop_1234567890abcdef\",\n  \"first_name\": \"Emily\",\n  \"last_name\": \"Johnson\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.propexo.com/v1/leads/appfolio/', [
  'body' => '{
  "integration_id": "intg_9f8b7c6d5e4a3b2c1d0e",
  "property_id": "prop_1234567890abcdef",
  "first_name": "Emily",
  "last_name": "Johnson"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.propexo.com/v1/leads/appfolio/");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"integration_id\": \"intg_9f8b7c6d5e4a3b2c1d0e\",\n  \"property_id\": \"prop_1234567890abcdef\",\n  \"first_name\": \"Emily\",\n  \"last_name\": \"Johnson\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "integration_id": "intg_9f8b7c6d5e4a3b2c1d0e",
  "property_id": "prop_1234567890abcdef",
  "first_name": "Emily",
  "last_name": "Johnson"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.propexo.com/v1/leads/appfolio/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```