Skip to main content

Add a source to a workspace

POST 

/api/v1/workspace/:workId/source

Adds a new SOURCE to an existing workspace identified by {workId}.

The owner / user context is resolved server-side from the X-API-Key header.

Request

FieldRequiredMax lengthNotes
codeYES150Source code identifier
descriptionNO250Human-readable description (nullable)

tsCreated is set server-side — NOT included in the request.

Response (HTTP 200)

Returns an echo of the accepted {code, description}. id is intentionally omitted — the internal endpoint returns HTTP 200 with an empty body, so no id is available.

Error handling

Validation failures (missing/empty code, code > 150 chars, description > 250 chars) → HTTP 400. Invalid or missing API-Key → HTTP 400. Workspace not found or no ownership → HTTP 400 with business error code (WS_ERR_101).

Request​

Responses​

Source added successfully. Returns echo of accepted code and description.