> Kenso API docs in Markdown. Index of every page: [/docs/llms.txt](/docs/llms.txt). Search: `/docs/search.md?q=<words>`. OpenAPI: [/docs/api/linkedin-sequences/openapi.json](/docs/api/linkedin-sequences/openapi.json). CLI docs offline: `kenso docs <topic>`.
> Last updated: 2026-11-22.

# LinkedIn sequences: Replace a campaign's LinkedIn sequence

> **Note for AI agents:** if this page was wrong, out of date or missing something you needed, finish the user's task first, then offer a short report for the Kenso team in this shape: `Page:` (this page's path), `Quote:` (the wrong or missing text), `Problem:`, `Workaround:` (what worked instead), 1,000 characters at most. Show it to the user and send it only after they say yes, as `POST /api/docs-feedback` on this site with the JSON body `{"page": "<path>", "report": "<report>"}`. Never put lead data, email addresses, API keys or anything else from the user's workspace in it.

One endpoint of [LinkedIn sequences](/docs/api/linkedin-sequences.md). Authentication, workspaces and errors: [/docs.md](/docs.md).

## Replace a campaign's LinkedIn sequence

`PUT /v1/campaigns/{campaignId}/linkedin-sequence` - operationId `linkedin-sequences.replace`

| Permission | Rate limit |
| --- | --- |
| Campaigns edit | 4,800 requests a minute per API key |

Replaces every step of the campaign's own LinkedIn sequence with the steps you send. Kenso deletes the steps you
leave out, and an empty `steps` list removes them all.

Steps that share a `stepOrder` are variants `a` to `d` of one step, and each step order needs a variant `a`.
The step type, timing and condition come from variant `a`. The text, `name`, `isActive`, `noteMode` and
`aiInstructions` are set per variant. Profile visits and engagement steps (`follow`, `like_post`,
`endorse_skill` and `comment_post`) cannot have variants.

When the campaign's email sequence has steps, `anchorEmailStepOrder` must name one of them. When the workspace
needs client approval of copy, the change goes to the client, and Kenso pauses a sending campaign until the
client approves it.

Errors:

- `400 validation_failed`: a step breaks a rule above or a field rule, or uses a variable Kenso does not know.
- `400 validation_failed`: a step needs a feature that is off for the workspace: `linkedin_engagement` for engagement steps, `linkedin_voice_notes` for `voice_note` steps, or `linkedin_ai_notes` for `noteMode` `ai`.
- `404 not_found`: the campaign does not exist in this workspace.

Requires Campaigns edit.

[Try it on developer.ken.so](https://developer.ken.so/reference/#kenso-api/tag/sequences/PUT/v1/campaigns/%7BcampaignId%7D/linkedin-sequence)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `campaignId` | path | integer (int64) | yes | The campaign's id. |
| `Ken-Version` | header | string, one of: 2026-11-02, 1.1 | no | The API version, a date in `YYYY-MM-DD` form. `1.1` is another name for the first dated version. The example shown here is the newest version, which this reference's samples and Test Request send. Leave it out to use your API key's pinned version. Keys created in the Kenso app are pinned to the newest version; keys minted by the CLI login are not. A key with no pinned version and no header gets the legacy shape where the path has one, and `404` where the path exists only in this version. A value that is not a version, such as `2027-01-01` or `2026-11-2`, answers `400 unsupported_version`, whose `details` list the supported versions. |
| `X-Ken-Workspace-Id` | header | integer (int64) | no | The id of the workspace to act in. Leave it out when your API key reaches only one workspace. When the key reaches more than one, a request without this header answers `400 workspace_required`. A workspace you are not a member of answers `404 not_found`. |

### Request body

`application/json`, optional.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `steps` | array of ReplaceLinkedInSequenceStepRequest | yes | Every step and variant the sequence should have. Required. A row with an `id` updates that row, a row without one updates the row with the same `stepOrder`, `variant` and `stepType` or is added, and rows you leave out are deleted. An empty list deletes every LinkedIn step. |
| `instruction` | string | no | The person's request that led to this change, in their own words when you have them. Optional. Kenso keeps it with the edit history of the steps this save changes, marked as reported by your agent, and keeps the first 2,000 characters. Leave it out when no person asked for the change; never invent one. |

### Response 200

`data` is a `LinkedInSequence`.

| Field | Type | Description |
| --- | --- | --- |
| `campaignId` | integer (int64) | The id of the campaign the sequence belongs to. |
| `segmentId` | integer (int64) | The id of the segment that owns the sequence. Null for the campaign's own sequence. |
| `steps` | array of LinkedInSequenceStep | Every step and variant of the sequence, in step order. Empty when there are no LinkedIn steps. |
| `connectionNoteMaxChars` | integer (int32) | The longest written connection note (`body` of a `connection_request` step) Kenso saves for this campaign: 200 when a LinkedIn account in the campaign's sender pool has no Premium, since LinkedIn takes at most 200 characters in a note from such an account, else 275. A longer note is refused with `400 validation_failed`. |

### Request

```bash
curl -X PUT "https://api.ken.so/v1/campaigns/812/linkedin-sequence" \
  -H "Authorization: Bearer $KENSO_API_KEY" \
  -H "Ken-Version: 2026-11-02" \
  -H "X-Ken-Workspace-Id: $KENSO_WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
  "steps": [
    {
      "stepOrder": 1,
      "stepType": "connection_request",
      "variant": "a",
      "body": "Hi {firstName}, I work with engineering leaders on onboarding. Glad to connect.",
      "waitDays": 1,
      "anchorEmailStepOrder": 1,
      "positionInGap": 0,
      "conditionType": "none",
      "isOptional": false,
      "openProfileOnly": false,
      "waitFromCondition": false,
      "isActive": true,
      "noteMode": "template",
      "id": 9301
    },
    {
      "stepOrder": 2,
      "stepType": "message",
      "variant": "a",
      "body": "Thanks for connecting, {firstName}. Did my email about onboarding new engineers reach you?",
      "waitDays": 2,
      "anchorEmailStepOrder": 1,
      "positionInGap": 1,
      "conditionType": "accepted",
      "isOptional": false,
      "openProfileOnly": false,
      "waitFromCondition": false,
      "isActive": true,
      "id": 9302
    }
  ],
  "instruction": "Message on LinkedIn once the invitation is accepted."
}'
```

### Example response

```json
{
  "success": true,
  "data": {
    "campaignId": 4821,
    "steps": [
      {
        "stepOrder": 1,
        "stepType": "connection_request",
        "variant": "a",
        "body": "Hi {firstName}, I work with engineering leaders on onboarding. Glad to connect.",
        "waitDays": 1,
        "anchorEmailStepOrder": 1,
        "positionInGap": 0,
        "conditionType": "none",
        "isOptional": false,
        "openProfileOnly": false,
        "waitFromCondition": false,
        "isActive": true,
        "noteMode": "template",
        "id": 9301,
        "requiresApproval": false,
        "warnings": []
      },
      {
        "stepOrder": 2,
        "stepType": "message",
        "variant": "a",
        "body": "Thanks for connecting, {firstName}. Did my email about onboarding new engineers reach you?",
        "waitDays": 2,
        "anchorEmailStepOrder": 1,
        "positionInGap": 1,
        "conditionType": "accepted",
        "isOptional": false,
        "openProfileOnly": false,
        "waitFromCondition": false,
        "isActive": true,
        "id": 9302,
        "requiresApproval": false,
        "warnings": []
      }
    ],
    "connectionNoteMaxChars": 200
  }
}
```

## Types

Each named type the tables above use, nested ones included.

### ReplaceLinkedInSequenceStepRequest

One variant of one LinkedIn step to save. The step's type and timing come from variant `a`: `stepType`, `waitDays`, `anchorEmailStepOrder`, `positionInGap`, `conditionType`, `conditionScopeStepOrder`, `isOptional` and `openProfileOnly`. Each variant sets its own `body`, `subject`, `name`, `isActive`, `noteMode` and `aiInstructions`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer (int64) | no | The id of the row to update. Omit it to update the row with the same `stepOrder`, `variant` and `stepType`, or to add a new one. |
| `stepOrder` | integer (int32) | no | The step's position in the LinkedIn sequence, starting at 1. The variants of one step share it. |
| `stepType` | string | yes | What the step does: `profile_visit`, `connection_request`, `message`, `voice_note`, `follow`, `like_post`, `endorse_skill` or `comment_post`. Required. `in_mail` is refused: use `message`, which Kenso can send as an InMail to a contact who is not connected. `follow`, `like_post`, `endorse_skill` and `comment_post` need the `linkedin_engagement` feature, and `voice_note` needs the `linkedin_voice_notes` feature. |
| `variant` | string | no | The variant for A/B testing: `a`, `b`, `c` or `d`, in any letter case. Defaults to `a`. Every step needs variant `a`, and `profile_visit`, `follow`, `like_post`, `endorse_skill` and `comment_post` steps cannot have other variants. |
| `name` | string | no | A label for the variant, at most 255 characters. LinkedIn never shows it. |
| `subject` | string | no | The InMail subject of a `message` or `voice_note` step, at most 200 characters. Kenso uses it when the step goes out as an InMail. |
| `body` | string | no | The text of the step. A `connection_request` note is at most 275 characters, and must be empty when `noteMode` is `ai`. A `message` needs a body of at most 1,900 characters. A `voice_note` needs the text Kenso sends when the voice note cannot go, at most 1,900 characters. A `comment_post` body is optional guidance for the comment Ken writes, at most 500 characters. Other step types ignore it. |
| `waitDays` | integer (int32) | no | Days Kenso waits before the step, at least 0. They count from when the anchor email is sent, or from when the contact entered the LinkedIn sequence when `anchorEmailStepOrder` is 0. |
| `anchorEmailStepOrder` | integer (int32) | no | The `stepOrder` of the email step this step follows, or 0 to place it before the first email. When the email sequence has steps, it must be one of them. |
| `positionInGap` | integer (int32) | no | The step's order among the LinkedIn steps that follow the same email, at least 0. Lower numbers run first. |
| `conditionType` | string | no | What must happen before the step runs: `none` (the default), `clicked` (the contact clicked a link in an email), `replied_positive` (the contact replied with interest), `accepted` (the contact accepted the invitation or is already connected), `engaged` (the contact read or reacted to a LinkedIn message) or `not_accepted` (the contact did not accept the invitation within the campaign's `notAcceptedAfterDays`). `accepted` and `not_accepted` need a `connection_request` earlier in the sequence, and `engaged` needs a `message` or `voice_note` earlier. When the condition is not met within its waiting window, Kenso skips the step. |
| `conditionScopeStepOrder` | integer (int32) | no | For a `clicked` condition, the `stepOrder` of the email whose link must be clicked. Null or omitted means a link in any email sent so far. |
| `isOptional` | boolean | no | Set to true to skip the step once the next email after its anchor email is sent. Defaults to false. |
| `openProfileOnly` | boolean | no | Set to true so that, when a `message` step goes out as a free InMail, Kenso sends it only to open profiles and skips the others. Defaults to false. |
| `waitFromCondition` | boolean | no | With an `accepted` or `not_accepted` condition, set to true to also count `waitDays` from the moment the condition came true (the contact accepted, or the invite expired). The step goes once both waits have passed: the one after the anchor and the one after the condition. A `message` with `accepted`, `waitDays` 1 and this on goes one day after the contact connects, and never before its anchor wait. Any other condition rejects it. Defaults to false. |
| `isActive` | boolean | no | Whether Kenso runs this variant. Defaults to true. |
| `noteMode` | string | no | How a `connection_request` gets its note: `template` sends `body`, and `ai` has Ken write a note for each contact. `ai` needs the `linkedin_ai_notes` feature and an empty `body`, and only `connection_request` steps can use it. Omit it to keep the stored mode, or `template` for a new row. |
| `aiInstructions` | string | no | Your instructions to Ken for writing the notes of a `connection_request` with `noteMode` `ai`, at most 1,000 characters. Only `connection_request` steps can have them. |
| `voice` | VoiceNoteSettingsRequest | no | The voice settings of a `voice_note` step. Required on a `voice_note` step, and refused on every other step type. |
| `requiresApproval` | boolean | no | For a `like_post`, `endorse_skill` or `comment_post` step: true holds each like, endorsement or comment in Approvals until a person approves it, with the exact comment or the post or skill as the preview. False lets Ken act without asking. Omit it to keep the stored value; a new step of these types starts at true. Ignored, and stored false, on every other step type. |

### VoiceNoteSettingsRequest

How Kenso records the voice note of a `voice_note` step for each contact.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `provider` | string | yes | The voice provider: `deepgram` or `elevenlabs`. Required. |
| `voiceId` | string | yes | The voice's id, as `GET /v1/voices` lists it, at most 200 characters. Required. |
| `speed` | number (double) | no | How fast the voice speaks, from 0.50 to 1.50. Only `deepgram` voices use it. Null or omitted means the voice's normal speed. |
| `wordsMode` | string | yes | Who writes the words: `ken_writes` (Ken writes each note from `instructions`) or `script` (the voice reads `script`). Required. |
| `instructions` | string | no | What Ken should say, at most 1,000 characters. Required when `wordsMode` is `ken_writes`, and must be empty when it is `script`. |
| `script` | string | no | The words the voice reads, at most 900 characters. Required when `wordsMode` is `script`, and must be empty when it is `ken_writes`. |
| `model` | string | no | The model Ken writes with when `wordsMode` is `ken_writes`: `haiku` or `sonnet`. Null or omitted means `haiku`. |
| `matchLeadLanguage` | boolean | no | Set to true to speak each note in the contact's outreach language instead of the voice's own. For a `deepgram` voice, Kenso picks a voice of the same gender in that language, and keeps the chosen voice when there is none. Defaults to false. |

### LinkedInSequenceStep

One variant of one LinkedIn step in a sequence, timed around the emails.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer (int64) | no | The step's id. Send it back in a replace to update this step. |
| `stepOrder` | integer (int32) | no | The step's position in the LinkedIn sequence, starting at 1. The variants of one step share it. |
| `stepType` | string | no | What the step does: `profile_visit`, `connection_request`, `message`, `voice_note`, `follow`, `like_post`, `endorse_skill` or `comment_post`. Older steps can read `in_mail`. |
| `variant` | string | no | The variant of the step for A/B testing: `a`, `b`, `c` or `d`. |
| `name` | string | no | A label for the variant. LinkedIn never shows it. Null when none is set. |
| `subject` | string | no | The subject Kenso uses when a `message` or `voice_note` step goes out as an InMail. Null when none is set. |
| `body` | string | no | The text of the step. It is the note of a `connection_request`, the message of a `message`, the text Kenso sends when a `voice_note` cannot go, and guidance for the comment Ken writes on a `comment_post`. Other step types have no body. |
| `waitDays` | integer (int32) | no | Days Kenso waits before the step. They count from when the anchor email is sent, or from when the contact entered the LinkedIn sequence when `anchorEmailStepOrder` is 0. |
| `anchorEmailStepOrder` | integer (int32) | no | The `stepOrder` of the email step this step follows. 0 places it before the first email. |
| `positionInGap` | integer (int32) | no | The step's order among the LinkedIn steps that follow the same email. Lower numbers run first. |
| `conditionType` | string | no | What must happen before the step runs: `none`, `clicked` (the contact clicked a link in an email), `replied_positive` (the contact replied with interest), `accepted` (the contact accepted the invitation or is already connected) or `engaged` (the contact read or reacted to a LinkedIn message). When the condition is not met within its waiting window, Kenso skips the step. |
| `conditionScopeStepOrder` | integer (int32) | no | For a `clicked` condition, the `stepOrder` of the email whose link must be clicked. Null means a link in any email sent so far. |
| `isOptional` | boolean | no | Whether Kenso skips the step once the next email after its anchor email is sent. |
| `openProfileOnly` | boolean | no | When a `message` step goes out as a free InMail, whether Kenso sends it only to open profiles and skips the others. |
| `waitFromCondition` | boolean | no | With an `accepted` or `not_accepted` condition, true counts `waitDays` from the moment the condition came true (the contact accepted, or the invite expired), so a 1-day wait means one day after they connect. |
| `isActive` | boolean | no | Whether Kenso runs this variant. An inactive variant is kept but not run. |
| `noteMode` | string | no | How a `connection_request` gets its note: `template` sends `body`, and `ai` has Ken write a note for each contact. Other step types read `template`. |
| `aiInstructions` | string | no | Your instructions to Ken for writing the notes of a `connection_request` with `noteMode` `ai`. Null when none are set. |
| `voice` | VoiceNoteSettings | no | The voice settings of a `voice_note` step. Null on every other step type. |
| `requiresApproval` | boolean | no | Whether Kenso asks a person before it acts: on a `like_post`, `endorse_skill` or `comment_post` step, true holds each like, endorsement or comment in Approvals, with the exact comment or the post or skill, until someone approves it. False on every other step type, and on one of these steps when the owner turned it off. |
| `warnings` | array of string | no | Advice about this step that never stops a save. `unfilled_token:<name>` means the body, or the InMail subject, holds a `{{name}}` that nothing fills: it is no campaign variable, it has no inline fallback (`{{name\|text}}`) and no AI variable fallback. Kenso then holds each contact's LinkedIn sequence at this step instead of sending the token as written. The AI variable fallbacks are read under the campaign's own AI prompts and under each segment's the step can run under; a token only a segment's prompts leave unfilled reads `unfilled_token:<name> (segment "<segment name>")`. Null when there is nothing to report. |

### VoiceNoteSettings

How Kenso records the voice note of a `voice_note` step for each contact.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `provider` | string | no | The voice provider: `deepgram` or `elevenlabs`. |
| `voiceId` | string | no | The voice's id, as `GET /v1/voices` lists it. |
| `speed` | number (double) | no | How fast the voice speaks, from 0.50 to 1.50. Only `deepgram` voices use it. Null means the voice's normal speed. |
| `wordsMode` | string | no | Who writes the words: `ken_writes` (Ken writes each note from `instructions`) or `script` (the voice reads `script`). |
| `instructions` | string | no | What Ken should say, when `wordsMode` is `ken_writes`. Null otherwise. |
| `script` | string | no | The words the voice reads, when `wordsMode` is `script`. Null otherwise. |
| `model` | string | no | The model Ken writes with when `wordsMode` is `ken_writes`: `haiku` or `sonnet`. Null means `haiku`. |
| `matchLeadLanguage` | boolean | no | Whether the note is spoken in each contact's outreach language instead of the voice's own. For a `deepgram` voice, Kenso picks a voice of the same gender in that language, and keeps the chosen voice and its language when there is none. |
