{"openapi":"3.1.0","info":{"title":"customcontainer API","version":"1","summary":"Read your container definitions, their pull references and build history, and detect the PHP extensions a composer.lock needs.","description":"The API is JSON over HTTPS. Every request needs your API key, all answers are JSON and every response is limited to your own containers.\n\n### Authentication\n\nCreate an API key in your [profile](https://customcontainer.io/profile) and send it as a bearer token:\n\n```\nAuthorization: Bearer <your-api-key>\n```\n\nA missing, unknown or replaced key, as well as a locked account, is answered with `401`. Generating a new key in the profile invalidates the old one immediately.\n\n### Rate limits\n\nEach API key may send **120 requests per minute** and **2000 per hour**. Every response carries `X-RateLimit-Limit` and `X-RateLimit-Remaining`. Above the limit the API answers `429` with a `Retry-After` header (seconds).\n\n### Errors\n\nErrors come with a matching HTTP status and a JSON body of the form `{\"error\": \"<message>\"}`. A container that does not exist and one that belongs to another account are both answered with `404`.\n\n### Values\n\nPHP version, distribution and CPU are returned in their machine form: `PHP84`, `rocky9`, `x86_64` / `aarch64`. Build numbers count from 1 (the oldest build) upwards.\n\n### Versioning\n\nThis is version 1, reachable under `/api/v1`. Within v1, fields are only ever **added**, never renamed or removed — ignore fields you do not know. Breaking changes get a new version prefix."},"servers":[{"url":"https://customcontainer.io/api/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/containers":{"get":{"operationId":"listContainers","summary":"List your containers","description":"All container definitions of your account. A container that inherits from another one (a child) names its master in `parent`.","x-codeSamples":[{"lang":"curl","source":"curl -H \"Authorization: Bearer $CC_TOKEN\" \"$CC_BASE/containers\""}],"responses":{"200":{"description":"Your containers. An empty list if you have none.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContainerSummary"}},"example":[{"uuid":"3e82594b-f3e1-4040-9fbe-372f9a50973c","name":"My App","php":"PHP84","distro":"rocky9","cpu":"x86_64","parent":null},{"uuid":"9a1c7d02-5b6e-4f3a-8c21-0d4e6f7a8b90","name":"my-app-dev","php":"PHP84","distro":"rocky9","cpu":"x86_64","parent":"3e82594b-f3e1-4040-9fbe-372f9a50973c"}]}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/containers/{containerUuid}":{"get":{"operationId":"getContainer","summary":"Get one container","description":"The current definition of a container and the image reference to pull. `reference` always points at the newest build; it is `null` until the container has been built once.\n\nFor a child container, PHP version, distribution, CPU, flags and locales come from its master, and `extensions` contains the inherited ones plus its own.","parameters":[{"$ref":"#/components/parameters/containerUuid"}],"x-codeSamples":[{"lang":"curl","source":"curl -H \"Authorization: Bearer $CC_TOKEN\" \"$CC_BASE/containers/<containerUuid>\"\n\n# pull exactly the version the API reports\npodman pull \"$(curl -s -H \"Authorization: Bearer $CC_TOKEN\" \"$CC_BASE/containers/<containerUuid>\" | jq -r .reference)\""}],"responses":{"200":{"description":"The container.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContainerDetail"},"example":{"uuid":"3e82594b-f3e1-4040-9fbe-372f9a50973c","name":"My App","php":"PHP84","distro":"rocky9","cpu":"x86_64","parent":null,"cli":true,"fpm":true,"shell":false,"timezone":true,"extensions":["gd","intl","pdo_mysql"],"locales":["de"],"description":"Production image of the shop","webEntryPath":"/app/public","image":"a1b2c3d.registry.customcontainer.io/my-app","version":"2.3.1","reference":"a1b2c3d.registry.customcontainer.io/my-app:2.3.1"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/ContainerNotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/containers/{containerUuid}/history":{"get":{"operationId":"getContainerHistory","summary":"Get the build history","description":"Every build of the container, **newest first**. Each build records its release tag, the installed packages and the layers it consists of. Builds made before mid-2026 did not record the selection, so `cli`, `fpm`, `extensions` and `locales` are `null` there.","parameters":[{"$ref":"#/components/parameters/containerUuid"}],"x-codeSamples":[{"lang":"curl","source":"curl -H \"Authorization: Bearer $CC_TOKEN\" \"$CC_BASE/containers/<containerUuid>/history\""}],"responses":{"200":{"description":"The builds, newest first. An empty list if the container was never built.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Build"}},"example":[{"number":7,"tag":"2.3.1","created":"2026-11-18 09:12:44","architecture":"amd64","layerCount":14,"totalSize":48210944,"packages":{"php84-php-common":"8.4.23-1.el9.remi","php84-php-intl":"8.4.23-1.el9.remi"},"layers":[{"name":"php84-php-intl","size":412160,"digest":"sha256:5f2d…"}],"cli":true,"fpm":true,"extensions":["gd","intl","pdo_mysql"],"locales":["de"]}]}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/ContainerNotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/containers/{containerUuid}/diff":{"get":{"operationId":"diffContainerBuilds","summary":"Compare two builds","description":"What changed between two builds of the same container: extensions, locales, packages (added, removed, new version), layers and size. Take the build numbers from the history.","parameters":[{"$ref":"#/components/parameters/containerUuid"},{"name":"from","in":"query","required":true,"description":"Build number to compare from (usually the older one).","schema":{"type":"integer","minimum":1},"example":6},{"name":"to","in":"query","required":true,"description":"Build number to compare to.","schema":{"type":"integer","minimum":1},"example":7}],"x-codeSamples":[{"lang":"curl","source":"curl -H \"Authorization: Bearer $CC_TOKEN\" \"$CC_BASE/containers/<containerUuid>/diff?from=6&to=7\""}],"responses":{"200":{"description":"The differences from `from` to `to`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildDiff"},"example":{"from":6,"to":7,"extensions":{"added":["intl"],"removed":[]},"locales":{"added":[],"removed":[]},"packages":{"added":[{"name":"php84-php-intl","version":"8.4.23-1.el9.remi"}],"removed":[],"changed":[{"name":"php84-php-common","from":"8.4.22-1.el9.remi","to":"8.4.23-1.el9.remi"}]},"layers":{"added":[{"name":"php84-php-intl","size":412160,"digest":"sha256:5f2d…"}],"removed":[]},"size":{"from":47798784,"to":48210944,"delta":412160}}}}},"400":{"description":"`from` or `to` is missing or not a number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"from and to query parameters are required integers"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"The container is not yours or does not exist (`container not found`), or one of the build numbers is not in its history (`build number not found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"build number not found"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/why":{"post":{"operationId":"detectExtensions","summary":"Detect required PHP extensions","description":"Reads a `composer.lock` and returns every PHP extension it asks for, together with the reason: the packages that require or suggest it, or `platform` / `platform-dev` for requirements of your own `composer.json`. Nothing is stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhyRequest"},"example":{"lock":{"packages":[{"name":"symfony/intl","require":{"php":">=8.2","ext-intl":"*"}}],"packages-dev":[],"platform":{"ext-pdo":"*"}},"no-dev":true}}}},"x-codeSamples":[{"lang":"curl","source":"jq '{lock: ., \"no-dev\": true}' composer.lock \\\n  | curl -H \"Authorization: Bearer $CC_TOKEN\" -H \"Content-Type: application/json\" \\\n         --data-binary @- \"$CC_BASE/why\""}],"responses":{"200":{"description":"The extensions and why each one is needed. An empty list if the lock file asks for none.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhyResult"},"example":{"intl":["symfony/intl"],"pdo":["platform"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"406":{"description":"The body has no `lock`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"lock is required"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your API key from the profile page."}},"parameters":{"containerUuid":{"name":"containerUuid","in":"path","required":true,"description":"The container's `uuid`, as returned by the list.","schema":{"type":"string","format":"uuid"},"example":"3e82594b-f3e1-4040-9fbe-372f9a50973c"}},"responses":{"Unauthorized":{"description":"No API key, an unknown or replaced key, or a locked account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"unauthorized"}}}},"ContainerNotFound":{"description":"The container does not exist or belongs to another account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"container not found"}}}},"TooManyRequests":{"description":"Rate limit exceeded. Wait the number of seconds given in `Retry-After`.","headers":{"Retry-After":{"description":"Seconds until the next request is accepted.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":"rate limit exceeded"}}}}},"schemas":{"ContainerSummary":{"type":"object","description":"A container as it appears in the list.","required":["uuid","name","php","distro","cpu","parent"],"properties":{"uuid":{"type":"string","format":"uuid","description":"Identifies the container in every other endpoint."},"name":{"type":"string","description":"The name you gave the container. Its slug is the image name in the registry."},"php":{"type":"string","description":"PHP version, e.g. `PHP84`.","examples":["PHP74","PHP80","PHP81","PHP82","PHP83","PHP84","PHP85"]},"distro":{"type":"string","description":"Base distribution, e.g. `rocky9`."},"cpu":{"type":"string","description":"CPU architecture: `x86_64` or `aarch64`."},"parent":{"type":["string","null"],"format":"uuid","description":"`uuid` of the master this container inherits from, `null` for a standalone container or a master."}}},"ContainerDetail":{"description":"The full definition of a container, plus where to pull it.","allOf":[{"$ref":"#/components/schemas/ContainerSummary"},{"type":"object","required":["cli","fpm","shell","timezone","extensions","locales","description","webEntryPath","image","version","reference"],"properties":{"cli":{"type":"boolean","description":"The image contains the PHP CLI."},"fpm":{"type":"boolean","description":"The image contains PHP-FPM."},"shell":{"type":"boolean","description":"The image contains a minimal shell (busybox)."},"timezone":{"type":"boolean","description":"The image contains timezone data."},"extensions":{"type":"array","items":{"type":"string"},"description":"Selected PHP extensions and components, without the ones `cli`, `fpm`, `shell` and `timezone` stand for."},"locales":{"type":"array","items":{"type":"string"},"description":"Selected locales as short codes, e.g. `de`."},"description":{"type":"string","description":"Your free-text description, may be empty."},"webEntryPath":{"type":"string","description":"Working directory of the image (OCI `WorkingDir`)."},"image":{"type":["string","null"],"description":"Image name in your registry, without a tag."},"version":{"type":["string","null"],"description":"Release tag (semantic version) of the newest build, `null` if the container was never built."},"reference":{"type":["string","null"],"description":"`image:version`, ready for `docker pull` / `podman pull`. `null` if the container was never built."}}}]},"Build":{"type":"object","description":"One build of a container.","required":["number","tag","created","architecture","layerCount","totalSize","packages","layers","cli","fpm","extensions","locales"],"properties":{"number":{"type":"integer","description":"Build number; the oldest build is 1."},"tag":{"type":"string","description":"Release tag (semantic version) of this build. Empty for very old builds that did not record it."},"created":{"type":"string","description":"Build time, `YYYY-MM-DD HH:MM:SS` (UTC)."},"architecture":{"type":"string","description":"OCI architecture of the image: `amd64` or `arm64`."},"layerCount":{"type":"integer","description":"Number of layers in the image."},"totalSize":{"type":"integer","description":"Compressed size of all layers in bytes."},"packages":{"type":"object","additionalProperties":{"type":"string"},"description":"Installed packages, name → version-release."},"layers":{"type":"array","items":{"$ref":"#/components/schemas/Layer"},"description":"The layers this build consists of."},"cli":{"type":["boolean","null"],"description":"PHP CLI was selected; `null` if not recorded."},"fpm":{"type":["boolean","null"],"description":"PHP-FPM was selected; `null` if not recorded."},"extensions":{"type":["array","null"],"items":{"type":"string"},"description":"Selected extensions and components; `null` if not recorded."},"locales":{"type":["array","null"],"items":{"type":"string"},"description":"Selected locales; `null` if not recorded."}}},"Layer":{"type":"object","description":"One image layer.","required":["name","size","digest"],"properties":{"name":{"type":"string","description":"What the layer contains, usually a package name."},"size":{"type":"integer","description":"Size in bytes."},"digest":{"type":"string","description":"Content digest, `sha256:…`."}}},"BuildDiff":{"type":"object","description":"Differences between two builds.","required":["from","to","extensions","locales","packages","layers","size"],"properties":{"from":{"type":"integer","description":"Build number compared from."},"to":{"type":"integer","description":"Build number compared to."},"extensions":{"oneOf":[{"$ref":"#/components/schemas/ListChange"},{"type":"null"}],"description":"Extensions added and removed; `null` if one of the builds did not record its selection."},"locales":{"oneOf":[{"$ref":"#/components/schemas/ListChange"},{"type":"null"}],"description":"Locales added and removed; `null` if one of the builds did not record its selection."},"packages":{"$ref":"#/components/schemas/PackageChange"},"layers":{"type":"object","description":"Layers added and removed, compared by digest.","properties":{"added":{"type":"array","items":{"$ref":"#/components/schemas/Layer"}},"removed":{"type":"array","items":{"$ref":"#/components/schemas/Layer"}}}},"size":{"type":"object","description":"Total size in bytes before and after, and the difference.","properties":{"from":{"type":"integer"},"to":{"type":"integer"},"delta":{"type":"integer"}}}}},"ListChange":{"type":"object","description":"Values added and removed.","required":["added","removed"],"properties":{"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}}}},"PackageChange":{"type":"object","description":"Packages added, removed and updated between two builds.","required":["added","removed","changed"],"properties":{"added":{"type":"array","description":"New packages with their version.","items":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}}}},"removed":{"type":"array","description":"Packages that are gone, with their last version.","items":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"}}}},"changed":{"type":"array","description":"Packages in both builds with a different version.","items":{"type":"object","properties":{"name":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"}}}}}},"WhyRequest":{"type":"object","description":"The lock file to analyse.","required":["lock"],"properties":{"lock":{"type":"object","description":"The complete content of your `composer.lock`, as JSON (not as a string)."},"no-dev":{"type":"boolean","default":false,"description":"Ignore `packages-dev` and `platform-dev`, like `composer install --no-dev`."}}},"WhyResult":{"type":"object","description":"Map of PHP extension name → where the requirement comes from (package names, or `platform` / `platform-dev`). Extensions that packages merely suggest are included.","additionalProperties":{"type":"array","items":{"type":"string"}}},"Error":{"type":"object","description":"Every error response.","required":["error"],"properties":{"error":{"type":"string","description":"What went wrong, in English."}}}}}}