A service runs an image or a repository. Each deployment starts a new version beside the running one and takes over once it is healthy; variables, scaling, previews, rollbacks and logs are here too.
Start a deployment from a repository's push webhook.
The URL is the credential: it carries a secret only members can read. A push to another branch than the service's deploys a preview if the service has previews on, and nothing otherwise.
Path parameters
iduuidpathrequired
secretstringpathrequired
Responses
202no body
A deployment was queued, or one already was
204no body
The push needed no deployment
404Problem
curl -X POST "https://api.infraflow.app/v1/hooks/deploy/0197b2a4-5c1e-7d3a-9f10-4b6c8e2a1d55/secret" \
-b cookies.txt
Connect GitLab, Bitbucket or Forgejo with a token. The token is checked with the host, then kept encrypted.
Path parameters
orgstringpathrequired
Organisation slug
Request body · application/json
base_urlstring | null
The host's address, for a server of your own: https://git.acme.dev. gitlab.com, bitbucket.org or codeberg.org if absent.
providerGitProviderrequired
tokenstringrequired
GitLab: a personal, group or project access token with the scope. Bitbucket: a workspace or repository access token, or an app password with . Forgejo and Gitea: an access token with read and write access to repositories.
The volumes of the workspace's deleted services that are still kept, and when each will be removed. Until then they can be downloaded as a snapshot taken before the service was deleted, if there is one.
Promote a preview: run what a branch's live preview runs at the service's own address, without building again. The service keeps its own variables; the preview stays where it is.
Promote a deployment to another environment of its project: run the image it runs there as it is, without building again, with that environment's variables. Into a protected environment, it waits for an approval, and whoever is told about promotions hears of it.
Run a command inside a service's container and wait for it.
The command runs in the first copy of the live deployment, as the user its image runs as. It is a one-off: nothing it starts outlives it once the time is up.
Make new versions start with a share of the requests, or with all of them. With a share, a deployment that is ready answers that part of the traffic beside the live one, until it is given everything or taken back.
Put a snapshot back: the volume's content becomes what it was then. The service is stopped meanwhile and started again after; what was written since the snapshot is lost.
Path parameters
orgstringpathrequired
Organisation slug
servicestringpathrequired
iduuidpathrequired
Request body · application/json
targetstring | null
Put the files into this service's volume instead: another service of the workspace that has a volume, made for the purpose or not. Its own service when absent.
Run a service on several nodes at once, each copy on a node of its own, all behind its address.
The first copy runs beside the rest of its environment, as before; each region given adds a copy on another node, in that region or anywhere for "". Copies that are added are deployed at once, those removed stop at once, the others are left running. A volume is kept the same on every copy: files written on one reach the others within seconds, the last write winning when two copies change the same file. Each copy counts against the plan's memory and CPU like a service of its own.
Start a stopped service again: what it ran when it was stopped runs again, without building anything, where its image still is. Otherwise it is deployed anew.
Stop a service: its containers are removed and its address stops answering, until it is started again. Its volume, its variables and its history stay. A deployment on its way is given up as well.
Read a service's variables with their values. From the dashboard this needs a recent confirmation of identity (/v1/auth/confirm); without one the answer is 403 confirmation_required.
When the nodes remove it, and the snapshots of its service go.
servicestring | null
The service it belonged to.
snapshotsSnapshot[]required
Snapshots of its service still kept until then.
created_atdate-timerequired
errorstring | null
finished_atdate-time | null
frozenstring | null
What kept the volume still while it was read: a snapshot of its filesystem (btrfs, zfs, lvm-thin), or its containers held the whole time (pause, stop, live).
frozen_msinteger | null
How long the containers were frozen or stopped, in milliseconds.
iduuidrequired
kindstringrequired
manual or scheduled.
logstring | null
What the node did, a line each.
servicestringrequired
The service it was taken of, even once that service is deleted.
size_bytesinteger | null
statusstringrequired
queued, running, done or failed.
storedstring | null
Where its data went: archive (a gzipped tar the platform keeps, which can be downloaded) or restic (what changed since the last one, in the platform's restic repository). Absent for snapshots taken before nodes said.
Run to build it, when the repository has no Dockerfile.
builderstringrequired
How it is built: dockerfile with the repository's Dockerfile (one is written from what the repository is when it has none), or automatic to always write one from what the repository is.
cpusnumberrequired
created_atdate-timerequired
databasestring | null
The engine, when this service is a managed database: postgres, mysql, mariadb or redis.
deploy_hookstring | null
A URL that starts a new deployment when it receives a POST, for a repository's push webhook. Only shown to members.
dockerfile_pathstring | null
The Dockerfile it is built with, when not Dockerfile.
environmentstringrequired
Slug of the environment it belongs to. Services of one environment reach each other by name on a private network.
gitGitLink | any | null
github_installationinteger | null
For a repository shared through GitHub: the installation it comes through.
health_kindstringrequired
How it is known to be up: http (answers a request at health_path), tcp (its port accepts connections) or none.
health_pathstringrequired
health_timeout_secsintegerrequired
Seconds a new version has to come up before it is given up on.
hostnamestringrequired
iduuidrequired
memory_mbintegerrequired
mountsServiceMount[]required
Folders of that volume shown at other paths of the container.
pathstringrequired
Where the program sees it: an absolute path inside the container. When the folder is empty, what the image holds there is copied into it first.
subpathstringrequired
The folder, relative to the volume's root, such as templates. It is made if it is not there.
namestringrequired
nodesintegerrequired
How many nodes it runs on at once, each with its copies: 1 unless it was spread over more.
portintegerrequired
The port the program listens on. Zero while port_auto is set and no deployment has found it yet.
port_autobooleanrequired
Whether the port is found at each deployment rather than set: port is then where the program was last found listening.
positionPosition | any | null
previewsbooleanrequired
Whether pushes to other branches get their own address.
projectstringrequired
Slug of the project the service belongs to.
publicbooleanrequired
Whether it has a public address. A private service (a database, say) is reached only from its environment, at <name>:<port>.
referencesstring[]required
Names of the services its variables refer to: what it depends on.
replicasintegerrequired
How many copies run behind the address.
root_dirstring | null
The folder of the repository the service is built from, when not its root.
sleep_after_minutesinteger | null
Minutes without a request before the service is stopped, to be started again by the next request. Absent: it never sleeps.
sourcestringrequired
The image reference, the repository URL, or owner/name on GitHub.
source_kindSourceKindrequired
start_argsstring | null
Words given to what its image starts, as they are.
start_commandstring | null
Run to start it, instead of what its image starts.
statusstring | null
Status of the latest deployment: queued, building, live, failed, asleep or stopped.
suggested_variablesSuggestedVariable[]required
Variables its repository's example file names and it does not have.
namestringrequired
valuestringrequired
tcp_addressstring | null
Where it is reached from the internet over plain TCP, as host:port, when it was given a public port: for what is not a web server. Connections are passed on to port as they are.
udpbooleanrequired
Whether that public port carries UDP as well, under the same number.
variablesstring[]required
Names of the environment variables. Values are never returned.
volume_pathstring | null
Where the service's persistent volume is mounted. Data written elsewhere is lost at each deployment.
watch_pathsstring[]required
A push deploys only if it touches one of these; empty for any push.
For worker: its files, by name. worker.js is where it starts; a greeting if absent.
git_connectionuuid | null
For git: a GitLab, Bitbucket or Forgejo connection of the workspace (/v1/orgs/{org}/git-connections) that reads the repository, then given as owner/name in source. It is cloned with the connection's token, and its pushes and merge requests deploy through a webhook the platform sets on it.
github_installationinteger | null
For github: the installation that shares the repository.
health_kindstring | null
How it is known to be up: http, tcp or none. http for a public service and tcp for a private one if absent.
health_pathstring | null
The path asked for when health_kind is http. / if absent.
memory_mbinteger | null
Memory limit in MiB. 512 if absent.
namestringrequired
Also the first label of the service's address.
portinteger | null
The port the program listens on. Absent: it is found when the service is deployed, from what its image declares and where the program is then seen to listen.
previewsboolean
Give pushes to other branches their own address.
projectstringrequired
Slug of the project to add the service to. Empty for a Worker that lives by itself, outside any project.
publicboolean | null
Give the service a public address. True if absent; false for a database or anything only the other services should reach.
regionstring | null
A region id from /v1/regions: the region of its whole environment, which moves there first if it runs elsewhere. The environment's region stays as it is if absent.
replicasinteger | null
Copies to run, 1 to 10. One if absent.
root_dirstring | null
The folder of the repository to build, when not its root.
sleep_after_minutesinteger | null
Put the service to sleep after this many minutes without a request.
sourcestringrequired
An image such as ghcr.io/acme/api:1.4, a public repository URL such as https://github.com/acme/api, or, for github, a repository as owner/name.
source_kindSourceKindrequired
start_argsstring | null
Words given to what its image starts, as they are: start, say, for an image that waits to be told what to do.
start_commandstring | null
Run to start it, instead of what its image starts.
tcpboolean | null
Give it a public TCP port, passed on to port as it is: for a service that is not a web server. Only with public false.
udpboolean | null
Pass UDP on too, on the same public port: for voice, games and remote desktops. Only with tcp.
variablesmap of string
volume_pathstring | null
Keep what the program writes under this path across deployments, such as /data.
Responses
201Service
409Problem
name_taken, service_limit
422Problem
Fields of Service
branchstring | null
build_commandstring | null
Run to build it, when the repository has no Dockerfile.
builderstringrequired
How it is built: dockerfile with the repository's Dockerfile (one is written from what the repository is when it has none), or automatic to always write one from what the repository is.
cpusnumberrequired
created_atdate-timerequired
databasestring | null
The engine, when this service is a managed database: postgres, mysql, mariadb or redis.
deploy_hookstring | null
A URL that starts a new deployment when it receives a POST, for a repository's push webhook. Only shown to members.
dockerfile_pathstring | null
The Dockerfile it is built with, when not Dockerfile.
environmentstringrequired
Slug of the environment it belongs to. Services of one environment reach each other by name on a private network.
gitGitLink | any | null
github_installationinteger | null
For a repository shared through GitHub: the installation it comes through.
health_kindstringrequired
How it is known to be up: http (answers a request at health_path), tcp (its port accepts connections) or none.
health_pathstringrequired
health_timeout_secsintegerrequired
Seconds a new version has to come up before it is given up on.
hostnamestringrequired
iduuidrequired
memory_mbintegerrequired
mountsServiceMount[]required
Folders of that volume shown at other paths of the container.
pathstringrequired
Where the program sees it: an absolute path inside the container. When the folder is empty, what the image holds there is copied into it first.
subpathstringrequired
The folder, relative to the volume's root, such as templates. It is made if it is not there.
namestringrequired
nodesintegerrequired
How many nodes it runs on at once, each with its copies: 1 unless it was spread over more.
portintegerrequired
The port the program listens on. Zero while port_auto is set and no deployment has found it yet.
port_autobooleanrequired
Whether the port is found at each deployment rather than set: port is then where the program was last found listening.
positionPosition | any | null
previewsbooleanrequired
Whether pushes to other branches get their own address.
projectstringrequired
Slug of the project the service belongs to.
publicbooleanrequired
Whether it has a public address. A private service (a database, say) is reached only from its environment, at <name>:<port>.
referencesstring[]required
Names of the services its variables refer to: what it depends on.
replicasintegerrequired
How many copies run behind the address.
root_dirstring | null
The folder of the repository the service is built from, when not its root.
sleep_after_minutesinteger | null
Minutes without a request before the service is stopped, to be started again by the next request. Absent: it never sleeps.
sourcestringrequired
The image reference, the repository URL, or owner/name on GitHub.
source_kindSourceKindrequired
start_argsstring | null
Words given to what its image starts, as they are.
start_commandstring | null
Run to start it, instead of what its image starts.
statusstring | null
Status of the latest deployment: queued, building, live, failed, asleep or stopped.
suggested_variablesSuggestedVariable[]required
Variables its repository's example file names and it does not have.
namestringrequired
valuestringrequired
tcp_addressstring | null
Where it is reached from the internet over plain TCP, as host:port, when it was given a public port: for what is not a web server. Connections are passed on to port as they are.
udpbooleanrequired
Whether that public port carries UDP as well, under the same number.
variablesstring[]required
Names of the environment variables. Values are never returned.
volume_pathstring | null
Where the service's persistent volume is mounted. Data written elsewhere is lost at each deployment.
watch_pathsstring[]required
A push deploys only if it touches one of these; empty for any push.
Share the build cache between nodes through the platform's registry, so a node that never built the service starts from what the others built. Builds fall back to the node's own cache when the registry or BuildKit is out of reach.
liveness_interval_secsinteger | null
Check each running copy every this many seconds, as the deployment was checked before it went live (its health check). Absent: copies are only checked while they come up.
liveness_thresholdintegerrequired
Failed checks in a row before a copy is restarted and left out of the address until it answers again.
release_commandstring | null
Run once in a throwaway container of each new version, with the service's variables and network, before it takes any traffic: for database migrations. When it fails, the deployment fails with its output in the log and the running version stays.
Run in a throwaway container of the image just built, before the release command: failing tests fail the deployment, and the commit is marked failed on its Git host.
Share the build cache between nodes through the platform's registry, so a node that never built the service starts from what the others built. Builds fall back to the node's own cache when the registry or BuildKit is out of reach.
liveness_interval_secsinteger | null
Check each running copy every this many seconds, as the deployment was checked before it went live (its health check). Absent: copies are only checked while they come up.
liveness_thresholdintegerrequired
Failed checks in a row before a copy is restarted and left out of the address until it answers again.
release_commandstring | null
Run once in a throwaway container of each new version, with the service's variables and network, before it takes any traffic: for database migrations. When it fails, the deployment fails with its output in the log and the running version stays.
Run in a throwaway container of the image just built, before the release command: failing tests fail the deployment, and the commit is marked failed on its Git host.
Responses
200Pipeline
422Problem
Fields of Pipeline
branch_filtersstring[]required
Branches whose pushes deploy: patterns such as main, release/* or !wip/**. Empty: every branch (previews included).
build_cachebooleanrequired
Share the build cache between nodes through the platform's registry, so a node that never built the service starts from what the others built. Builds fall back to the node's own cache when the registry or BuildKit is out of reach.
liveness_interval_secsinteger | null
Check each running copy every this many seconds, as the deployment was checked before it went live (its health check). Absent: copies are only checked while they come up.
liveness_thresholdintegerrequired
Failed checks in a row before a copy is restarted and left out of the address until it answers again.
release_commandstring | null
Run once in a throwaway container of each new version, with the service's variables and network, before it takes any traffic: for database migrations. When it fails, the deployment fails with its output in the log and the running version stays.
Run in a throwaway container of the image just built, before the release command: failing tests fail the deployment, and the commit is marked failed on its Git host.
How many scheduled snapshots are kept, 1 to 90. Manual ones are kept until deleted.
modestringrequired
How the containers are kept from writing while the volume is read: pause (frozen, the default), stop (stopped and started again) or live (left running; files written meanwhile may be caught half-written).
snapshotsSnapshot[]required
created_atdate-timerequired
errorstring | null
finished_atdate-time | null
frozenstring | null
What kept the volume still while it was read: a snapshot of its filesystem (btrfs, zfs, lvm-thin), or its containers held the whole time (pause, stop, live).
frozen_msinteger | null
How long the containers were frozen or stopped, in milliseconds.
iduuidrequired
kindstringrequired
manual or scheduled.
logstring | null
What the node did, a line each.
servicestringrequired
The service it was taken of, even once that service is deleted.
size_bytesinteger | null
statusstringrequired
queued, running, done or failed.
storedstring | null
Where its data went: archive (a gzipped tar the platform keeps, which can be downloaded) or restic (what changed since the last one, in the platform's restic repository). Absent for snapshots taken before nodes said.
What kept the volume still while it was read: a snapshot of its filesystem (btrfs, zfs, lvm-thin), or its containers held the whole time (pause, stop, live).
frozen_msinteger | null
How long the containers were frozen or stopped, in milliseconds.
iduuidrequired
kindstringrequired
manual or scheduled.
logstring | null
What the node did, a line each.
servicestringrequired
The service it was taken of, even once that service is deleted.
size_bytesinteger | null
statusstringrequired
queued, running, done or failed.
storedstring | null
Where its data went: archive (a gzipped tar the platform keeps, which can be downloaded) or restic (what changed since the last one, in the platform's restic repository). Absent for snapshots taken before nodes said.
curl -X POST "https://api.infraflow.app/v1/orgs/acme/services/api/snapshots" \
-H "Authorization: Bearer $INFRAFLOW_TOKEN"
How many scheduled snapshots are kept, 1 to 90. Manual ones are kept until deleted.
modestringrequired
How the containers are kept from writing while the volume is read: pause (frozen, the default), stop (stopped and started again) or live (left running; files written meanwhile may be caught half-written).