Welcome to the GenPage External API documentation. This guide will help you integrate with our platform and access our powerful features programmatically.
Visit https://app.genpage.ai and create your account.
All API requests should be made to:
Need a test account? If you're a developer requiring a test account, please contact us at team@genpage.ai and we'll be happy to help you get started.
Include your Bearer API token in the Authorization
header of all requests, like this:
This documentation aims to provide all the information you need to work with our API.
This documentation provides comprehensive information for working with our API, including:
Ready to get started? Explore the endpoints below to begin integrating with GenPage!
Have the user get the Bearer API token from the GenPage website.
Call /campaigns/get-list and /audiences/get-list. Let the user select which campaign and audience they want to add the leads to.
Call the Upsert (update or insert) endpoint. You will get a JobId in return. Send the user selected
In the response from /leads/get-leads
you will get a "genpage_url", this is the URL to the custom GenPage's that have been generated.
To authenticate requests, include a Authorization
header with the value "Bearer <Token>"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
This endpoint is used to get the list of audiences.
curl --request GET \
--get "http://127.0.0.1:8000/api/external/v1/audiences/get-list" \
--header "Authorization: Bearer <Token>" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_id\": 16
}"
{
"audiences": [
{
"id": 1,
"name": "Default Audience"
}
]
}
This endpoint returns the generated token to be used in the external integration.
curl --request POST \
"http://127.0.0.1:8000/api/external/v1/generate-api-token" \
--header "Authorization: Bearer <Token>" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"b\",
\"workspace_id\": 16
}"
{
"token": "Bearer <Bearer token>"
}
This endpoint is used to test the authentication.
curl --request GET \
--get "http://127.0.0.1:8000/api/external/v1/hello-world" \
--header "Authorization: Bearer <Token>" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
{
"message": "Hello World"
}
This endpoint is used to get the list of campaigns.
curl --request GET \
--get "http://127.0.0.1:8000/api/external/v1/campaigns/get-list" \
--header "Authorization: Bearer <Token>" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_id\": 16
}"
{
"campaigns": [
{
"id": 1,
"name": "Test Campaign 1",
"slug": "test-campaign-1"
},
{
"id": 2,
"name": "Saas Outreach",
"slug": "saas-outreach"
}
]
}
curl --request GET \
--get "http://127.0.0.1:8000/api/external/v1/get-api-tokens" \
--header "Authorization: Bearer <Token>" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_id\": 16
}"
curl --request DELETE \
"http://127.0.0.1:8000/api/external/v1/delete-api-token" \
--header "Authorization: Bearer <Token>" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"token_id\": \"architecto\"
}"
This endpoint is used to upsert (update or insert) leads.
The leads are sent in the request body. The leads are an array of objects. The leads.*.values are key/value pairs with the values of the lead.
To create a new lead, at least one of:
email
linkedin_profile_url
To update an existing lead, at least one of:
lead_id
(GenPage Lead ID)genpage_url
(GenPage URL)first_name
company_name
company_domain
The response is the job ID.
The job ID can be used to get the status of the job, and get all the leads that were upserted by this request.
curl --request POST \
"http://127.0.0.1:8000/api/external/v1/leads/upsert-leads" \
--header "Authorization: Bearer <Token>" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"from\": \"MyCompanyName\",
\"campaign_id\": 1,
\"audience_id\": 1,
\"leads\": [
{
\"values\": {
\"last_name\": \"Doe\",
\"company_domain\": \"amazon.com\",
\"my_custom_variable\": \"My custom value\"
}
}
]
}"
{
"job_id": "1234567890"
}
This endpoint is used to get the status of the job. Once the job is completed, the status will be "completed".
The status can be:
Once the job is completed, please use the getLeads endpoint to get all the leads that were upserted by this request.
curl --request GET \
--get "http://127.0.0.1:8000/api/external/v1/leads/get-status" \
--header "Authorization: Bearer <Token>" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"job_id\": \"architecto\"
}"
{
"status": "pending",
"processed_rows": 10,
"total_rows": 100
}
This endpoint is used to get the leads that were upserted by a job.
curl --request GET \
--get "http://127.0.0.1:8000/api/external/v1/leads/get-leads" \
--header "Authorization: Bearer <Token>" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"workspace_id\": 16,
\"job_id\": \"architecto\"
}"
{
"leads": [
{
"lead_id": 56789,
"workspace_id": 222,
"campaign_id": 333,
"job_id": "1234567890",
"values": {
"name": "John Doe",
"email": "john@aws.com",
"company_name": "AWS",
"url_slug": "aws-john",
"logo": "https://aws.com/logo.png",
"logo_color": "#000000",
"genpage_url": "https://myworkspace.genpa.ge/aws-john"
}
}
]
}