Machine Preview
Machine Preview
/v2/machines/{machine_id}/previewReturn a preview link to port, or to the machine's default port when port is omitted. On a deployment with a branded preview domain the link is minted without waking the machine. Otherwise a sleeping machine is resumed first, so the request can take a few seconds on a cold sandbox. expires_at is when a branded link expires; it is null for a provider link. HTTP 422 with detail.code=interface_preview_only means port 8000 on this machine serves an interface's unpublished dashboard, which opens only at the interface's preview address, behind sign-in. detail.message names that address and detail.preview_url carries it (null when the interface is archived or the deployment has no interfaces domain). Other ports on that machine, and every port on other machines, are unaffected. HTTP 422 with a string detail means the machine cannot expose the port as a preview: Modal machines have no public preview port, and a port the provider reaches only with extra routing headers (an AWS MicroVM port other than its proxy's default) is refused because the returned link carries a single token header and would open a different port. HTTP 422 with an array in detail reports request validation errors.
Path Parameters
machine_idstring · uuidrequiredQuery Parameters
portintegeroptionalPort on the machine to expose. Omit to use the provider default.
curl --request GET \
--url https://api.brainbaselabs.com/v2/machines/{machine_id}/preview \
--header 'Authorization: Bearer YOUR_API_KEY'{
"url": "string",
"port": 0,
"token": "string",
"token_header": "string",
"expires_at": "2019-08-24T14:15:22Z"
}