curl --request POST \
--url https://api.leadping.ai/sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allowedStates": [
"<string>"
],
"allowedProducts": [
"<string>"
],
"defaultTagIds": [
"<string>"
],
"defaultTagNames": [
"<string>"
]
}
'import requests
url = "https://api.leadping.ai/sources"
payload = {
"allowedStates": ["<string>"],
"allowedProducts": ["<string>"],
"defaultTagIds": ["<string>"],
"defaultTagNames": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.leadping.ai/sources");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"allowedStates\": [\n \"<string>\"\n ],\n \"allowedProducts\": [\n \"<string>\"\n ],\n \"defaultTagIds\": [\n \"<string>\"\n ],\n \"defaultTagNames\": [\n \"<string>\"\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://api.leadping.ai/sources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allowedStates\": [\n \"<string>\"\n ],\n \"allowedProducts\": [\n \"<string>\"\n ],\n \"defaultTagIds\": [\n \"<string>\"\n ],\n \"defaultTagNames\": [\n \"<string>\"\n ]\n}")
.asString();const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
allowedStates: ['<string>'],
allowedProducts: ['<string>'],
defaultTagIds: ['<string>'],
defaultTagNames: ['<string>']
})
};
fetch('https://api.leadping.ai/sources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.leadping.ai/sources"
payload := strings.NewReader("{\n \"allowedStates\": [\n \"<string>\"\n ],\n \"allowedProducts\": [\n \"<string>\"\n ],\n \"defaultTagIds\": [\n \"<string>\"\n ],\n \"defaultTagNames\": [\n \"<string>\"\n ]\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(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leadping.ai/sources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'allowedStates' => [
'<string>'
],
'allowedProducts' => [
'<string>'
],
'defaultTagIds' => [
'<string>'
],
'defaultTagNames' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"source": {
"description": "<string>",
"enabled": true,
"apiKeyPreview": "<string>",
"apiKeyRotatedAt": "2023-11-07T05:31:56Z",
"firstLeadReceivedAt": "2023-11-07T05:31:56Z",
"lastLeadReceivedAt": "2023-11-07T05:31:56Z",
"user": {
"id": "<string>",
"name": "<string>"
},
"createdByUser": {
"id": "<string>",
"name": "<string>"
},
"createdByUserEmail": "jsmith@example.com",
"modifiedByUser": {
"id": "<string>",
"name": "<string>"
},
"organization": {
"id": "<string>",
"name": "<string>"
},
"costPerLead": 123,
"allowedStates": [
"<string>"
],
"allowedProducts": [
"<string>"
],
"requiresTrustedForm": true,
"complianceApproved": true,
"defaultTagIds": [
"<string>"
],
"defaultTags": [
{
"id": "<string>",
"name": "<string>",
"normalizedName": "<string>",
"color": "<string>"
}
],
"name": "<string>",
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"modifiedAt": "2023-11-07T05:31:56Z"
},
"secret": "<string>"
}{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "The request could not be completed."
}{
"type": "about:blank",
"title": "Unauthorized",
"status": 401,
"detail": "The request could not be completed."
}{
"type": "about:blank",
"title": "Forbidden",
"status": 403,
"detail": "The request could not be completed."
}{
"type": "about:blank",
"title": "Too Many Requests",
"status": 429,
"detail": "The request could not be completed."
}Create an organization lead intake source
Creates a lead source for the current organization, storing intake credentials and routing context for captured external leads.
curl --request POST \
--url https://api.leadping.ai/sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allowedStates": [
"<string>"
],
"allowedProducts": [
"<string>"
],
"defaultTagIds": [
"<string>"
],
"defaultTagNames": [
"<string>"
]
}
'import requests
url = "https://api.leadping.ai/sources"
payload = {
"allowedStates": ["<string>"],
"allowedProducts": ["<string>"],
"defaultTagIds": ["<string>"],
"defaultTagNames": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.leadping.ai/sources");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"allowedStates\": [\n \"<string>\"\n ],\n \"allowedProducts\": [\n \"<string>\"\n ],\n \"defaultTagIds\": [\n \"<string>\"\n ],\n \"defaultTagNames\": [\n \"<string>\"\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://api.leadping.ai/sources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allowedStates\": [\n \"<string>\"\n ],\n \"allowedProducts\": [\n \"<string>\"\n ],\n \"defaultTagIds\": [\n \"<string>\"\n ],\n \"defaultTagNames\": [\n \"<string>\"\n ]\n}")
.asString();const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
allowedStates: ['<string>'],
allowedProducts: ['<string>'],
defaultTagIds: ['<string>'],
defaultTagNames: ['<string>']
})
};
fetch('https://api.leadping.ai/sources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.leadping.ai/sources"
payload := strings.NewReader("{\n \"allowedStates\": [\n \"<string>\"\n ],\n \"allowedProducts\": [\n \"<string>\"\n ],\n \"defaultTagIds\": [\n \"<string>\"\n ],\n \"defaultTagNames\": [\n \"<string>\"\n ]\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(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leadping.ai/sources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'allowedStates' => [
'<string>'
],
'allowedProducts' => [
'<string>'
],
'defaultTagIds' => [
'<string>'
],
'defaultTagNames' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"source": {
"description": "<string>",
"enabled": true,
"apiKeyPreview": "<string>",
"apiKeyRotatedAt": "2023-11-07T05:31:56Z",
"firstLeadReceivedAt": "2023-11-07T05:31:56Z",
"lastLeadReceivedAt": "2023-11-07T05:31:56Z",
"user": {
"id": "<string>",
"name": "<string>"
},
"createdByUser": {
"id": "<string>",
"name": "<string>"
},
"createdByUserEmail": "jsmith@example.com",
"modifiedByUser": {
"id": "<string>",
"name": "<string>"
},
"organization": {
"id": "<string>",
"name": "<string>"
},
"costPerLead": 123,
"allowedStates": [
"<string>"
],
"allowedProducts": [
"<string>"
],
"requiresTrustedForm": true,
"complianceApproved": true,
"defaultTagIds": [
"<string>"
],
"defaultTags": [
{
"id": "<string>",
"name": "<string>",
"normalizedName": "<string>",
"color": "<string>"
}
],
"name": "<string>",
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"modifiedAt": "2023-11-07T05:31:56Z"
},
"secret": "<string>"
}{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "The request could not be completed."
}{
"type": "about:blank",
"title": "Unauthorized",
"status": 401,
"detail": "The request could not be completed."
}{
"type": "about:blank",
"title": "Forbidden",
"status": 403,
"detail": "The request could not be completed."
}{
"type": "about:blank",
"title": "Too Many Requests",
"status": 429,
"detail": "The request could not be completed."
}Authorizations
Authorization header using the Bearer scheme. Accepted values are Leadping user JWT access tokens and WorkOS organization API keys beginning with sk_.
Body
The source data to create.
Defines the fields clients can send when working with lead source.
State or region allowlist used to accept leads from this source.
Product allowlist used to accept or route leads from this source.
Tag IDs automatically assigned to leads created by this source.
Tag names automatically assigned to leads created by this source.
Human-readable source name.
Human-readable description that explains this lead source request to API users.
Indicates whether leads from this source must include a TrustedForm certificate for consent proof.

