# st.archiveJob

Move a job in the account’s LinkedIn job tracker to the archived stage.

> The API Reference is also the SDK and CLI reference. Consecutive code fences marked `tab=HTTP`, `tab=Node`, `tab=Python` and `tab=CLI` are the same call on each surface (a fence marked `tab=HTTP,CLI` is the same text for both), and a block between `:::surface <names>` and `:::` applies only to the surfaces it names. Identifiers in the text are written as in Node and in HTTP JSON (camelCase); the Python SDK spells methods, parameters and result attributes in snake_case (`sendMessage` → `send_message`, `reconnectionLink` → `reconnection_link`), while names inside HTTP JSON stay camelCase.

Move a job in the account’s [job tracker](/docs/tracking-jobs) to the `archived` stage. The job stays in the tracker and keeps its applied stamp.

:::surface node,python
In the SDK this is the `archiveJob` method. It takes the parameters below except `label`, which exists only in workflow JSON. It returns no `data`: a failed action comes back in `errors`, with one of the error types below.
:::

:::surface cli
The command is `linkedin jobs archive`. Its argument and flags are listed below.
:::

## Constraints

> ⏺️ **Root Start:** allowed.

> ⬆️ **Parent Actions:** N/A.

> ⬇️ **Child Actions:** N/A.

## Parameters

```json tab=HTTP
{
  "actionType": "st.archiveJob",
  "label": "archiveJob1",
  "jobUrl": "https://www.linkedin.com/jobs/view/4450053454/",
  "currentStage": "saved"
}
```

```typescript tab=Node
const workflow = await linkedapi.archiveJob.execute({
  jobUrl: "https://www.linkedin.com/jobs/view/4450053454/",
  currentStage: "saved"
});

const { errors } = await linkedapi.archiveJob.result(workflow.workflowId);
```

```python tab=Python
from linkedapi import ArchiveJobParams

workflow = linkedapi.archive_job.execute(
    ArchiveJobParams(job_url="https://www.linkedin.com/jobs/view/4450053454/", current_stage="saved")
)

result = linkedapi.archive_job.result(workflow.workflow_id)
```

```bash tab=CLI
linkedin jobs archive https://www.linkedin.com/jobs/view/4450053454/ --current-stage saved --json
```

In AI assistants, the MCP tool is `archive_job`. The n8n action is **Archive job**; the Make module is **Archive a job**.

| Parameter | Description |
| --- | --- |
| `label` | Optional label included in workflow completion. |
| `jobUrl` | Required. LinkedIn URL of the job, in the `linkedin.com/jobs/view/<id>` form. |
| `currentStage` | Optional. The stage the job is in now: `saved`, `draft`, `clickedApply`, `applied`, `interview`, `archived`. That stage is searched first, so a correct value finds the job without searching the others, which is faster and avoids `trackerTooLarge` from a large stage the job is not in. Omit it and the stages are searched in turn until the job is found. |

:::surface cli
| Arg | Required | Description |
| --- | --- | --- |
| `url` | yes | LinkedIn job URL |

| Flag | Description |
| --- | --- |
| `--current-stage` | Optional. The stage the job is in now. |
:::

## Archiving behaviour

- **Safe to repeat.** A job already archived succeeds without changing anything.
- **Only a tracked job.** A job that is not in the tracker returns `jobNotTracked`: save it first with [`st.saveJob`](/docs/action-st-save-job).
- **Nothing is lost.** The job keeps its `markedAppliedDate`, and [`st.unarchiveJob`](/docs/action-st-unarchive-job) takes it out of `archived` again.
- **Archived jobs are read separately.** Pass `stage: "archived"` to [`st.retrieveTrackedJobs`](/docs/action-st-retrieve-tracked-jobs).

## Result options

```json
{
  "actionType": "st.archiveJob",
  "label": "archiveJob1",
  "success": true
}
```

A successful call has no `data`. `label` is included only if specified in the action parameters.

## Error result

```json
{
  "actionType": "st.archiveJob",
  "label": "archiveJob1",
  "success": false,
  "error": {
    "type": "jobNotTracked",
    "message": "..."
  }
}
```

Possible `error.type` values:

- `jobNotTracked` — The job is not in the job tracker.
- `jobNotFound` — The job could not be opened or no longer exists.
- `trackerTooLarge` — The job tracker holds too many jobs in this stage to locate this job.
- `unexpectedError` — The change could not be completed.
