---
title: "Create or update an SLX (upsert)"
method: POST
path: "/api/v1/workspaces/{workspace}/slxs/sync"
tags: ["Custom Tasks"]
---

# Create or update an SLX (upsert)

`POST /api/v1/workspaces/{workspace}/slxs/sync`

Upsert an SLX. Commit a custom task by syncing the SLX, then its Runbook (POST /runbooks/sync) and optional SLI (POST /slis/sync). Prefer the MCP Tool Builder (commit_slx) which validates and tests first. See the GitOps guide.

## Path parameters

- `workspace` string, required

## Request body

- SyncRequest — Upsert envelope for SLX/Runbook/SLI sync. The payload shape matches the target resource.
  - `payload` object, required

## Response `200`

Upserted SLX (returns resource_id)

## Other responses

- `201` — Created

---

[API](https://skmtc.dev/runwhen/apis/runwhen-platform-api.md) · [All operations](https://skmtc.dev/runwhen/apis/runwhen-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runwhen/runwhen-platform-api/revisions/9d1a64d4b1c1/schema)
