GenPage External API Documentation

Postman collection → OpenAPI spec →

Introduction

Welcome to the GenPage External API documentation. This guide will help you integrate with our platform and access our powerful features programmatically.

Getting Started

1. Create an Account

Visit https://app.genpage.ai and create your account.

2. Generate an API Token

  1. Navigate to SettingsIntegrations
  2. Create a new API token
  3. Store this token securely - you'll need it for all API requests

3. Base URL

All API requests should be made to:

Developer Support

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.

Authentication info

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.

Documentation Features

This documentation provides comprehensive information for working with our API, including:

  • Code Examples: Interactive code samples in multiple programming languages
  • Request/Response Examples: Real-world examples for each endpoint
  • Error Handling: Common error codes and troubleshooting guides

Ready to get started? Explore the endpoints below to begin integrating with GenPage!

Flow

  1. Have the user get the Bearer API token from the GenPage website.

  2. Call /campaigns/get-list and /audiences/get-list. Let the user select which campaign and audience they want to add the leads to.

  3. Call the Upsert (update or insert) endpoint. You will get a JobId in return. Send the user selected

  • CampaignID
  • AudienceID
  • list of leads the user wants to upsert (update or insert)
  1. Check the status of the job by calling the /leads/get-status endpoint with the JobId you got from /leads/upsert
  2. Get the latest value of the leads by calling /leads/get-leads

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.

Authenticating requests

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.

Audiences

Get the list of audiences.

GET
http://127.0.0.1:8000
/api/external/v1/audiences/get-list
requires authentication

This endpoint is used to get the list of audiences.

Headers

Authorization
Example:
Bearer <Token>
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/external/v1/audiences/get-list" \
    --header "Authorization: Bearer &lt;Token&gt;" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_id\": 16
}"
Example response:
{
    "audiences": [
        {
            "id": 1,
            "name": "Default Audience"
        }
    ]
}
{
    "message": "Unauthenticated."
}

Authentication

Generate an API token. Should be done from the GenPage dashboard.

POST
http://127.0.0.1:8000
/api/external/v1/generate-api-token
requires authentication

This endpoint returns the generated token to be used in the external integration.

Headers

Authorization
Example:
Bearer <Token>
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/external/v1/generate-api-token" \
    --header "Authorization: Bearer &lt;Token&gt;" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"b\",
    \"workspace_id\": 16
}"
Example response:
{
    "token": "Bearer <Bearer token>"
}
{
    "message": "Unauthenticated."
}

Test authentication endpoint.

GET
http://127.0.0.1:8000
/api/external/v1/hello-world
requires authentication

This endpoint is used to test the authentication.

Headers

Authorization
Example:
Bearer <Token>
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/external/v1/hello-world" \
    --header "Authorization: Bearer &lt;Token&gt;" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
{
    "message": "Hello World"
}
{
    "message": "Unauthenticated."
}

Campaigns

Get the list of campaigns.

GET
http://127.0.0.1:8000
/api/external/v1/campaigns/get-list
requires authentication

This endpoint is used to get the list of campaigns.

Headers

Authorization
Example:
Bearer <Token>
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/external/v1/campaigns/get-list" \
    --header "Authorization: Bearer &lt;Token&gt;" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_id\": 16
}"
Example response:
{
    "campaigns": [
        {
            "id": 1,
            "name": "Test Campaign 1",
            "slug": "test-campaign-1"
        },
        {
            "id": 2,
            "name": "Saas Outreach",
            "slug": "saas-outreach"
        }
    ]
}
{
    "message": "Unauthenticated."
}

Endpoints

GET api/external/v1/get-api-tokens

GET
http://127.0.0.1:8000
/api/external/v1/get-api-tokens
requires authentication

Headers

Authorization
Example:
Bearer <Token>
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/external/v1/get-api-tokens" \
    --header "Authorization: Bearer &lt;Token&gt;" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_id\": 16
}"
Example response:

DELETE api/external/v1/delete-api-token

DELETE
http://127.0.0.1:8000
/api/external/v1/delete-api-token
requires authentication

Headers

Authorization
Example:
Bearer <Token>
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request DELETE \
    "http://127.0.0.1:8000/api/external/v1/delete-api-token" \
    --header "Authorization: Bearer &lt;Token&gt;" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"token_id\": \"architecto\"
}"

Leads

Upsert leads.

POST
http://127.0.0.1:8000
/api/external/v1/leads/upsert-leads
requires authentication

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.


Required fields for creating or updating a 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)

Optional but strongly recommended fields

  • 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.

Headers

Authorization
Example:
Bearer <Token>
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "http://127.0.0.1:8000/api/external/v1/leads/upsert-leads" \
    --header "Authorization: Bearer &lt;Token&gt;" \
    --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\"
            }
        }
    ]
}"
Example response:
{
    "job_id": "1234567890"
}
{
    "message": "Unauthenticated."
}

Get the status of the job.

GET
http://127.0.0.1:8000
/api/external/v1/leads/get-status
requires authentication

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:

  • pending
  • completed
  • failed

Once the job is completed, please use the getLeads endpoint to get all the leads that were upserted by this request.

Headers

Authorization
Example:
Bearer <Token>
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/external/v1/leads/get-status" \
    --header "Authorization: Bearer &lt;Token&gt;" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"job_id\": \"architecto\"
}"
Example response:
{
    "status": "pending",
    "processed_rows": 10,
    "total_rows": 100
}
{
    "message": "Unauthenticated."
}

Get the leads that were upserted by a job.

GET
http://127.0.0.1:8000
/api/external/v1/leads/get-leads
requires authentication

This endpoint is used to get the leads that were upserted by a job.

Headers

Authorization
Example:
Bearer <Token>
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request GET \
    --get "http://127.0.0.1:8000/api/external/v1/leads/get-leads" \
    --header "Authorization: Bearer &lt;Token&gt;" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"workspace_id\": 16,
    \"job_id\": \"architecto\"
}"
Example response:
{
    "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"
            }
        }
    ]
}
{
    "message": "Unauthenticated."
}