API and MCP
Bundles
The bundles a project has received, and the steps that upload one
Complete a bundle upload
POST /api/v1/project/{projectId}/bundle/upload/complete
Credentials: Spice Pass only.
Finishes an upload once every part has been sent. Quote the uploadId, blobKey and sha256 from the start of the upload and, in parts, each partNumber with the etag its upload returned. The bundle is then verified and its survey begins. The Idempotency-Key header is required; a repeat completes to the same answer. Only a Spice Pass may call this, as the Spice Labs CLI does.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
projectId required | path | string (uuid) | The project's id. |
Idempotency-Key required | header | string |
Request body
application/json (required)
Responses
| Status | Description | Body |
|---|---|---|
200 | status is queued and bundleId identifies the bundle. | UploadCompleted |
400 | The body is invalid, or the Idempotency-Key header is missing. | Error |
401 | The credential is missing, expired, revoked, or is not a Spice Pass. | Error |
403 | blobKey does not belong to this project. | Error |
404 | No upload was started for the bundle named by blobKey. | Error |
500 | A fault on our side. | Error |
503 | The project's data is temporarily unreachable; code says why. | Error |
Example
curl -X POST "https://api.spicelabs.io/api/v1/project/<projectId>/bundle/upload/complete" \
-H "Authorization: Bearer $SPICE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '<JSON body>' Start a bundle upload
POST /api/v1/project/{projectId}/bundle/upload/init
Credentials: Spice Pass only.
Begins an upload of one bundle and returns where to put its bytes: a parts list of part numbers with a presignedUrl, offset and size each, valid for expiresIn seconds, plus the uploadId, blobKey, bundleId and survey jobId to quote back when completing. sha256 and sizeBytes describe the bundle; parentId names a survey started earlier, otherwise a survey is created here. The Idempotency-Key header is required: a repeat with the same key returns the same answer. The upload operations are performed by the Spice Labs CLI with a Spice Pass, and only a Spice Pass may call them; encryptedChallenge is always required and the CLI supplies it.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
projectId required | path | string (uuid) | The project's id. |
Idempotency-Key required | header | string |
Request body
application/json (required)
Responses
| Status | Description | Body |
|---|---|---|
200 | Where to send each part, and the ids to complete the upload with. | UploadStarted |
400 | The body is invalid, the bundle is larger than the maximum allowed, encryptedChallenge is missing, parentId is a survey of another type, or the Idempotency-Key header is missing. | Error |
401 | The credential is missing, expired, revoked, or is not a Spice Pass. | Error |
403 | encryptedChallenge does not answer the Spice Pass's challenge. | Error |
404 | No survey with id parentId exists in this project. | Error |
500 | A fault on our side. | Error |
503 | The project's data is temporarily unreachable; code says why. | Error |
Example
curl -X POST "https://api.spicelabs.io/api/v1/project/<projectId>/bundle/upload/init" \
-H "Authorization: Bearer $SPICE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '<JSON body>' Report bundle upload progress
PUT /api/v1/project/{projectId}/bundle/upload/progress
Credentials: Spice Pass only.
Records how far an upload has got: jobId is the survey's jobId from the start of the upload and progress is 0 to 100. The value lands on the survey's upload step while it is pending or running; a lower value than already recorded, an unknown job or a finished step is accepted and ignored. Only a Spice Pass may call this, as the Spice Labs CLI does.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
projectId required | path | string (uuid) | The project's id. |
Request body
application/json (required)
Responses
| Status | Description | Body |
|---|---|---|
200 | The report is accepted. | |
400 | jobId is missing or not an id, or progress is outside 0 to 100. | Error |
401 | The credential is missing, expired, revoked, or is not a Spice Pass. | Error |
403 | The token is valid but not allowed to do this. | Error |
500 | A fault on our side. | Error |
503 | The project's data is temporarily unreachable; code says why. | Error |
Example
curl -X PUT "https://api.spicelabs.io/api/v1/project/<projectId>/bundle/upload/progress" \
-H "Authorization: Bearer $SPICE_API_TOKEN" \
-H "Content-Type: application/json" \
-d '<JSON body>' Get runtime survey settings
GET /api/v1/project/{projectId}/bundle/upload/runtime-config
Credentials: Spice Pass only.
The settings the Spice Labs CLI applies when it runs a runtime survey for this project, as a JSON document. Only a Spice Pass may call this.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
projectId required | path | string (uuid) | The project's id. |
Responses
| Status | Description | Body |
|---|---|---|
200 | The runtime survey settings as JSON. | |
401 | The credential is missing, expired, revoked, or is not a Spice Pass. | Error |
403 | The token is valid but not allowed to do this. | Error |
500 | A fault on our side. | Error |
Example
curl -X GET "https://api.spicelabs.io/api/v1/project/<projectId>/bundle/upload/runtime-config" \
-H "Authorization: Bearer $SPICE_API_TOKEN" List bundles
GET /api/v1/project/{projectId}/v1/bundle
Credentials: API token or dashboard sign-in.
The bundles this project has received, newest first: each with its id, sha256, mime_type, comment and upload date. Page with limit, 1000 by default and 10000 at most, and the cursors after or before, taking pagination.lastId or pagination.firstId from the previous page. Requires project:view.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
projectId required | path | string (uuid) | The project's id. |
limit | query | integer (int32) | How many bundles to return, 1 to 10000 (default 1000) |
after | query | string (uuid) | Bundle id cursor: the bundles listed after it, which are older. Not together with before |
before | query | string (uuid) | Bundle id cursor: the bundles listed before it, which are newer. Not together with after |
Responses
| Status | Description | Body |
|---|---|---|
200 | A page of the project's bundles in bundles, newest first, with pagination. | BundlePage |
400 | limit is below 1 or above 10000, a cursor names no bundle, or both cursors are given. | Error |
401 | The token is missing, expired, revoked or of the wrong kind. | Error |
403 | The token is valid but not allowed to do this. | Error |
500 | A fault on our side. | Error |
503 | The project's data is temporarily unreachable; code says why. | Error |
Example
curl -X GET "https://api.spicelabs.io/api/v1/project/<projectId>/v1/bundle" \
-H "Authorization: Bearer $SPICE_API_TOKEN"