POST
/v1/piecesAdd a piece to a platform
Creates a platform piece from an uploaded archive or an NPM registry package. Supply the fields required for the selected packageType; archive pieces also require pieceArchive with its filename, data, and type.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Platform piece details for an archive or registry package.
packageTypestringrequired
pieceArchiveobjectrequired
pieceNamestringrequired
pieceVersionstringrequired
scopestringrequired
201Returns the created piece.
Error handling
Choose packageType as ARCHIVE or REGISTRY and set scope to PLATFORM. pieceName must contain at least one character, and pieceVersion must use the numeric major.minor.patch format. For an ARCHIVE piece, pieceArchive must include filename, data, and type.