Add Fetch
- POST
- /workspaces
- /:workspace
- /sandboxes
- /:sandbox_id
- /fetches
Add a source to fetch into a sandbox
Request
REQUIRED SCOPES
SANDBOX_WRITE
URL PARAMETERS
workspacerequiredstring
The human-readable ID of the workspaceExample: "my-company"
sandbox_idrequiredstring
The ID of the sandboxExample: "sb-1234567890abcdef"
BODY PARAMETERS
typestring enum
The type of the fetch item: PROJECT_REPO, PUBLIC_REPO, or ARTIFACTAllowed enum:
PROJECT_REPO,PUBLIC_REPO,ARTIFACTidstring
The auto-generated ID of the fetchrepositorystring
The URL of the git repository (for PUBLIC_REPO type)refstring
The branch, tag, or commit to checkout. Defaults to the default branchpathstring
The target directory where the item is cloned/downloaded. It identifies the fetch, so two entries cannot share it. Defaults to the app directorysource_pathstring
The path inside the artifact to fetch instead of its whole content (for ARTIFACT type)current_revisionstring
The revision currently checked out in the sandbox (for repository fetches)behindinteger
How many commits the fetched revision is behind the configured ref, null when it cannot be measuredoutdatedboolean
Whether the fetched artifact version differs from the current one, null when it cannot be measuredfetched_datestring
When the source was last fetched into the sandbox, null when it has not been fetched yetstatusstring enum
State of this entry: FETCHING, FETCHED, ERROR after a failed run, STALE when it needs a refetch: it was changed, added while the sandbox was not running, or its fetch was interrupted. Only Refetch brings a STALE entry up to dateAllowed enum:
FETCHING,FETCHED,ERROR,STALEerror_messagestring
Why the last fetch failed, null unless the status is ERRORbuild_commandstring
The command to run after fetchingartifactstring
The artifact identifier in format pkg:version (for ARTIFACT type)Response
RESPONSE BODY
typestring enum
The type of the fetch item: PROJECT_REPO, PUBLIC_REPO, or ARTIFACTAllowed enum:
PROJECT_REPO,PUBLIC_REPO,ARTIFACTidstring
The auto-generated ID of the fetchrepositorystring
The URL of the git repository (for PUBLIC_REPO type)refstring
The branch, tag, or commit to checkout. Defaults to the default branchpathstring
The target directory where the item is cloned/downloaded. It identifies the fetch, so two entries cannot share it. Defaults to the app directorysource_pathstring
The path inside the artifact to fetch instead of its whole content (for ARTIFACT type)current_revisionstring
The revision currently checked out in the sandbox (for repository fetches)behindinteger
How many commits the fetched revision is behind the configured ref, null when it cannot be measuredoutdatedboolean
Whether the fetched artifact version differs from the current one, null when it cannot be measuredfetched_datestring
When the source was last fetched into the sandbox, null when it has not been fetched yetstatusstring enum
State of this entry: FETCHING, FETCHED, ERROR after a failed run, STALE when it needs a refetch: it was changed, added while the sandbox was not running, or its fetch was interrupted. Only Refetch brings a STALE entry up to dateAllowed enum:
FETCHING,FETCHED,ERROR,STALEerror_messagestring
Why the last fetch failed, null unless the status is ERRORbuild_commandstring
The command to run after fetchingartifactstring
The artifact identifier in format pkg:version (for ARTIFACT type)Last modified on Oct 20, 2026
Request example
CURLcurl -X POST "https://api.buddy.works/workspaces/:workspace/sandboxes/:sandbox_id/fetches" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "Content-Type: application/json"
STATUS200 OK