---
title: "Add a piece to a platform"
method: POST
path: "/v1/pieces"
tags: ["pieces"]
---

# Add a piece to a platform

`POST /v1/pieces`

Add a piece to a platform

## Request body

- union
  - object
    - `packageType` 'ARCHIVE', required
    - `scope` 'PLATFORM', required
    - `pieceName` string, required
    - `pieceVersion` string, required
    - `pieceArchive` object, required
      - `filename` string, required
      - `data` unknown, required
      - `type` 'file', required
  - object
    - `packageType` 'REGISTRY', required
    - `scope` 'PLATFORM', required
    - `pieceName` string, required
    - `pieceVersion` string, required

## Response `201`

Default Response

- object

## Changes

- **2025-01-09** `92e8f2eba0ee` — 6 breaking, 2 info
  - removed `subschema #1, subschema #2` from the `anyOf[subschema #1: Private Piece]/scope` request property `anyOf` list
  - removed `subschema #1, subschema #2` from the `anyOf[subschema #2: NPM Piece]/scope` request property `anyOf` list
  - request property `anyOf[subschema #1: Private Piece]/scope` was restricted to a list of enum values
  - request property `anyOf[subschema #2: NPM Piece]/scope` was restricted to a list of enum values
  - …4 more
- **2024-11-12** `499ae054e9e9` — 4 breaking
  - added the new required request property `anyOf[subschema #1: Private Piece]/pieceArchive/data`
  - added the new required request property `anyOf[subschema #1: Private Piece]/pieceArchive/filename`
  - added the new required request property `anyOf[subschema #1: Private Piece]/pieceArchive/type`
  - the `anyOf[subschema #1: Private Piece]/pieceArchive` request property type/format changed from ``/`` to `object`/``
- **2024-09-13** `225ff954244e` — 1 breaking, 1 info
  - api path removed without deprecation
  - endpoint added
- **2024-09-05** `3e19fa5e716a` — 2 breaking
  - the `anyOf[subschema #1: Private Piece]/pieceName` request property's minLength was increased from `0` to `1`
  - the `anyOf[subschema #2: NPM Piece]/pieceName` request property's minLength was increased from `0` to `1`
- **2024-09-03** `b95c8c8e8262` — 1 info
  - endpoint added

[Full history](https://skmtc.dev/activeboxes/apis/activeboxes-documentation/changes/v1/pieces/post.md)

---

[API](https://skmtc.dev/activeboxes/apis/activeboxes-documentation.md) · [All operations](https://skmtc.dev/activeboxes/apis/activeboxes-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/activeboxes/activeboxes-documentation/revisions/12c564515962/schema)
