For the complete documentation index, see llms.txt. This page is also available as Markdown.

Complete campaign

Completes the campaign: ends its active, paused, suspended and incompatible tests (significant ones become completed, the rest cancelled), unschedules its scheduled tests, and locks it. Ended tests cannot be restarted.

When the campaign has live or scheduled tests, completing takes two calls:

  1. Call with no body. Nothing changes; the response is 409 with a confirmationToken and the affected activeTestIds and scheduledTestIds.

  2. Call again with { "confirmationToken": "..." }. The response is 200 with the ids of the tests that were ended or unscheduled.

If a test was launched or scheduled in the campaign after the token was issued, step 2 returns a new 409 with a fresh token instead of ending a test you were not shown — repeat step 2 with the new token. A campaign with no live or scheduled tests completes on the first call, and an already-completed campaign returns 200 with empty lists.

post
Authorizations
AuthorizationstringRequired

All requests require Authorization: Bearer sl_live_<your_api_key>. Generate a key from the Shoplift admin's API Keys settings page.

Path parameters
idstring · uuidRequired
Body
confirmationTokenstring · nullableOptional
Responses
200

Campaign completed. Lists the public ids of the tests this call completed, cancelled or unscheduled; empty when it was already completed.

application/json
completedTestIdsstring · uuid[]Required
cancelledTestIdsstring · uuid[]Required
unscheduledTestIdsstring · uuid[]Required
post/api/public/v1/campaigns/{id}/complete
POST /api/public/v1/campaigns/{id}/complete HTTP/1.1
Host: app.shoplift.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 26

{
  "confirmationToken": null
}
{
  "campaign": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "text",
    "objective": null,
    "goal": null,
    "status": "active",
    "createdAt": "2026-01-01T00:00:00.000Z",
    "progress": {
      "total": 1,
      "live": 1,
      "paused": 1,
      "draft": 1,
      "ended": 1
    }
  },
  "completedTestIds": [
    "123e4567-e89b-12d3-a456-426614174000"
  ],
  "cancelledTestIds": [
    "123e4567-e89b-12d3-a456-426614174000"
  ],
  "unscheduledTestIds": [
    "123e4567-e89b-12d3-a456-426614174000"
  ]
}

Last updated

Was this helpful?