POST/v1/pieces

Add 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.

5 body fields

Platform piece details for an archive or registry package.

packageTypestringrequired
Allowed:ARCHIVE
pieceArchiveobjectrequired
pieceNamestringrequired
pieceVersionstringrequired
scopestringrequired
Allowed:PLATFORM

1 status code
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.