API reference
The REST API behind the Conversionloop dashboard. Everything you can set up in the dashboard, you can automate here.
Requests and responses are JSON. Authenticate with an API token as a bearer token. Each endpoint lists the scope the token needs.
Base URL https://api.conversionloop.net · openapi.yaml · openapi.json
Projects
A project is one website: one script tag, one public key, one set of campaigns. Data fields, audiences and campaigns all belong to a project.
List projects
GET /v1/projects
Scope projects:read
All projects of the workspace that are not archived, oldest first.
Responses
- 200 The projects.
Fields
-
dataarray of object requiredFields
-
idstringID, starting with
prj_. -
workspaceIdstring -
namestring -
publicKeystringKey in the script tag, starting with
prj_live_. Not a secret. -
domainsarray of stringHostnames the script runs on. Empty means any host.
-
consentModestringOne ofnot_required,required,cookieless_fallback. -
consentSignalstring | null -
sampleRatenumber -
maxConcurrentinteger -
debugboolean -
inlineConfigbooleanWhether campaigns are delivered inside the script.
-
revisionstringChanges with every change that affects the script.
-
archivedAtstring | null -
createdAtstring (date-time) -
updatedAtstring (date-time) -
_countobjectNumber of campaigns, audiences and data fields in the project.
Fields
-
campaignsinteger -
audiencesinteger -
dataFieldsinteger
-
-
-
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
curl https://api.conversionloop.net/v1/projects \
-H "Authorization: Bearer $CL_TOKEN"
Create a project
POST /v1/projects
Scope projects:write
Creates a project with a new public key. Campaigns are delivered inside the script unless you set inlineConfig to false.
Request body ProjectInput
-
namestring required1–120 characters. -
domainsarray of stringHostnames the script may run on, like
example.comor*.example.com. A domain also covers its subdomains. On any other host the script stays silent and responses are rejected. Empty means no restriction: set this before going live.Default[]. At most 50 items. -
consentModestringrequired: the script does nothing until consent is given.cookieless_fallback: it runs without storing anything on the visitor's device until consent is given.One ofnot_required,required,cookieless_fallback. Default"not_required". -
consentSignalstringName of a window event that signals consent, or of a global variable or function that returns true once consent is given.
At most 120 characters. -
sampleRatenumberShare of impressions that are recorded. Responses are always recorded. Lower it on very high traffic.
Default1. 0–1. -
maxConcurrentintegerHow many campaigns may be visible at the same time.
Default1. 1–3. -
debugbooleanLog what the script does to the browser console.
Defaultfalse. -
inlineConfigbooleanDeliver campaigns inside the script instead of loading them with a second request. See Install the script.
Defaulttrue.
Responses
- 201 The new project.Returns Project.
- 400 The request is malformed or fails validation.
detailslists the issues with the path of each field. - 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
curl -X POST https://api.conversionloop.net/v1/projects \
-H "Authorization: Bearer $CL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Online shop",
"domains": [
"shop.example.com"
],
"consentMode": "required",
"consentSignal": "cmpConsentGiven"
}'
Get a project
GET /v1/projects/{projectId}
Scope projects:read
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key).
Responses
- 200 The project.Returns Project.
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd \
-H "Authorization: Bearer $CL_TOKEN"
{
"id": "prj_4k9x2m7q1v8b3n6c5z0wd",
"workspaceId": "wsp_8h2k4m6p9r1t3v5x7z0bc",
"name": "Online shop",
"publicKey": "prj_live_0wk048ap7g5r9ba007fs98gj",
"domains": [
"shop.example.com"
],
"consentMode": "required",
"consentSignal": "cmpConsentGiven",
"sampleRate": 1,
"maxConcurrent": 1,
"debug": false,
"inlineConfig": true,
"revision": "7q2m9x4k1v8b",
"archivedAt": null,
"createdAt": "2026-12-03T09:12:44.120Z",
"updatedAt": "2026-12-03T09:30:02.871Z"
}
Update a project
PATCH /v1/projects/{projectId}
Scope projects:write
Changes only the fields you send. Changes reach visitors within about five minutes.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key).
Request body ProjectPatch
Any fields of ProjectInput. Fields you leave out stay unchanged.
-
namestring1–120 characters. -
domainsarray of stringHostnames the script may run on, like
example.comor*.example.com. A domain also covers its subdomains. On any other host the script stays silent and responses are rejected. Empty means no restriction: set this before going live.Default[]. At most 50 items. -
consentModestringrequired: the script does nothing until consent is given.cookieless_fallback: it runs without storing anything on the visitor's device until consent is given.One ofnot_required,required,cookieless_fallback. Default"not_required". -
consentSignalstringName of a window event that signals consent, or of a global variable or function that returns true once consent is given.
At most 120 characters. -
sampleRatenumberShare of impressions that are recorded. Responses are always recorded. Lower it on very high traffic.
Default1. 0–1. -
maxConcurrentintegerHow many campaigns may be visible at the same time.
Default1. 1–3. -
debugbooleanLog what the script does to the browser console.
Defaultfalse. -
inlineConfigbooleanDeliver campaigns inside the script instead of loading them with a second request. See Install the script.
Defaulttrue.
Responses
- 200 The updated project.Returns Project.
- 400 The request is malformed or fails validation.
detailslists the issues with the path of each field. - 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl -X PATCH https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd \
-H "Authorization: Bearer $CL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"domains": [
"shop.example.com",
"*.example.com"
]
}'
Archive a project
DELETE /v1/projects/{projectId}
Scope projects:write
Archives the project. The script stops serving campaigns for it, and it no longer appears in the project list. Collected responses are kept.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key).
Responses
- 204 Archived.
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl -X DELETE https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd \
-H "Authorization: Bearer $CL_TOKEN"
Rotate the public key
POST /v1/projects/{projectId}/rotate-key
Scope projects:write
Issues a new public key. Pages that still use the old script tag stop showing campaigns until you update the tag. Use this if someone embeds your key on sites you do not control.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key).
Responses
- 200 The project with its new
publicKey.Returns Project. - 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl -X POST https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/rotate-key \
-H "Authorization: Bearer $CL_TOKEN"
Get the script tag
GET /v1/projects/{projectId}/snippet
Scope projects:read
The script tag to paste into the <head> of your pages, matching the project's delivery setting.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key).
Responses
- 200 The script tag.
Fields
-
snippetstring requiredThe complete
<script>tag. -
publicKeystring required -
inlineConfigboolean requiredWhether campaigns are delivered inside the script.
-
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/snippet \
-H "Authorization: Bearer $CL_TOKEN"
{
"snippet": "<script async src=\"https://cdn.conversionloop.net/v1/p/prj_live_0wk048ap7g5r9ba007fs98gj.js\"></script>",
"publicKey": "prj_live_0wk048ap7g5r9ba007fs98gj",
"inlineConfig": true
}
Get the script size
GET /v1/projects/{projectId}/bundle-size
Scope projects:read
Transfer size of both delivery options with the campaigns that are live right now, so you can decide whether to deliver campaigns inside the script. Sizes are in bytes.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key).
Responses
- 200 Sizes in bytes, uncompressed and gzip.
Fields
-
campaignsintegerNumber of live and scheduled campaigns measured.
-
engineSize | nullThe script alone, as loaded when campaigns come from the API.
nullif the script is unavailable. -
configSizeThe campaign configuration the script loads separately in that case.
-
inlineSize | nullThe script with campaigns inside.
nullif the script is unavailable.
-
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/bundle-size \
-H "Authorization: Bearer $CL_TOKEN"
{
"campaigns": 2,
"engine": {
"raw": 31210,
"gzip": 11843
},
"config": {
"raw": 2914,
"gzip": 902
},
"inline": {
"raw": 34171,
"gzip": 12611
}
}
Data fields
Typed values your site passes to the script with conversionloop.set().
Audiences can target them, and campaigns can store them with every
response.
List data fields
GET /v1/projects/{projectId}/data-fields
Scope datafields:read
All data fields of the project, sorted by key.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key).
Responses
- 200 The data fields.
Fields
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/data-fields \
-H "Authorization: Bearer $CL_TOKEN"
Create a data field
POST /v1/projects/{projectId}/data-fields
Scope datafields:write
The key must be unique within the project and cannot be changed later.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key).
Request body DataFieldInput
A typed value your site passes to the script.
-
keystring requiredName used in
conversionloop.set()and in audience rules. Lowercase letters, digits and underscores, starting with a letter. Cannot be changed later.1–64 characters. Pattern^[a-z][a-z0-9_]*$. -
labelstring requiredName shown in the dashboard.
1–120 characters. -
typestring requiredType of the value. Values that do not match are ignored in comparisons.
One ofstring,number,boolean,date,enum. -
optionsarray of stringAllowed values when
typeisenum.At most 50 items. -
sourcestringclient: set in the browser withconversionloop.set().server: reserved for values supplied by your backend.One ofclient,server. Default"client". -
collectbooleanMarks the field for storage with responses. Note: the script currently sends every data field you set along with impressions and answers, see What is sent.
Defaulttrue. -
descriptionstringNote for your team.
At most 500 characters.
Responses
- 201 The new data field.Returns DataField.
- 400 The request is malformed or fails validation.
detailslists the issues with the path of each field. - 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
- 409 A resource with the same key or slug already exists in the project.
curl -X POST https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/data-fields \
-H "Authorization: Bearer $CL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"key": "cart_value",
"label": "Cart value",
"type": "number",
"description": "Gross cart value in EUR."
}'
Update a data field
PATCH /v1/projects/{projectId}/data-fields/{dataFieldId}
Scope datafields:write
Changes only the fields you send. The key cannot be changed, because campaigns and stored responses refer to it.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key). -
dataFieldIdstring requiredID of the data field, starting with
dfl_.
Request body DataFieldPatch
Any fields of DataFieldInput except key. Fields you leave out stay unchanged.
-
labelstringName shown in the dashboard.
1–120 characters. -
typestringType of the value. Values that do not match are ignored in comparisons.
One ofstring,number,boolean,date,enum. -
optionsarray of stringAllowed values when
typeisenum.At most 50 items. -
sourcestringclient: set in the browser withconversionloop.set().server: reserved for values supplied by your backend.One ofclient,server. Default"client". -
collectbooleanMarks the field for storage with responses. Note: the script currently sends every data field you set along with impressions and answers, see What is sent.
Defaulttrue. -
descriptionstringNote for your team.
At most 500 characters.
Responses
- 200 The updated data field.Returns DataField.
- 400 The request is malformed or fails validation.
detailslists the issues with the path of each field. - 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl -X PATCH https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/data-fields/dfl_6p3k8x2m4q9v1b7n5c0wd \
-H "Authorization: Bearer $CL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"label": "Cart value (gross)"
}'
Delete a data field
DELETE /v1/projects/{projectId}/data-fields/{dataFieldId}
Scope datafields:write
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key). -
dataFieldIdstring requiredID of the data field, starting with
dfl_.
Responses
- 204 Deleted.
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl -X DELETE https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/data-fields/dfl_6p3k8x2m4q9v1b7n5c0wd \
-H "Authorization: Bearer $CL_TOKEN"
Audiences
Reusable visitor segments. The script evaluates them in the browser, so no visitor data has to leave the page before a campaign shows.
List audiences
GET /v1/projects/{projectId}/audiences
Scope audiences:read
All audiences of the project, newest first.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key).
Responses
- 200 The audiences.
Fields
-
dataarray of object requiredFields
-
idstringID, starting with
aud_. -
projectIdstring -
workspaceIdstring -
namestring -
descriptionstring | null -
rulesAudienceRules -
createdAtstring (date-time) -
updatedAtstring (date-time) -
_countobjectFields
-
campaignsintegerNumber of campaigns using this audience.
-
-
-
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/audiences \
-H "Authorization: Bearer $CL_TOKEN"
Create an audience
POST /v1/projects/{projectId}/audiences
Scope audiences:write
Rules are checked before saving: unknown operators, missing values and references to audiences that do not exist (or that would form a loop) are rejected. See Audience rules for all conditions.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key).
Request body AudienceInput
-
namestring required1–200 characters. -
descriptionstringAt most 1000 characters.
Responses
- 201 The new audience.Returns Audience.
- 400 The request is malformed or fails validation.
detailslists the issues with the path of each field. - 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
- 422 The request is valid but cannot be applied, for example because it refers to something that does not exist.
curl -X POST https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/audiences \
-H "Authorization: Bearer $CL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Leaving the checkout",
"rules": {
"groups": [
{
"id": "g1",
"match": "all",
"conditions": [
{
"id": "c1",
"type": "url",
"operator": "contains",
"value": "/checkout"
},
{
"id": "c2",
"type": "exit_intent",
"operator": "is_true"
}
]
}
]
}
}'
Get an audience
GET /v1/projects/{projectId}/audiences/{audienceId}
Scope audiences:read
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key). -
audienceIdstring requiredID of the audience, starting with
aud_.
Responses
- 200 The audience.Returns Audience.
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/audiences/aud_2m8k4x9q1v7b3n6c5z0wd \
-H "Authorization: Bearer $CL_TOKEN"
Update an audience
PATCH /v1/projects/{projectId}/audiences/{audienceId}
Scope audiences:write
Changes only the fields you send. rules is replaced as a whole. Live campaigns using the audience pick up the change within about five minutes.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key). -
audienceIdstring requiredID of the audience, starting with
aud_.
Request body AudiencePatch
Any fields of AudienceInput. Fields you leave out stay unchanged.
-
namestring1–200 characters. -
descriptionstringAt most 1000 characters. -
rulesAudienceRules
Responses
- 200 The updated audience.Returns Audience.
- 400 The request is malformed or fails validation.
detailslists the issues with the path of each field. - 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
- 422 The request is valid but cannot be applied, for example because it refers to something that does not exist.
curl -X PATCH https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/audiences/aud_2m8k4x9q1v7b3n6c5z0wd \
-H "Authorization: Bearer $CL_TOKEN"
Delete an audience
DELETE /v1/projects/{projectId}/audiences/{audienceId}
Scope audiences:write
Only possible while no campaign uses the audience; otherwise the response is 422.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key). -
audienceIdstring requiredID of the audience, starting with
aud_.
Responses
- 204 Deleted.
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
- 422 The request is valid but cannot be applied, for example because it refers to something that does not exist.
curl -X DELETE https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/audiences/aud_2m8k4x9q1v7b3n6c5z0wd \
-H "Authorization: Bearer $CL_TOKEN"
Campaigns
A question (or call to action) shown to an audience at a chosen moment.
New campaigns start as drafts; set the status to live to publish.
List campaigns
GET /v1/projects/{projectId}/campaigns
Scope campaigns:read
Campaigns of the project, most recently changed first. Archived campaigns are left out unless you ask for them with status=archived.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key).
Query parameters
-
statusCampaignStatusOnly campaigns with this status.
Responses
- 200 The campaigns.
Fields
-
dataarray of object requiredFields
-
idstringID, starting with
cmp_. -
projectIdstring -
workspaceIdstring -
audienceIdstring | null -
slugstring -
namestring -
goalstring | null -
statusCampaignStatus -
contentCampaignContent -
appearanceAppearance -
deliveryDelivery -
dataFieldKeysarray of string -
startsAtstring | null -
endsAtstring | null -
createdAtstring (date-time) -
updatedAtstring (date-time) -
audienceobject | nullName of the assigned audience, if any.
Fields
-
idstring -
namestring
-
-
-
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/campaigns \
-H "Authorization: Bearer $CL_TOKEN"
Create a campaign
POST /v1/projects/{projectId}/campaigns
Scope campaigns:write
Creates a draft. Drafts may be incomplete; the checks for going live
happen when you change the status.
appearance and delivery can be empty objects to use the defaults.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key).
Request body CampaignInput
-
namestring requiredName shown in the dashboard.
1–200 characters. -
slugstring requiredUnique within the project. Used by
conversionloop.trigger()and thecampaign_stateaudience condition.1–80 characters. Pattern^[a-z0-9][a-z0-9-]*$. -
goalstringWhat you want to learn. For your team.
At most 1000 characters. -
audienceIdstring | nullThe audience to show the campaign to. Required to go live.
-
dataFieldKeysarray of stringData fields this campaign relies on, by key. Unknown keys are rejected with
422.Default[]. At most 50 items. -
startsAtstring | nullStart for
scheduledcampaigns. -
endsAtstring | nullThe campaign stops showing after this time.
Responses
- 201 The new campaign, with status
draft.Returns Campaign. - 400 The request is malformed or fails validation.
detailslists the issues with the path of each field. - 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
- 409 A resource with the same key or slug already exists in the project.
- 422 The request is valid but cannot be applied, for example because it refers to something that does not exist.
curl -X POST https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/campaigns \
-H "Authorization: Bearer $CL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Why are you leaving the checkout?",
"slug": "checkout-exit",
"audienceId": "aud_2m8k4x9q1v7b3n6c5z0wd",
"dataFieldKeys": [
"cart_value"
],
"content": {
"kind": "single_choice",
"question": "What is stopping you from ordering today?",
"options": [
{
"id": "price",
"label": "The price"
},
{
"id": "shipping",
"label": "Shipping costs or time"
},
{
"id": "unsure",
"label": "Not sure the product fits"
},
{
"id": "other",
"label": "Something else",
"followUp": "What is it?"
}
]
},
"appearance": {
"position": "bottom_right"
},
"delivery": {
"delayMs": 500
}
}'
Get a campaign
GET /v1/projects/{projectId}/campaigns/{campaignId}
Scope campaigns:read
The campaign including its full audience.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key). -
campaignIdstring requiredID of the campaign, starting with
cmp_.
Responses
- 200 The campaign.
Fields
-
idstringID, starting with
cmp_. -
projectIdstring -
workspaceIdstring -
audienceIdstring | null -
slugstring -
namestring -
goalstring | null -
statusCampaignStatus -
contentCampaignContent -
appearanceAppearance -
deliveryDelivery -
dataFieldKeysarray of string -
startsAtstring | null -
endsAtstring | null -
createdAtstring (date-time) -
updatedAtstring (date-time) -
audienceAudience | null
-
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/campaigns/cmp_9x2k4m7q1v8b3n6c5z0wd \
-H "Authorization: Bearer $CL_TOKEN"
Update a campaign
PATCH /v1/projects/{projectId}/campaigns/{campaignId}
Scope campaigns:write
Changes only the fields you send. content, appearance and
delivery are each replaced as a whole. Changes to a live campaign
reach visitors within about five minutes.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key). -
campaignIdstring requiredID of the campaign, starting with
cmp_.
Request body CampaignPatch
Any fields of CampaignInput. Fields you leave out stay unchanged.
-
namestringName shown in the dashboard.
1–200 characters. -
slugstringUnique within the project. Used by
conversionloop.trigger()and thecampaign_stateaudience condition.1–80 characters. Pattern^[a-z0-9][a-z0-9-]*$. -
goalstringWhat you want to learn. For your team.
At most 1000 characters. -
audienceIdstring | nullThe audience to show the campaign to. Required to go live.
-
dataFieldKeysarray of stringData fields this campaign relies on, by key. Unknown keys are rejected with
422.Default[]. At most 50 items. -
contentCampaignContent -
appearanceAppearance -
deliveryDelivery -
startsAtstring | nullStart for
scheduledcampaigns. -
endsAtstring | nullThe campaign stops showing after this time.
Responses
- 200 The updated campaign.Returns Campaign.
- 400 The request is malformed or fails validation.
detailslists the issues with the path of each field. - 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
- 422 The request is valid but cannot be applied, for example because it refers to something that does not exist.
curl -X PATCH https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/campaigns/cmp_9x2k4m7q1v8b3n6c5z0wd \
-H "Authorization: Bearer $CL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"delivery": {
"delayMs": 2000,
"trafficShare": 0.5
}
}'
Archive a campaign
DELETE /v1/projects/{projectId}/campaigns/{campaignId}
Scope campaigns:write
Takes the campaign offline and sets its status to archived. Its responses stay available in Insights.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key). -
campaignIdstring requiredID of the campaign, starting with
cmp_.
Responses
- 204 Archived.
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl -X DELETE https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/campaigns/cmp_9x2k4m7q1v8b3n6c5z0wd \
-H "Authorization: Bearer $CL_TOKEN"
Change the status
POST /v1/projects/{projectId}/campaigns/{campaignId}/status
Scope campaigns:write
Publishes, pauses or archives a campaign. Going live or scheduled
requires an audience and complete content and appearance; scheduled
also requires startsAt. If anything is missing, the response is
422 and details lists what to fix.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key). -
campaignIdstring requiredID of the campaign, starting with
cmp_.
Request body
Responses
- 200 The campaign with its new status.Returns Campaign.
- 400 The request is malformed or fails validation.
detailslists the issues with the path of each field. - 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
- 422 The campaign cannot go live yet.
curl -X POST https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/campaigns/cmp_9x2k4m7q1v8b3n6c5z0wd/status \
-H "Authorization: Bearer $CL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"status": "live"
}'
Insights
Results per project and per campaign, and the raw responses as CSV.
Results of all campaigns
GET /v1/projects/{projectId}/insights
Scope insights:read
Impressions, responses, dismissals and conversions per campaign in a time range (default the last 30 days).
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key).
Query parameters
-
fromstring (date-time)Start of the range, ISO 8601. Default 30 days before
to. -
tostring (date-time)End of the range, ISO 8601. Default now.
-
campaignIdstringOnly count events of this campaign.
Responses
- 200 One entry per campaign of the project, including campaigns without events.
Fields
-
rangeRange -
dataarray of objectFields
-
campaignobjectFields
-
idstring -
namestring -
slugstring -
statusCampaignStatus
-
-
impressionsinteger -
responsesinteger -
dismissalsinteger -
conversionsinteger -
responseRatenumber | nullResponses per impression, 0 to 1, rounded to four decimals.
nullwithout impressions.
-
-
- 400 The request is malformed or fails validation.
detailslists the issues with the path of each field. - 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/insights \
-H "Authorization: Bearer $CL_TOKEN"
{
"range": {
"from": "2026-11-03T10:00:00.000Z",
"to": "2026-12-03T10:00:00.000Z"
},
"data": [
{
"campaign": {
"id": "cmp_9x2k4m7q1v8b3n6c5z0wd",
"name": "Why are you leaving the checkout?",
"slug": "checkout-exit",
"status": "live"
},
"impressions": 1840,
"responses": 212,
"dismissals": 1011,
"conversions": 0,
"responseRate": 0.1152
}
]
}
Results of one campaign
GET /v1/projects/{projectId}/campaigns/{campaignId}/insights
Scope insights:read
Answer distribution, ratings, free-text answers, a breakdown by device and a daily timeline. Covers up to 5,000 responses in the range; for all responses use the CSV export.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key). -
campaignIdstring requiredID of the campaign, starting with
cmp_.
Query parameters
-
fromstring (date-time)Start of the range, ISO 8601. Default 30 days before
to. -
tostring (date-time)End of the range, ISO 8601. Default now.
Responses
- 200 The results.
Fields
-
rangeRange -
responsesintegerNumber of responses evaluated (at most 5
-
optionsarray of objectHow often each answer option was chosen, most chosen first. With multiple choice every chosen option counts.
Fields
-
optionIdstring -
countinteger
-
-
ratingobjectFields
-
averagenumber | nullAverage rating
-
distributionmapNumber of responses per rating value.
-
-
textsarray of objectThe 200 most recent free-text answers.
Fields
-
textstring -
atstring (date-time)
-
-
byDevicearray of objectFields
-
deviceTypestringOne ofphone,tablet,desktop,unknown. -
typeEventType -
countinteger
-
-
timelinearray of objectEvents per day and type.
Fields
-
daystring (date) -
typeEventType -
countinteger
-
-
- 400 The request is malformed or fails validation.
detailslists the issues with the path of each field. - 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/campaigns/cmp_9x2k4m7q1v8b3n6c5z0wd/insights \
-H "Authorization: Bearer $CL_TOKEN"
{
"range": {
"from": "2026-11-03T10:00:00.000Z",
"to": "2026-12-03T10:00:00.000Z"
},
"responses": 212,
"options": [
{
"optionId": "shipping",
"count": 97
},
{
"optionId": "price",
"count": 64
},
{
"optionId": "unsure",
"count": 38
},
{
"optionId": "other",
"count": 13
}
],
"rating": {
"average": null,
"distribution": {}
},
"texts": [
{
"text": "I could not find the delivery date.",
"at": "2026-12-02T16:41:09.000Z"
}
],
"byDevice": [
{
"deviceType": "phone",
"type": "response",
"count": 131
},
{
"deviceType": "desktop",
"type": "response",
"count": 81
}
],
"timeline": [
{
"day": "2026-12-02",
"type": "impression",
"count": 64
},
{
"day": "2026-12-02",
"type": "response",
"count": 8
}
]
}
Export responses as CSV
GET /v1/projects/{projectId}/campaigns/{campaignId}/responses.csv
Scope insights:read
All responses of the campaign, oldest first, up to 50,000 rows. Columns:
occurred_at, session_id, options (option IDs separated by |),
rating, text, device, browser, os, url, dwell_ms,
scroll_depth, data_fields (JSON).
Cells that start with =, +, - or @ are prefixed with an
apostrophe, so spreadsheet programs do not run them as formulas.
Path parameters
-
projectIdstring requiredID of the project, starting with
prj_(not the public key). -
campaignIdstring requiredID of the campaign, starting with
cmp_.
Responses
- 200 The CSV file.
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl https://api.conversionloop.net/v1/projects/prj_4k9x2m7q1v8b3n6c5z0wd/campaigns/cmp_9x2k4m7q1v8b3n6c5z0wd/responses.csv \
-H "Authorization: Bearer $CL_TOKEN" \
-o responses.csv
occurred_at,session_id,options,rating,text,device,browser,os,url,dwell_ms,scroll_depth,data_fields
2026-12-02T16:41:09.000Z,s_7f3k9x2m4q,shipping,,I could not find the delivery date.,phone,safari,ios,https://shop.example.com/checkout,48210,62,"{""cart_value"":149.9}"
Account
Session usage and subscription of the workspace the token belongs to.
Session usage this month
GET /v1/usage
Scope insights:read
Sessions counted in the current calendar month (UTC) against the quota of the plan. Campaigns keep running above the quota.
Responses
- 200 The usage.
Fields
-
sessionsintegerSessions this month.
-
quotaintegerSessions included in the plan per month.
-
rationumbersessions / quota; above 1 when the quota is exceeded.
-
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
curl https://api.conversionloop.net/v1/usage \
-H "Authorization: Bearer $CL_TOKEN"
{
"sessions": 18412,
"quota": 100000,
"ratio": 0.18412
}
Get the subscription
GET /v1/billing/subscription
Scope billing:read
Plan, status and current billing period of the workspace. Upgrades and cancellations happen in the dashboard.
Responses
- 200 The subscription and its plan.
Fields
-
subscriptionobjectFields
-
planIdstringOne offree,growth,scale. -
billingstringOne ofmonthly,yearly. -
statusstringOne oftrialing,active,past_due,canceled,paused. -
sessionQuotainteger -
trialEndsAtstring | null -
currentPeriodStartstring (date-time) -
currentPeriodEndstring (date-time) -
cancelAtstring | nullSet after a cancellation; the plan runs until then.
-
-
planobject | nullFields
-
idstring -
namestring -
monthlynumberPrice per month in EUR
-
yearlynumberPrice per year in EUR
-
sessionQuotainteger
-
-
- 401 The token is missing, unknown, expired or revoked.
- 403 The token lacks the required scope.
- 404 The resource does not exist in the token's workspace.
curl https://api.conversionloop.net/v1/billing/subscription \
-H "Authorization: Bearer $CL_TOKEN"
Schemas
Appearance
How the campaign looks. Every field has a default, so {} is valid.
-
positionstringWhere the campaign appears.
inlineplaces it inside an element on your page.One ofbottom_right,bottom_left,bottom_bar,top_bar,center_modal,inline. Default"bottom_right". -
anchorSelectorstringCSS selector of the element to place the campaign in, for
inline.At most 200 characters. -
themestringautofollows the visitor's light or dark mode.One oflight,dark,auto. Default"auto". -
accentColorstringColor of buttons and highlights
Default"#0069a9". Pattern^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$. -
textColorstringText color
Pattern^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$. -
backgroundColorstringBackground color
Pattern^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$. -
cornerRadiusintegerCorner radius in pixels.
Default14. 0–32. -
fontFamilystringCSS font-family. Default is the font of your page.
At most 200 characters. -
backdropbooleanDim the page behind the campaign. Meant for
center_modal.Defaultfalse. -
animationstringHow the campaign appears. Visitors who prefer reduced motion get no animation.
One ofslide,fade,none. Default"slide". -
showCloseButtonbooleanShow a close button. Closing counts as a dismissal.
Defaulttrue. -
showBrandingbooleanShow a small Conversionloop note.
Defaulttrue. -
customCssstringExtra CSS. It applies only inside the campaign (Shadow DOM)
At most 4000 characters.
Audience
-
idstringID, starting with
aud_. -
projectIdstring -
workspaceIdstring -
namestring -
descriptionstring | null -
rulesAudienceRules -
createdAtstring (date-time) -
updatedAtstring (date-time)
AudienceInput
-
namestring required1–200 characters. -
descriptionstringAt most 1000 characters.
AudiencePatch
Any fields of AudienceInput. Fields you leave out stay unchanged.
-
namestring1–200 characters. -
descriptionstringAt most 1000 characters. -
rulesAudienceRules
AudienceRules
Groups of conditions. Conditions inside a group are combined with the
group's match (all = AND, any = OR); groups are always combined
with AND. All condition types, operators and values are listed under
Audience rules.
-
groupsarray of object requiredOne to ten groups; a visitor must match every group.
1–10 items.Fields
-
idstring requiredAny ID
At least 1 characters. -
matchstringall: every condition must match.any: one is enough.One ofall,any. Default"all". -
conditionsarray of object required1–30 items.Fields
-
idstring requiredAny ID
At least 1 characters. -
typestring requiredWhat to check. See Audience rules.
One ofdwell_time,scroll_depth,exit_intent,page_views,visit_count,element_seen,click,inactivity,url,referrer,utm,landing_page,schedule,device_type,browser,os,viewport,language,connection,prefers_reduced_motion,cookie,storage,data_field,campaign_state,audience. -
operatorstring requiredHow to compare. Which operators are allowed depends on
type.One ofeq,neq,gt,gte,lt,lte,between,contains,not_contains,starts_with,ends_with,regex,in,not_in,exists,not_exists,is_true,is_false. -
fieldstringName of the cookie, data field, UTM parameter, CSS selector or campaign slug, for types that need one.
At most 200 characters. -
valuestring | number | boolean | array of string | number | objectValue to compare with. Not needed for
exists,not_exists,is_trueandis_false.betweentakes two values as an array. -
includebooleanfalseturns the condition around: visitors who match it are excluded.Defaulttrue.
-
-
Campaign
-
idstringID, starting with
cmp_. -
projectIdstring -
workspaceIdstring -
audienceIdstring | null -
slugstring -
namestring -
goalstring | null -
statusCampaignStatus -
contentCampaignContent -
appearanceAppearance -
deliveryDelivery -
dataFieldKeysarray of string -
startsAtstring | null -
endsAtstring | null -
createdAtstring (date-time) -
updatedAtstring (date-time)
CampaignContent
What the campaign asks. kind selects one of five formats.
kind: "single_choice"One answer from a list, optionally with a free-text field.
-
kind"single_choice"required -
questionstring required1–300 characters. -
descriptionstringAt most 600 characters. -
optionsarray of object requiredTwo to ten answers.
2–10 items.Fields
-
idstring requiredAt least 1 characters. -
labelstring required1–200 characters. -
followUpstringAt most 200 characters. -
valuestringAt most 200 characters.
-
-
allowFreeTextbooleanAdd a free-text field below the options.
Defaultfalse. -
thanksstringShown after the answer.
Default"Thank you!". At most 300 characters.
kind: "multi_choice"Several answers from a list.
-
kind"multi_choice"required -
questionstring required1–300 characters. -
descriptionstringAt most 600 characters. -
optionsarray of object requiredTwo to twelve answers.
2–12 items.Fields
-
idstring requiredAt least 1 characters. -
labelstring required1–200 characters. -
followUpstringAt most 200 characters. -
valuestringAt most 200 characters.
-
-
maxSelectionsintegerUpper limit of answers a visitor can pick.
1–12. -
thanksstringShown after the answer.
Default"Thank you!". At most 300 characters.
kind: "free_text"An open question.
-
kind"free_text"required -
questionstring required1–300 characters. -
descriptionstringAt most 600 characters. -
placeholderstringAt most 160 characters. -
maxLengthintegerMaximum characters of the answer.
Default500. 50–2000. -
thanksstringShown after the answer.
Default"Thank you!". At most 300 characters.
kind: "rating"A scale, NPS or emoji rating, optionally with a follow-up question.
-
kind"rating"required -
questionstring required1–300 characters. -
descriptionstringAt most 600 characters. -
scalestring1-5,1-10,nps(0–10) oremoji(five faces).One of1-5,1-10,nps,emoji. Default"1-5". -
lowLabelstringLabel at the low end of the scale.
At most 60 characters. -
highLabelstringLabel at the high end of the scale.
At most 60 characters. -
followUpQuestionstringFree-text question shown after the rating.
At most 300 characters. -
thanksstringShown after the answer.
Default"Thank you!". At most 300 characters.
kind: "cta"A message with a button instead of a question.
-
kind"cta"required -
headlinestring required1–200 characters. -
descriptionstringAt most 600 characters. -
buttonLabelstring required1–80 characters. -
buttonHrefstring (uri) requiredWhere the button leads.
-
countAsConversionbooleanCount a click on the button as a conversion of the campaign.
Defaulttrue.
CampaignInput
-
namestring requiredName shown in the dashboard.
1–200 characters. -
slugstring requiredUnique within the project. Used by
conversionloop.trigger()and thecampaign_stateaudience condition.1–80 characters. Pattern^[a-z0-9][a-z0-9-]*$. -
goalstringWhat you want to learn. For your team.
At most 1000 characters. -
audienceIdstring | nullThe audience to show the campaign to. Required to go live.
-
dataFieldKeysarray of stringData fields this campaign relies on, by key. Unknown keys are rejected with
422.Default[]. At most 50 items. -
startsAtstring | nullStart for
scheduledcampaigns. -
endsAtstring | nullThe campaign stops showing after this time.
CampaignPatch
Any fields of CampaignInput. Fields you leave out stay unchanged.
-
namestringName shown in the dashboard.
1–200 characters. -
slugstringUnique within the project. Used by
conversionloop.trigger()and thecampaign_stateaudience condition.1–80 characters. Pattern^[a-z0-9][a-z0-9-]*$. -
goalstringWhat you want to learn. For your team.
At most 1000 characters. -
audienceIdstring | nullThe audience to show the campaign to. Required to go live.
-
dataFieldKeysarray of stringData fields this campaign relies on, by key. Unknown keys are rejected with
422.Default[]. At most 50 items. -
contentCampaignContent -
appearanceAppearance -
deliveryDelivery -
startsAtstring | nullStart for
scheduledcampaigns. -
endsAtstring | nullThe campaign stops showing after this time.
CampaignStatus
draft: not shown. scheduled: shown between startsAt and endsAt.
live: shown now (and until endsAt, if set). paused: not shown,
can be resumed. archived: not shown, hidden from lists.
One of draft, scheduled, live, paused, archived.
DataField
-
idstringID, starting with
dfl_. -
projectIdstring -
workspaceIdstring -
keystring -
labelstring -
typestringOne ofstring,number,boolean,date,enum. -
optionsarray of string | null -
sourcestringOne ofclient,server. -
collectboolean -
descriptionstring | null -
createdAtstring (date-time) -
updatedAtstring (date-time)
DataFieldInput
A typed value your site passes to the script.
-
keystring requiredName used in
conversionloop.set()and in audience rules. Lowercase letters, digits and underscores, starting with a letter. Cannot be changed later.1–64 characters. Pattern^[a-z][a-z0-9_]*$. -
labelstring requiredName shown in the dashboard.
1–120 characters. -
typestring requiredType of the value. Values that do not match are ignored in comparisons.
One ofstring,number,boolean,date,enum. -
optionsarray of stringAllowed values when
typeisenum.At most 50 items. -
sourcestringclient: set in the browser withconversionloop.set().server: reserved for values supplied by your backend.One ofclient,server. Default"client". -
collectbooleanMarks the field for storage with responses. Note: the script currently sends every data field you set along with impressions and answers, see What is sent.
Defaulttrue. -
descriptionstringNote for your team.
At most 500 characters.
DataFieldPatch
Any fields of DataFieldInput except key. Fields you leave out stay unchanged.
-
labelstringName shown in the dashboard.
1–120 characters. -
typestringType of the value. Values that do not match are ignored in comparisons.
One ofstring,number,boolean,date,enum. -
optionsarray of stringAllowed values when
typeisenum.At most 50 items. -
sourcestringclient: set in the browser withconversionloop.set().server: reserved for values supplied by your backend.One ofclient,server. Default"client". -
collectbooleanMarks the field for storage with responses. Note: the script currently sends every data field you set along with impressions and answers, see What is sent.
Defaulttrue. -
descriptionstringNote for your team.
At most 500 characters.
Delivery
When and how often the campaign shows. Every field has a default, so {} is valid.
-
delayMsintegerWait this long (milliseconds) after the audience matches before showing.
Default0. 0–600000. -
priorityintegerWhen several campaigns match at once
Default50. 0–100. -
frequencyobjectLimits per visitor, stored on the visitor's device.
Fields
-
maxImpressionsintegerHow often one visitor sees the campaign at most within
windowDays.Default1. 1–100. -
windowDaysintegerTime window for
maxImpressionsin days.0means forever.Default30. 0–365. -
hideAfterResponsebooleanNever show again after the visitor answered.
Defaulttrue. -
reshowAfterDismissDaysintegerShow again this many days after the visitor closed it.
0means never.Default0. 0–365.
-
-
trafficSharenumberShare of matching visitors who see the campaign, 0 to 1. Use it to test on part of your traffic.
Default1. 0–1.
Error
-
errorobject requiredFields
-
codestring requiredStable machine-readable code. See Errors.
One ofbad_request,unauthorized,forbidden,not_found,conflict,unprocessable,rate_limited,internal_error. -
messagestring requiredHuman-readable explanation. Wording may change.
-
detailsanyAdditional information
-
EventType
One of impression, response, dismiss, conversion.
Project
-
idstringID, starting with
prj_. -
workspaceIdstring -
namestring -
publicKeystringKey in the script tag, starting with
prj_live_. Not a secret. -
domainsarray of stringHostnames the script runs on. Empty means any host.
-
consentModestringOne ofnot_required,required,cookieless_fallback. -
consentSignalstring | null -
sampleRatenumber -
maxConcurrentinteger -
debugboolean -
inlineConfigbooleanWhether campaigns are delivered inside the script.
-
revisionstringChanges with every change that affects the script.
-
archivedAtstring | null -
createdAtstring (date-time) -
updatedAtstring (date-time)
ProjectInput
-
namestring required1–120 characters. -
domainsarray of stringHostnames the script may run on, like
example.comor*.example.com. A domain also covers its subdomains. On any other host the script stays silent and responses are rejected. Empty means no restriction: set this before going live.Default[]. At most 50 items. -
consentModestringrequired: the script does nothing until consent is given.cookieless_fallback: it runs without storing anything on the visitor's device until consent is given.One ofnot_required,required,cookieless_fallback. Default"not_required". -
consentSignalstringName of a window event that signals consent, or of a global variable or function that returns true once consent is given.
At most 120 characters. -
sampleRatenumberShare of impressions that are recorded. Responses are always recorded. Lower it on very high traffic.
Default1. 0–1. -
maxConcurrentintegerHow many campaigns may be visible at the same time.
Default1. 1–3. -
debugbooleanLog what the script does to the browser console.
Defaultfalse. -
inlineConfigbooleanDeliver campaigns inside the script instead of loading them with a second request. See Install the script.
Defaulttrue.
ProjectPatch
Any fields of ProjectInput. Fields you leave out stay unchanged.
-
namestring1–120 characters. -
domainsarray of stringHostnames the script may run on, like
example.comor*.example.com. A domain also covers its subdomains. On any other host the script stays silent and responses are rejected. Empty means no restriction: set this before going live.Default[]. At most 50 items. -
consentModestringrequired: the script does nothing until consent is given.cookieless_fallback: it runs without storing anything on the visitor's device until consent is given.One ofnot_required,required,cookieless_fallback. Default"not_required". -
consentSignalstringName of a window event that signals consent, or of a global variable or function that returns true once consent is given.
At most 120 characters. -
sampleRatenumberShare of impressions that are recorded. Responses are always recorded. Lower it on very high traffic.
Default1. 0–1. -
maxConcurrentintegerHow many campaigns may be visible at the same time.
Default1. 1–3. -
debugbooleanLog what the script does to the browser console.
Defaultfalse. -
inlineConfigbooleanDeliver campaigns inside the script instead of loading them with a second request. See Install the script.
Defaulttrue.
Range
The time range the numbers cover.
-
fromstring (date-time) -
tostring (date-time)
Size
-
rawintegerBytes uncompressed.
-
gzipintegerBytes with gzip