company logo

Help center

Go to Agentcis
Follow us on FacebookFollow us on Linkedin
All collectionsAPI DocumentationLead Form API Documentation

Lead Form API Documentation

The Lead Form API allows you to retrieve your lead form schema and submit enquiry forms programmatically into Agentcis. Using a bearer token for authentication, you can access the form fields, validate required inputs, and send structured payloads (including custom fields and test scores) directly via API. This helps automate lead capture from websites, apps, or third-party platforms into your Agentcis

Step 1: Obtain Bearer Token

  1. Go to yourdomain.agentcisapp.com.

  2. Navigate to Settings > API & Integrations.

  3. Access the API tab and create a new token.

  4. Copy the generated token; this will serve as your bearer token.

To Retrieve the Slug of Your Lead Form 

  1. Open your lead form.

  2. Copy the text following "/online-form/" from the URL; this is the slug of your lead form.

Example:

For the URL https://demo.agentcisapp.com/online-form/social-media-form, the slug is social-media-form.

To Access Lead Form Schema

URL: https://{yourdomain}.agentcisapp.com/api/v2/online-form/{slug}/docs

 

  • Replace {yourdomain} with your Agentcis subdomain.

  • Replace {slug} with the slug obtained from the previous step.

 

Example Response:

HTTP Method: GET

Status: 200

Headers:

{
    "accept": "application/json",
    "content-type": "application/json",
    "authorization": "Bearer {your bearer token from step 1}"
}

Response Body: 

[
  {
    "id": 469,
    "name": "first_name",
    "is_required": true,
    "slug": "first_name",
    "type": "string"
  },
  {
    "id": 470,
    "name": "last_name",
    "is_required": true,
    "slug": "last_name",
    "type": "string"
  },
  {
    "id": 471,
    "name": "date_of_birth",
    "is_required": true,
    "slug": "date_of_birth",
    "type": "date"
  },
  {
    "id": 472,
    "name": "phone",
    "is_required": false,
    "slug": "phone",
    "type": "string"
  },
  {
    "id": 473,
    "name": "email",
    "is_required": false,
    "slug": "email",
    "type": "string"
  },
  {
    "id": 474,
    "name": "secondary_email",
    "is_required": false,
    "slug": "secondary_email",
    "type": null
  },
  {
    "id": 475,
    "name": "contact_preference",
    "is_required": false,
    "slug": "contact_preference",
    "type": "string"
  },
  {
    "id": 476,
    "name": "street",
    "is_required": false,
    "slug": "street",
    "type": "string"
  },
  {
    "id": 477,
    "name": "city",
    "is_required": false,
    "slug": "city",
    "type": "string"
  },
  {
    "id": 478,
    "name": "state",
    "is_required": false,
    "slug": "state",
    "type": "string"
  },
  {
    "id": 479,
    "name": "postal_code",
    "is_required": false,
    "slug": "postal_code",
    "type": "string"
  },
  {
    "id": 480,
    "name": "country",
    "is_required": false,
    "slug": "country",
    "type": "string"
  },
  {
    "id": 483,
    "name": "country_of_passport",
    "is_required": false,
    "slug": "country_of_passport",
    "type": "string"
  },
  {
    "id": 1,
    "name": "TOEFL",
    "is_required": false,
    "slug": "TOEFL",
    "meta": null,
    "bands": [
      {
        "id": 1,
        "name": "Listening",
        "is_required": false
      },
      {
        "id": 2,
        "name": "Reading",
        "is_required": false
      },
      {
        "id": 3,
        "name": "Writing",
        "is_required": false
      },
      {
        "id": 4,
        "name": "Speaking",
        "is_required": false
      }
    ]
  },
  {
    "id": 2,
    "name": "IELTS",
    "is_required": false,
    "slug": "IELTS",
    "meta": null,
    "bands": [
      {
        "id": 5,
        "name": "Listening",
        "is_required": false
      },
      {
        "id": 6,
        "name": "Reading",
        "is_required": false
      },
      {
        "id": 7,
        "name": "Writing",
        "is_required": false
      },
      {
        "id": 8,
        "name": "Speaking",
        "is_required": false
      }
    ]
  },
  {
    "id": 3,
    "name": "PTE",
    "is_required": false,
    "slug": "PTE",
    "meta": null,
    "bands": [
      {
        "id": 9,
        "name": "Listening",
        "is_required": false
      },
      {
        "id": 10,
        "name": "Reading",
        "is_required": false
      },
      {
        "id": 11,
        "name": "Writing",
        "is_required": false
      },
      {
        "id": 12,
        "name": "Speaking",
        "is_required": false
      }
    ]
  },
  {
    "id": 4,
    "name": "SAT I",
    "is_required": false,
    "slug": "SAT I",
    "meta": null,
    "bands": []
  },
  {
    "id": 5,
    "name": "SAT II",
    "is_required": false,
    "slug": "SAT II",
    "meta": null,
    "bands": []
  },
  {
    "id": 6,
    "name": "GRE",
    "is_required": false,
    "slug": "GRE",
    "meta": null,
    "bands": []
  },
  {
    "id": 7,
    "name": "GMAT",
    "is_required": false,
    "slug": "GMAT",
    "meta": null,
    "bands": []
  },
  {
    "id": 497,
    "name": "dropdown-custom-field",
    "type": "dropdown",
    "slug": "e2d24773-e171-4e8f-ba0f-f34efb1ef038",
    "is_required": false,
    "meta": null,
    "is_custom_field": true,
    "items": [
      "aaa",
      "aa"
    ]
  },
  {
    "id": 498,
    "name": "text-type-custom-field",
    "type": "text",
    "slug": "7ca31d9e-adc6-46f7-987c-a4b231623888",
    "is_required": false,
    "meta": null,
    "is_custom_field": true,
    "items": []
  }
]

 

To Submit a Lead Form

HTTP Method: POST

URL: https://{yourdomain}.agentcisapp.com/api/v2/online-form/{slug}/

Headers:

{
    "accept": "application/json",
    "content-type": "application/json",
    "authorization": "Bearer {your bearer token from step 1}"
}

Payload:

payload format

{

"slug" : "value"

}

 

Example Payload 1 with test score


{
	"first_name": "chandan",
	"last_name": "sharma",
	"e2d24773-e171-4e8f-ba0f-f34efb1ef038": [
		"aaa",
		"aa"
	],
	"date_of_birth": "2020-09-11",
	"phone": {
		"number": "9843617001",
		"country_code": "NP"
	},
	"country": "nepal",
	"country_of_passport": "nepal",
    "comments": "Some comments"
}

 

Response:

Status: 200

Response Body:

{
    "message": "Successfully submitted enquiry form",
    "data": {
        "id": 1,
        "name": "lead name lead last name"
    }
}

 

Please replace placeholders like {yourdomain}, {slug}, and other relevant values with your actual information.

 

Example Payload 2 with test score

{
	"first_name": "chandan",
	"last_name": "office",
	"email": "[email protected]",
	"form_id": 3,
	"test_scores": [
		{
			"test_id": 2, // test id
			"score": 1 //overall test score
		},
		{
			"test_id": 3, // test id
			"score": 2, // overall test score
			"bands": [ // score by bands. These fields are only available on enabling "Enable all individual fields" in form setting
				{
					"id": 9,
					"score": 2
				},
				{
					"id": 10,
					"score": 2
				},
				{
					"id": 11,
					"score": 3
				},
				{
					"id": 12,
					"score": 3
				}
			]
		},
		{
			"test_id": 4,
			"score": 3
		},
		{
			"test_id": 5,
			"score": 3
		},
		{
			"test_id": 6,
			"score": 3
		},
		{
			"test_id": 7,
			"score": 3
		}
	]
}

Fetch Country List

Retrieve a comprehensive list of countries with currency information, supporting search functionality for dynamic dropdowns and form selections.

Base URL: https://{tenant-domain}/api/countries


                    

List Countries

  • Endpoint:/

  • Method: GET

  • Description:Lists countries and it’s description like currency code and many more


Response:

[

  {

    "id": 1,

    "country_name": "Australia",

    "currency_code": "AUD",

    "currency_name": "Australian Dollar",

    "country_dialing_code": "61",

    "value": "Australia - AUD [Australian Dollar]"

  },

  {

    "id": 2,

    "country_name": "United States",

    "currency_code": "USD",

    "currency_name": "US Dollar", 

    "country_dialing_code": "1",

    "value": "United States - USD [US Dollar]"

  },

  {

    "id": 3,

    "country_name": "United Kingdom",

    "currency_code": "GBP",

    "currency_name": "British Pound Sterling",

    "country_dialing_code": "44",

    "value": "United Kingdom - GBP [British Pound Sterling]"

  }

….

]

Formatted List of countries Countries 

  • Endpoint:/list?keyword={character}

  • Method: GET

  • Description:Lists countries also supports wildcards for searching specific country

  • country_name is a parameter which accepts country name and fetch specific country

  • Endpoint:/list?keyword=Austr

Response:

[

    {

        "id": 11,

        "country_name": "Australia",

        "currency_name": "Australian dollar",

        "currency_code": "AUD",

        "country_code": "AU",

        "country_dialing_code": "61",

        "country_code_iso_alpha3": "AUS",

        "value": "Australia"

    },

    {

        "id": 12,

        "country_name": "Austria",

        "currency_name": "euro",

        "currency_code": "EUR",

        "country_code": "AT",

        "country_dialing_code": "43",

        "country_code_iso_alpha3": "AUT",

        "value": "Austria"

    }

]

Did this answer your question?
😞
😐
😁