{"openapi":"3.1.0","info":{"title":"Verception API","version":"1","description":"Deploy web apps, APIs, backends, and AI agents, run code in sandboxes, and call AI models. Every action of the dashboard has an operation here. Send an API key or an OAuth access token as `Authorization: Bearer <token>`. A `GET` needs the `read` scope, and every other method needs the `write` scope. Each error has the body `{ \"error\": { \"code\", \"message\" } }`."},"security":[{"bearer":[]}],"tags":[{"name":"Meta","description":"The health check and this document. They need no API key."},{"name":"User","description":"The signed-in user."},{"name":"API keys","description":"The API keys of the user."},{"name":"Projects","description":"Projects and their build settings."},{"name":"Deployments","description":"File uploads, deployments, promotes, and rollbacks."},{"name":"Git","description":"The GitHub repository of a project."},{"name":"Environment variables","description":"The encrypted environment variables of a project."},{"name":"Stores","description":"The Postgres database and the file storage of a project."},{"name":"Domains","description":"The custom domains of a project."},{"name":"Chat","description":"The chat that writes the code of a project."},{"name":"Sandboxes","description":"Isolated Linux machines for code that you do not trust."},{"name":"AI","description":"AI models in the OpenAI format."}],"paths":{"/v1":{"get":{"operationId":"get__v1","summary":"Lists the documents of the API: the docs, the OpenAPI document, the MCP server, and the OAuth metadata.","description":"Lists the documents of the API: the docs, the OpenAPI document, the MCP server, and the OAuth metadata. Needs no API key.","tags":["Projects"],"parameters":[],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","const":"Verception API"},"version":{"type":"string","const":"v1"},"docs":{"type":"string"},"openapi":{"type":"string"},"mcp":{"type":"string"},"health":{"type":"string"},"oauth":{"type":"string","description":"The OAuth 2.0 authorization server metadata (RFC 8414)."}},"required":["name","version","docs","openapi","mcp","health","oauth"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[]}},"/v1/health":{"get":{"operationId":"get_health","summary":"Reports that the API serves requests.","description":"Reports that the API serves requests. Needs no API key.","tags":["Meta"],"parameters":[],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","const":"ok"}},"required":["status"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[]}},"/v1/openapi.json":{"get":{"operationId":"get_openapi_json","summary":"Returns the OpenAPI 3.1 document of the API, for client generators.","description":"Returns the OpenAPI 3.1 document of the API, for client generators. Needs no API key.","tags":["Meta"],"parameters":[],"responses":{"2XX":{"description":"Success."},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[]}},"/v1/user":{"get":{"operationId":"get_user","summary":"Returns the current user.","description":"Returns the current user. Needs the `read` scope.","tags":["User"],"parameters":[],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"username":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","email","username","createdAt"]}},"required":["user"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]},"delete":{"operationId":"delete_user","summary":"Starts the delete of the account with all projects, deployments, domains, and API keys. Each credential stops at once, and the rest goes in the background. This cannot be undone.","description":"Starts the delete of the account with all projects, deployments, domains, and API keys. Each credential stops at once, and the rest goes in the background. This cannot be undone. Needs the `write` scope.","tags":["User"],"parameters":[],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/user/api-keys":{"get":{"operationId":"get_user_api_keys","summary":"Lists the API keys, without their secrets.","description":"Lists the API keys, without their secrets. Needs the `read` scope.","tags":["API keys"],"parameters":[],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"apiKeys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["read","write"]},"description":"What the key can do. `read` allows `GET` requests only. `write` allows every request."},"client":{"description":"The name of the OAuth app that got this key from a sign-in, or `null` for a key that the user created.","type":["string","null"]},"prefix":{"type":"string","description":"The start of the key, unique to the key, to show which key this is."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"`null` for a key that does not expire."}},"required":["id","name","scopes","client","prefix","createdAt","expiresAt"]}}},"required":["apiKeys"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]},"post":{"operationId":"post_user_api_keys","summary":"Creates an API key. The response is the only time the full key appears.","description":"Creates an API key. The response is the only time the full key appears. Needs the `write` scope.","tags":["API keys"],"parameters":[],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"apiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["read","write"]},"description":"What the key can do. `read` allows `GET` requests only. `write` allows every request."},"client":{"description":"The name of the OAuth app that got this key from a sign-in, or `null` for a key that the user created.","type":["string","null"]},"prefix":{"type":"string","description":"The start of the key, unique to the key, to show which key this is."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"`null` for a key that does not expire."}},"required":["id","name","scopes","client","prefix","createdAt","expiresAt"]},"key":{"type":"string"}},"required":["apiKey","key"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"expiresInDays":{"description":"Leave it out for a key that does not expire.","type":"integer","minimum":1,"maximum":365},"scopes":{"default":["read","write"],"description":"What the key can do. Leave it out for `[\"read\", \"write\"]`. `[\"read\"]` makes a key that can only read.","minItems":1,"type":"array","items":{"type":"string","enum":["read","write"]}}},"required":["name"]}}}}}},"/v1/user/api-keys/{id}":{"delete":{"operationId":"delete_user_api_keys_id","summary":"Revokes an API key.","description":"Revokes an API key. Needs the `write` scope.","tags":["API keys"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/projects":{"get":{"operationId":"get_projects","summary":"Lists the projects.","description":"Lists the projects. Needs the `read` scope.","tags":["Projects"],"parameters":[],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"framework":{"description":"The framework, such as `nextjs`. `null` means no framework: static files or a custom build. A new project without this field detects the framework at its first deployment.","type":["string","null"]},"buildCommand":{"description":"`null` uses the build command of the framework.","type":["string","null"]},"outputDirectory":{"description":"The folder of the build output. `null` uses the folder of the framework.","type":["string","null"]},"rootDirectory":{"description":"The folder of the app in the upload or the repository, such as `apps/web`. `null` uses the top folder.","type":["string","null"]},"id":{"type":"string"},"name":{"type":"string"},"productionDeploymentId":{"type":["string","null"]},"productionDeploymentCreatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The time that the production deployment was made. `null` when no deployment serves production. A deployment that is newer than this time can go to production with a promote."},"productionUrl":{"description":"The platform domain of the project. `null` until a production deployment is ready.","type":["string","null"]},"isRolledBack":{"type":"boolean","description":"`true` after a roll back. New production builds then do not serve production until a promote of a production deployment."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["framework","buildCommand","outputDirectory","rootDirectory","id","name","productionDeploymentId","productionDeploymentCreatedAt","productionUrl","isRolledBack","createdAt"]}}},"required":["projects"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]},"post":{"operationId":"post_projects","summary":"Creates a project.","description":"Creates a project. Needs the `write` scope.","tags":["Projects"],"parameters":[{"name":"idempotency-key","in":"header","required":false,"schema":{"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours.","type":"string","pattern":"^[\\x21-\\x7e]{1,255}$"},"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours."}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"project":{"type":"object","properties":{"framework":{"description":"The framework, such as `nextjs`. `null` means no framework: static files or a custom build. A new project without this field detects the framework at its first deployment.","type":["string","null"]},"buildCommand":{"description":"`null` uses the build command of the framework.","type":["string","null"]},"outputDirectory":{"description":"The folder of the build output. `null` uses the folder of the framework.","type":["string","null"]},"rootDirectory":{"description":"The folder of the app in the upload or the repository, such as `apps/web`. `null` uses the top folder.","type":["string","null"]},"id":{"type":"string"},"name":{"type":"string"},"productionDeploymentId":{"type":["string","null"]},"productionDeploymentCreatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The time that the production deployment was made. `null` when no deployment serves production. A deployment that is newer than this time can go to production with a promote."},"productionUrl":{"description":"The platform domain of the project. `null` until a production deployment is ready.","type":["string","null"]},"isRolledBack":{"type":"boolean","description":"`true` after a roll back. New production builds then do not serve production until a promote of a production deployment."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["framework","buildCommand","outputDirectory","rootDirectory","id","name","productionDeploymentId","productionDeploymentCreatedAt","productionUrl","isRolledBack","createdAt"]}},"required":["project"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"framework":{"description":"The framework, such as `nextjs`. `null` means no framework: static files or a custom build. A new project without this field detects the framework at its first deployment.","type":["string","null"]},"buildCommand":{"description":"`null` uses the build command of the framework.","type":["string","null"]},"outputDirectory":{"description":"The folder of the build output. `null` uses the folder of the framework.","type":["string","null"]},"rootDirectory":{"description":"The folder of the app in the upload or the repository, such as `apps/web`. `null` uses the top folder.","type":["string","null"]},"name":{"type":"string","maxLength":40,"pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},"required":["name"]}}}}}},"/v1/projects/{id}":{"get":{"operationId":"get_projects_id","summary":"Returns a project.","description":"Returns a project. Needs the `read` scope.","tags":["Projects"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"project":{"type":"object","properties":{"framework":{"description":"The framework, such as `nextjs`. `null` means no framework: static files or a custom build. A new project without this field detects the framework at its first deployment.","type":["string","null"]},"buildCommand":{"description":"`null` uses the build command of the framework.","type":["string","null"]},"outputDirectory":{"description":"The folder of the build output. `null` uses the folder of the framework.","type":["string","null"]},"rootDirectory":{"description":"The folder of the app in the upload or the repository, such as `apps/web`. `null` uses the top folder.","type":["string","null"]},"id":{"type":"string"},"name":{"type":"string"},"productionDeploymentId":{"type":["string","null"]},"productionDeploymentCreatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The time that the production deployment was made. `null` when no deployment serves production. A deployment that is newer than this time can go to production with a promote."},"productionUrl":{"description":"The platform domain of the project. `null` until a production deployment is ready.","type":["string","null"]},"isRolledBack":{"type":"boolean","description":"`true` after a roll back. New production builds then do not serve production until a promote of a production deployment."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["framework","buildCommand","outputDirectory","rootDirectory","id","name","productionDeploymentId","productionDeploymentCreatedAt","productionUrl","isRolledBack","createdAt"]}},"required":["project"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]},"patch":{"operationId":"patch_projects_id","summary":"Changes the build settings for the next deployment. `null` sets `buildCommand`, `outputDirectory`, or `rootDirectory` to automatic, and `framework` to no framework.","description":"Changes the build settings for the next deployment. `null` sets `buildCommand`, `outputDirectory`, or `rootDirectory` to automatic, and `framework` to no framework. Needs the `write` scope.","tags":["Projects"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"project":{"type":"object","properties":{"framework":{"description":"The framework, such as `nextjs`. `null` means no framework: static files or a custom build. A new project without this field detects the framework at its first deployment.","type":["string","null"]},"buildCommand":{"description":"`null` uses the build command of the framework.","type":["string","null"]},"outputDirectory":{"description":"The folder of the build output. `null` uses the folder of the framework.","type":["string","null"]},"rootDirectory":{"description":"The folder of the app in the upload or the repository, such as `apps/web`. `null` uses the top folder.","type":["string","null"]},"id":{"type":"string"},"name":{"type":"string"},"productionDeploymentId":{"type":["string","null"]},"productionDeploymentCreatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The time that the production deployment was made. `null` when no deployment serves production. A deployment that is newer than this time can go to production with a promote."},"productionUrl":{"description":"The platform domain of the project. `null` until a production deployment is ready.","type":["string","null"]},"isRolledBack":{"type":"boolean","description":"`true` after a roll back. New production builds then do not serve production until a promote of a production deployment."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["framework","buildCommand","outputDirectory","rootDirectory","id","name","productionDeploymentId","productionDeploymentCreatedAt","productionUrl","isRolledBack","createdAt"]}},"required":["project"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"framework":{"description":"The framework, such as `nextjs`. `null` means no framework: static files or a custom build. A new project without this field detects the framework at its first deployment.","type":["string","null"]},"buildCommand":{"description":"`null` uses the build command of the framework.","type":["string","null"]},"outputDirectory":{"description":"The folder of the build output. `null` uses the folder of the framework.","type":["string","null"]},"rootDirectory":{"description":"The folder of the app in the upload or the repository, such as `apps/web`. `null` uses the top folder.","type":["string","null"]}}}}}}},"delete":{"operationId":"delete_projects_id","summary":"Starts the delete of the project with its deployments, env vars, stores, and domains. The project leaves the API at once, and its URLs stop when the background delete ends.","description":"Starts the delete of the project with its deployments, env vars, stores, and domains. The project leaves the API at once, and its URLs stop when the background delete ends. Needs the `write` scope.","tags":["Projects"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/files":{"post":{"operationId":"post_files","summary":"Uploads the raw bytes of one file for a deployment manifest.","description":"Uploads the raw bytes of one file for a deployment manifest. Needs the `write` scope.","tags":["Deployments"],"parameters":[{"name":"x-sha","in":"header","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{40}$","description":"The SHA-1 of the bytes of the file."},"description":"The SHA-1 of the bytes of the file."}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sha":{"type":"string","pattern":"^[0-9a-f]{40}$"}},"required":["sha"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}}},"/v1/deployments":{"post":{"operationId":"post_deployments","summary":"Creates a deployment from a file manifest, or builds the files of an earlier deployment again with `fromDeploymentId`.","description":"Creates a deployment from a file manifest, or builds the files of an earlier deployment again with `fromDeploymentId`. Needs the `write` scope.","tags":["Deployments"],"parameters":[{"name":"idempotency-key","in":"header","required":false,"schema":{"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours.","type":"string","pattern":"^[\\x21-\\x7e]{1,255}$"},"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours."}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deployment":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"target":{"type":"string","enum":["preview","production"]},"readyState":{"type":"string","enum":["QUEUED","BUILDING","READY","ERROR","CANCELED"]},"url":{"type":"string","description":"The URL that serves this deployment, and no other."},"errorMessage":{"description":"Why the build failed, or `null`.","type":["string","null"]},"source":{"type":"string","enum":["upload","git","chat"],"description":"What made the deployment: an upload, a Git commit, or the project chat."},"git":{"anyOf":[{"type":"object","properties":{"sha":{"type":"string","pattern":"^[0-9a-f]{40}$","description":"The full SHA-1 of the commit."},"ref":{"type":"string","description":"The branch of the commit, such as `main`."},"message":{"type":"string","description":"The first line of the commit message, or the title of the pull request, at most 200 characters."},"pullRequest":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The pull request number of a preview, or `null` for a push."}},"required":["sha","ref","message","pullRequest"]},{"type":"null"}],"description":"The commit of a Git deployment, or `null` for an upload or a chat."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","target","readyState","url","errorMessage","source","git","createdAt"]}},"required":["deployment"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"projectId":{"type":"string","minLength":1},"target":{"type":"string","enum":["preview","production"]},"files":{"description":"The manifest of the new code. Send `files` or `fromDeploymentId`, not both.","minItems":1,"maxItems":5000,"type":"array","items":{"type":"object","properties":{"file":{"type":"string","minLength":1,"description":"The path of the file in the deployment, such as `src/app.ts`."},"sha":{"type":"string","pattern":"^[0-9a-f]{40}$","description":"The SHA-1 of the bytes of the file. A file that the API does not have yet goes to `POST /v1/files` first."},"size":{"type":"integer","minimum":0,"maximum":4194304,"description":"The size in bytes, at most 4 MB."}},"required":["file","sha","size"]}},"fromDeploymentId":{"description":"A deployment of the project whose files build again, for example after an env var change. Send `files` or `fromDeploymentId`, not both.","type":"string","minLength":1}},"required":["projectId","target"]}}}}},"get":{"operationId":"get_deployments","summary":"Lists the newest 50 deployments of one project.","description":"Lists the newest 50 deployments of one project. Needs the `read` scope.","tags":["Deployments"],"parameters":[{"name":"projectId","in":"query","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deployments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"target":{"type":"string","enum":["preview","production"]},"readyState":{"type":"string","enum":["QUEUED","BUILDING","READY","ERROR","CANCELED"]},"url":{"type":"string","description":"The URL that serves this deployment, and no other."},"errorMessage":{"description":"Why the build failed, or `null`.","type":["string","null"]},"source":{"type":"string","enum":["upload","git","chat"],"description":"What made the deployment: an upload, a Git commit, or the project chat."},"git":{"anyOf":[{"type":"object","properties":{"sha":{"type":"string","pattern":"^[0-9a-f]{40}$","description":"The full SHA-1 of the commit."},"ref":{"type":"string","description":"The branch of the commit, such as `main`."},"message":{"type":"string","description":"The first line of the commit message, or the title of the pull request, at most 200 characters."},"pullRequest":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The pull request number of a preview, or `null` for a push."}},"required":["sha","ref","message","pullRequest"]},{"type":"null"}],"description":"The commit of a Git deployment, or `null` for an upload or a chat."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","target","readyState","url","errorMessage","source","git","createdAt"]}}},"required":["deployments"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]}},"/v1/deployments/{id}":{"get":{"operationId":"get_deployments_id","summary":"Returns a deployment. Poll it until `readyState` is `READY`, `ERROR`, or `CANCELED`.","description":"Returns a deployment. Poll it until `readyState` is `READY`, `ERROR`, or `CANCELED`. Needs the `read` scope.","tags":["Deployments"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deployment":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"target":{"type":"string","enum":["preview","production"]},"readyState":{"type":"string","enum":["QUEUED","BUILDING","READY","ERROR","CANCELED"]},"url":{"type":"string","description":"The URL that serves this deployment, and no other."},"errorMessage":{"description":"Why the build failed, or `null`.","type":["string","null"]},"source":{"type":"string","enum":["upload","git","chat"],"description":"What made the deployment: an upload, a Git commit, or the project chat."},"git":{"anyOf":[{"type":"object","properties":{"sha":{"type":"string","pattern":"^[0-9a-f]{40}$","description":"The full SHA-1 of the commit."},"ref":{"type":"string","description":"The branch of the commit, such as `main`."},"message":{"type":"string","description":"The first line of the commit message, or the title of the pull request, at most 200 characters."},"pullRequest":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The pull request number of a preview, or `null` for a push."}},"required":["sha","ref","message","pullRequest"]},{"type":"null"}],"description":"The commit of a Git deployment, or `null` for an upload or a chat."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","target","readyState","url","errorMessage","source","git","createdAt"]}},"required":["deployment"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]}},"/v1/deployments/{id}/events":{"get":{"operationId":"get_deployments_id_events","summary":"Returns the build output. `since`, an ISO 8601 time, returns only newer lines.","description":"Returns the build output. `since`, an ISO 8601 time, returns only newer lines. Needs the `read` scope.","tags":["Deployments"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"since","in":"query","required":false,"schema":{"description":"An ISO 8601 time. Only the lines after it return. Send the `createdAt` of the last line that you have.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"description":"An ISO 8601 time. Only the lines after it return. Send the `createdAt` of the last line that you have."}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"level":{"type":"string","enum":["info","error"]},"text":{"type":"string"}},"required":["createdAt","level","text"]}}},"required":["events"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]}},"/v1/projects/{id}/promote/{deploymentId}":{"post":{"operationId":"post_projects_id_promote_deploymentId","summary":"Makes a `READY` deployment serve production.","description":"Makes a `READY` deployment serve production. Needs the `write` scope.","tags":["Deployments"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"idempotency-key","in":"header","required":false,"schema":{"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours.","type":"string","pattern":"^[\\x21-\\x7e]{1,255}$"},"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours."}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"project":{"type":"object","properties":{"framework":{"description":"The framework, such as `nextjs`. `null` means no framework: static files or a custom build. A new project without this field detects the framework at its first deployment.","type":["string","null"]},"buildCommand":{"description":"`null` uses the build command of the framework.","type":["string","null"]},"outputDirectory":{"description":"The folder of the build output. `null` uses the folder of the framework.","type":["string","null"]},"rootDirectory":{"description":"The folder of the app in the upload or the repository, such as `apps/web`. `null` uses the top folder.","type":["string","null"]},"id":{"type":"string"},"name":{"type":"string"},"productionDeploymentId":{"type":["string","null"]},"productionDeploymentCreatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The time that the production deployment was made. `null` when no deployment serves production. A deployment that is newer than this time can go to production with a promote."},"productionUrl":{"description":"The platform domain of the project. `null` until a production deployment is ready.","type":["string","null"]},"isRolledBack":{"type":"boolean","description":"`true` after a roll back. New production builds then do not serve production until a promote of a production deployment."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["framework","buildCommand","outputDirectory","rootDirectory","id","name","productionDeploymentId","productionDeploymentCreatedAt","productionUrl","isRolledBack","createdAt"]},"deployment":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"target":{"type":"string","enum":["preview","production"]},"readyState":{"type":"string","enum":["QUEUED","BUILDING","READY","ERROR","CANCELED"]},"url":{"type":"string","description":"The URL that serves this deployment, and no other."},"errorMessage":{"description":"Why the build failed, or `null`.","type":["string","null"]},"source":{"type":"string","enum":["upload","git","chat"],"description":"What made the deployment: an upload, a Git commit, or the project chat."},"git":{"anyOf":[{"type":"object","properties":{"sha":{"type":"string","pattern":"^[0-9a-f]{40}$","description":"The full SHA-1 of the commit."},"ref":{"type":"string","description":"The branch of the commit, such as `main`."},"message":{"type":"string","description":"The first line of the commit message, or the title of the pull request, at most 200 characters."},"pullRequest":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The pull request number of a preview, or `null` for a push."}},"required":["sha","ref","message","pullRequest"]},{"type":"null"}],"description":"The commit of a Git deployment, or `null` for an upload or a chat."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","target","readyState","url","errorMessage","source","git","createdAt"]}},"required":["project"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/projects/{id}/rollback/{deploymentId}":{"post":{"operationId":"post_projects_id_rollback_deploymentId","summary":"Makes an earlier production deployment serve production again, with no build.","description":"Makes an earlier production deployment serve production again, with no build. Needs the `write` scope.","tags":["Deployments"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"deploymentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"project":{"type":"object","properties":{"framework":{"description":"The framework, such as `nextjs`. `null` means no framework: static files or a custom build. A new project without this field detects the framework at its first deployment.","type":["string","null"]},"buildCommand":{"description":"`null` uses the build command of the framework.","type":["string","null"]},"outputDirectory":{"description":"The folder of the build output. `null` uses the folder of the framework.","type":["string","null"]},"rootDirectory":{"description":"The folder of the app in the upload or the repository, such as `apps/web`. `null` uses the top folder.","type":["string","null"]},"id":{"type":"string"},"name":{"type":"string"},"productionDeploymentId":{"type":["string","null"]},"productionDeploymentCreatedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"The time that the production deployment was made. `null` when no deployment serves production. A deployment that is newer than this time can go to production with a promote."},"productionUrl":{"description":"The platform domain of the project. `null` until a production deployment is ready.","type":["string","null"]},"isRolledBack":{"type":"boolean","description":"`true` after a roll back. New production builds then do not serve production until a promote of a production deployment."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["framework","buildCommand","outputDirectory","rootDirectory","id","name","productionDeploymentId","productionDeploymentCreatedAt","productionUrl","isRolledBack","createdAt"]}},"required":["project"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/projects/{id}/git":{"get":{"operationId":"get_projects_id_git","summary":"Returns the connected repository, or `null`.","description":"Returns the connected repository, or `null`. Needs the `read` scope.","tags":["Git"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"git":{"type":"object","properties":{"repository":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","const":"github"},"fullName":{"type":"string","description":"`owner/name`, such as `alice/blog`."},"productionBranch":{"type":"string","description":"The default branch. A push to it deploys to production."},"private":{"type":"boolean"},"url":{"type":"string","format":"uri"}},"required":["provider","fullName","productionBranch","private","url"]},{"type":"null"}]},"isLinked":{"type":"boolean","description":"`true` when the project has a repository. `repository` is then `null` only when the app cannot read the repository, for example after the owner deleted it. Disconnect it to connect another one."},"isAccountConnected":{"type":"boolean","description":"`true` when Verception holds a GitHub token of the user, from the GitHub sign-in. It turns `false` when the token stops and cannot be refreshed. The user then connects GitHub again."},"connectUrl":{"type":"string","description":"A dashboard path that starts the GitHub sign-in, and comes back to the Git settings of the project."}},"required":["repository","isLinked","isAccountConnected","connectUrl"]}},"required":["git"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]},"put":{"operationId":"put_projects_id_git","summary":"Connects a repository, then deploys the head of its default branch to production.","description":"Connects a repository, then deploys the head of its default branch to production. Needs the `write` scope.","tags":["Git"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"git":{"type":"object","properties":{"repository":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string","const":"github"},"fullName":{"type":"string","description":"`owner/name`, such as `alice/blog`."},"productionBranch":{"type":"string","description":"The default branch. A push to it deploys to production."},"private":{"type":"boolean"},"url":{"type":"string","format":"uri"}},"required":["provider","fullName","productionBranch","private","url"]},{"type":"null"}]},"isLinked":{"type":"boolean","description":"`true` when the project has a repository. `repository` is then `null` only when the app cannot read the repository, for example after the owner deleted it. Disconnect it to connect another one."},"isAccountConnected":{"type":"boolean","description":"`true` when Verception holds a GitHub token of the user, from the GitHub sign-in. It turns `false` when the token stops and cannot be refreshed. The user then connects GitHub again."},"connectUrl":{"type":"string","description":"A dashboard path that starts the GitHub sign-in, and comes back to the Git settings of the project."}},"required":["repository","isLinked","isAccountConnected","connectUrl"]},"deployment":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"target":{"type":"string","enum":["preview","production"]},"readyState":{"type":"string","enum":["QUEUED","BUILDING","READY","ERROR","CANCELED"]},"url":{"type":"string","description":"The URL that serves this deployment, and no other."},"errorMessage":{"description":"Why the build failed, or `null`.","type":["string","null"]},"source":{"type":"string","enum":["upload","git","chat"],"description":"What made the deployment: an upload, a Git commit, or the project chat."},"git":{"anyOf":[{"type":"object","properties":{"sha":{"type":"string","pattern":"^[0-9a-f]{40}$","description":"The full SHA-1 of the commit."},"ref":{"type":"string","description":"The branch of the commit, such as `main`."},"message":{"type":"string","description":"The first line of the commit message, or the title of the pull request, at most 200 characters."},"pullRequest":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The pull request number of a preview, or `null` for a push."}},"required":["sha","ref","message","pullRequest"]},{"type":"null"}],"description":"The commit of a Git deployment, or `null` for an upload or a chat."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","target","readyState","url","errorMessage","source","git","createdAt"]}},"required":["git","deployment"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"repository":{"type":"string","pattern":"^[A-Za-z0-9-]+\\/[A-Za-z0-9._-]+$","description":"`owner/name`, such as `alice/blog`."}},"required":["repository"]}}}}},"delete":{"operationId":"delete_projects_id_git","summary":"Disconnects the repository. Old deployments stay.","description":"Disconnects the repository. Old deployments stay. Needs the `write` scope.","tags":["Git"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/projects/{id}/git/deploy":{"post":{"operationId":"post_projects_id_git_deploy","summary":"Deploys the head of the default branch to production again.","description":"Deploys the head of the default branch to production again. Needs the `write` scope.","tags":["Git"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"idempotency-key","in":"header","required":false,"schema":{"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours.","type":"string","pattern":"^[\\x21-\\x7e]{1,255}$"},"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours."}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deployment":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"target":{"type":"string","enum":["preview","production"]},"readyState":{"type":"string","enum":["QUEUED","BUILDING","READY","ERROR","CANCELED"]},"url":{"type":"string","description":"The URL that serves this deployment, and no other."},"errorMessage":{"description":"Why the build failed, or `null`.","type":["string","null"]},"source":{"type":"string","enum":["upload","git","chat"],"description":"What made the deployment: an upload, a Git commit, or the project chat."},"git":{"anyOf":[{"type":"object","properties":{"sha":{"type":"string","pattern":"^[0-9a-f]{40}$","description":"The full SHA-1 of the commit."},"ref":{"type":"string","description":"The branch of the commit, such as `main`."},"message":{"type":"string","description":"The first line of the commit message, or the title of the pull request, at most 200 characters."},"pullRequest":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The pull request number of a preview, or `null` for a push."}},"required":["sha","ref","message","pullRequest"]},{"type":"null"}],"description":"The commit of a Git deployment, or `null` for an upload or a chat."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","target","readyState","url","errorMessage","source","git","createdAt"]}},"required":["deployment"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/user/github":{"delete":{"operationId":"delete_user_github","summary":"Disconnects the GitHub account of the user.","description":"Disconnects the GitHub account of the user. Needs the `write` scope.","tags":["Git"],"parameters":[],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/user/github/repositories":{"get":{"operationId":"get_user_github_repositories","summary":"Lists the repositories that the GitHub account can read.","description":"Lists the repositories that the GitHub account can read. Needs the `read` scope.","tags":["Git"],"parameters":[],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"repositories":{"type":"array","items":{"type":"object","properties":{"fullName":{"type":"string","description":"`owner/name`, such as `alice/blog`. Send it to `PUT /v1/projects/:id/git`."},"private":{"type":"boolean"},"defaultBranch":{"type":"string"},"canConnect":{"type":"boolean","description":"`true` when the GitHub account can write to the repository. Only these repositories connect."},"usedBy":{"description":"The name of the project of the user that deploys from this repository, or `null`. A second project on the same repository builds each push again.","type":["string","null"]}},"required":["fullName","private","defaultBranch","canConnect","usedBy"]}}},"required":["repositories"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]}},"/v1/projects/{id}/env":{"get":{"operationId":"get_projects_id_env","summary":"Lists the env vars. Values are write-only and never return.","description":"Lists the env vars. Values are write-only and never return. Needs the `read` scope.","tags":["Environment variables"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"envs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"target":{"type":"array","items":{"type":"string","enum":["preview","production"]}},"storeId":{"description":"The store that writes this env var, or `null` for an env var of the user. An env var of a store cannot change.","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","key","target","storeId","createdAt","updatedAt"]}}},"required":["envs"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]},"post":{"operationId":"post_projects_id_env","summary":"Adds 1 to 100 env vars, all or none. They apply to the next deployment.","description":"Adds 1 to 100 env vars, all or none. They apply to the next deployment. Needs the `write` scope.","tags":["Environment variables"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"idempotency-key","in":"header","required":false,"schema":{"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours.","type":"string","pattern":"^[\\x21-\\x7e]{1,255}$"},"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours."}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"envs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"target":{"type":"array","items":{"type":"string","enum":["preview","production"]}},"storeId":{"description":"The store that writes this env var, or `null` for an env var of the user. An env var of a store cannot change.","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","key","target","storeId","createdAt","updatedAt"]}}},"required":["envs"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"envs":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Z_][A-Z0-9_]*$"},"value":{"type":"string","minLength":1},"target":{"minItems":1,"type":"array","items":{"type":"string","enum":["preview","production"]}}},"required":["key","value","target"]}}},"required":["envs"]}}}}}},"/v1/projects/{id}/env/{envId}":{"patch":{"operationId":"patch_projects_id_env_envId","summary":"Changes the value, the targets, or both, of an env var.","description":"Changes the value, the targets, or both, of an env var. Needs the `write` scope.","tags":["Environment variables"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"envId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"env":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"target":{"type":"array","items":{"type":"string","enum":["preview","production"]}},"storeId":{"description":"The store that writes this env var, or `null` for an env var of the user. An env var of a store cannot change.","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","key","target","storeId","createdAt","updatedAt"]}},"required":["env"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"value":{"type":"string","minLength":1},"target":{"minItems":1,"type":"array","items":{"type":"string","enum":["preview","production"]}}}}}}}},"delete":{"operationId":"delete_projects_id_env_envId","summary":"Deletes an env var.","description":"Deletes an env var. Needs the `write` scope.","tags":["Environment variables"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"envId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/projects/{id}/stores":{"get":{"operationId":"get_projects_id_stores","summary":"Lists the stores of a project.","description":"Lists the stores of a project. Needs the `read` scope.","tags":["Stores"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stores":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["postgres","blob"]},"status":{"type":"string","enum":["creating","ready","error","suspended"]},"envKeys":{"type":"array","items":{"type":"string"},"description":"The names of the env vars that the store writes. The values never show."},"usage":{"anyOf":[{"type":"object","properties":{"bytes":{"type":"number"},"files":{"type":"number"}},"required":["bytes","files"]},{"type":"null"}],"description":"The size and the file count of file storage. `null` for Postgres."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","type","status","envKeys","usage","createdAt"]}}},"required":["stores"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]},"post":{"operationId":"post_projects_id_stores","summary":"Adds a Postgres database or file storage. Its env vars apply to the next deployment.","description":"Adds a Postgres database or file storage. Its env vars apply to the next deployment. Needs the `write` scope.","tags":["Stores"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"idempotency-key","in":"header","required":false,"schema":{"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours.","type":"string","pattern":"^[\\x21-\\x7e]{1,255}$"},"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours."}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"store":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["postgres","blob"]},"status":{"type":"string","enum":["creating","ready","error","suspended"]},"envKeys":{"type":"array","items":{"type":"string"},"description":"The names of the env vars that the store writes. The values never show."},"usage":{"anyOf":[{"type":"object","properties":{"bytes":{"type":"number"},"files":{"type":"number"}},"required":["bytes","files"]},{"type":"null"}],"description":"The size and the file count of file storage. `null` for Postgres."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","type","status","envKeys","usage","createdAt"]}},"required":["store"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"type":{"type":"string","enum":["postgres","blob"]}},"required":["type"]}}}}}},"/v1/projects/{id}/stores/{storeId}":{"get":{"operationId":"get_projects_id_stores_storeId","summary":"Returns the live status and usage of a store.","description":"Returns the live status and usage of a store. Needs the `read` scope.","tags":["Stores"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"storeId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"store":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["postgres","blob"]},"status":{"type":"string","enum":["creating","ready","error","suspended"]},"envKeys":{"type":"array","items":{"type":"string"},"description":"The names of the env vars that the store writes. The values never show."},"usage":{"anyOf":[{"type":"object","properties":{"bytes":{"type":"number"},"files":{"type":"number"}},"required":["bytes","files"]},{"type":"null"}],"description":"The size and the file count of file storage. `null` for Postgres."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","type","status","envKeys","usage","createdAt"]}},"required":["store"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]},"delete":{"operationId":"delete_projects_id_stores_storeId","summary":"Deletes a store, all of its data, and its env vars.","description":"Deletes a store, all of its data, and its env vars. Needs the `write` scope.","tags":["Stores"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"storeId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/projects/{id}/domains":{"get":{"operationId":"get_projects_id_domains","summary":"Lists the domains of a project.","description":"Lists the domains of a project. Needs the `read` scope.","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"domains":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["platform","custom"],"description":"`platform` for the domain that comes with the project, `custom` for a domain that the user added."},"status":{"type":"string","enum":["waiting_for_dns","live"]},"records":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CNAME","TXT"]},"name":{"type":"string"},"value":{"type":"string"}},"required":["type","name","value"]},"description":"The DNS records that the user must still create. Empty for a platform domain."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","type","status","records","createdAt"]}}},"required":["domains"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]},"post":{"operationId":"post_projects_id_domains","summary":"Adds a custom domain. The response has the DNS records that the user must create.","description":"Adds a custom domain. The response has the DNS records that the user must create. Needs the `write` scope.","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"idempotency-key","in":"header","required":false,"schema":{"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours.","type":"string","pattern":"^[\\x21-\\x7e]{1,255}$"},"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours."}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"domain":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["platform","custom"],"description":"`platform` for the domain that comes with the project, `custom` for a domain that the user added."},"status":{"type":"string","enum":["waiting_for_dns","live"]},"records":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CNAME","TXT"]},"name":{"type":"string"},"value":{"type":"string"}},"required":["type","name","value"]},"description":"The DNS records that the user must still create. Empty for a platform domain."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","type","status","records","createdAt"]}},"required":["domain"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"description":"A subdomain such as `www.example.com`. A URL keeps only its host.","type":"string"}},"required":["name"]}}}}}},"/v1/projects/{id}/domains/{domain}":{"get":{"operationId":"get_projects_id_domains_domain","summary":"Returns the DNS state of a domain and the missing records.","description":"Returns the DNS state of a domain and the missing records. Needs the `read` scope.","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"domain":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["platform","custom"],"description":"`platform` for the domain that comes with the project, `custom` for a domain that the user added."},"status":{"type":"string","enum":["waiting_for_dns","live"]},"records":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CNAME","TXT"]},"name":{"type":"string"},"value":{"type":"string"}},"required":["type","name","value"]},"description":"The DNS records that the user must still create. Empty for a platform domain."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","type","status","records","createdAt"]}},"required":["domain"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]},"delete":{"operationId":"delete_projects_id_domains_domain","summary":"Removes a custom domain.","description":"Removes a custom domain. Needs the `write` scope.","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/projects/{id}/domains/{domain}/verify":{"post":{"operationId":"post_projects_id_domains_domain_verify","summary":"Verifies a custom domain, then returns its state.","description":"Verifies a custom domain, then returns its state. Needs the `write` scope.","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"domain","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"domain":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["platform","custom"],"description":"`platform` for the domain that comes with the project, `custom` for a domain that the user added."},"status":{"type":"string","enum":["waiting_for_dns","live"]},"records":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["CNAME","TXT"]},"name":{"type":"string"},"value":{"type":"string"}},"required":["type","name","value"]},"description":"The DNS records that the user must still create. Empty for a platform domain."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["name","type","status","records","createdAt"]}},"required":["domain"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/projects/{id}/chat":{"get":{"operationId":"get_projects_id_chat","summary":"Returns the project chat as stored, or `null`.","description":"Returns the project chat as stored, or `null`. Needs the `read` scope.","tags":["Chat"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"chat":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string","description":"Markdown for an assistant message."},"status":{"type":"string","enum":["generating","ready","failed"],"description":"`failed` when the code generation failed or stopped. `content` then says why."},"steps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["thinking","read","edit","search","command","action"]},"text":{"type":"string"},"isDone":{"type":"boolean"}},"required":["kind","text","isDone"]},"description":"What the model did. The list grows while it works."},"isDeploying":{"type":"boolean","description":"`true` while the files of the reply upload."},"deployment":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"target":{"type":"string","enum":["preview","production"]},"readyState":{"type":"string","enum":["QUEUED","BUILDING","READY","ERROR","CANCELED"]},"url":{"type":"string"}},"required":["id","target","readyState","url"]},{"type":"null"}],"description":"The deployment of the code of the reply, or `null` when it does not exist."},"deployError":{"description":"Why the deployment failed, or `null`.","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","role","content","status","steps","isDeploying","deployment","deployError","createdAt","finishedAt"]}},"fileCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The number of files in the latest generated code."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","messages","fileCount","createdAt"]},{"type":"null"}]}},"required":["chat"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]}},"/v1/projects/{id}/chat/refresh":{"post":{"operationId":"post_projects_id_chat_refresh","summary":"Checks the code generator. A ready reply deploys its code as a preview. Send it while you poll.","description":"Checks the code generator. A ready reply deploys its code as a preview. Send it while you poll. Needs the `write` scope.","tags":["Chat"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"chat":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string","description":"Markdown for an assistant message."},"status":{"type":"string","enum":["generating","ready","failed"],"description":"`failed` when the code generation failed or stopped. `content` then says why."},"steps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["thinking","read","edit","search","command","action"]},"text":{"type":"string"},"isDone":{"type":"boolean"}},"required":["kind","text","isDone"]},"description":"What the model did. The list grows while it works."},"isDeploying":{"type":"boolean","description":"`true` while the files of the reply upload."},"deployment":{"anyOf":[{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"target":{"type":"string","enum":["preview","production"]},"readyState":{"type":"string","enum":["QUEUED","BUILDING","READY","ERROR","CANCELED"]},"url":{"type":"string"}},"required":["id","target","readyState","url"]},{"type":"object","properties":{"id":{"type":"string"},"unchanged":{"type":"boolean","const":true}},"required":["id","unchanged"]}]},{"type":"null"}]},"deployError":{"description":"Why the deployment failed, or `null`.","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","role","content","status","steps","isDeploying","deployment","deployError","createdAt","finishedAt"]}},"fileCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The number of files in the latest generated code."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","messages","fileCount","createdAt"]},{"type":"null"}]}},"required":["chat"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"finished":{"default":[],"description":"The IDs of the deployments that you already have as `READY`, `ERROR`, or `CANCELED`. The refresh does not read them again, and returns `{ id, unchanged: true }` for each one.","maxItems":500,"type":"array","items":{"type":"string"}}}}}}}}},"/v1/projects/{id}/chat/messages":{"post":{"operationId":"post_projects_id_chat_messages","summary":"Sends a message to the project chat, which writes code and deploys it as a preview.","description":"Sends a message to the project chat, which writes code and deploys it as a preview. Needs the `write` scope.","tags":["Chat"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"idempotency-key","in":"header","required":false,"schema":{"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours.","type":"string","pattern":"^[\\x21-\\x7e]{1,255}$"},"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours."}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"chat":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["user","assistant"]},"content":{"type":"string","description":"Markdown for an assistant message."},"status":{"type":"string","enum":["generating","ready","failed"],"description":"`failed` when the code generation failed or stopped. `content` then says why."},"steps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["thinking","read","edit","search","command","action"]},"text":{"type":"string"},"isDone":{"type":"boolean"}},"required":["kind","text","isDone"]},"description":"What the model did. The list grows while it works."},"isDeploying":{"type":"boolean","description":"`true` while the files of the reply upload."},"deployment":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"target":{"type":"string","enum":["preview","production"]},"readyState":{"type":"string","enum":["QUEUED","BUILDING","READY","ERROR","CANCELED"]},"url":{"type":"string"}},"required":["id","target","readyState","url"]},{"type":"null"}],"description":"The deployment of the code of the reply, or `null` when it does not exist."},"deployError":{"description":"Why the deployment failed, or `null`.","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","role","content","status","steps","isDeploying","deployment","deployError","createdAt","finishedAt"]}},"fileCount":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The number of files in the latest generated code."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","messages","fileCount","createdAt"]}},"required":["chat"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":4000}},"required":["message"]}}}}}},"/v1/projects/{id}/chat/files":{"get":{"operationId":"get_projects_id_chat_files","summary":"Returns the files of the latest generated code.","description":"Returns the files of the latest generated code. Needs the `read` scope.","tags":["Chat"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"content":{"description":"`null` for a binary file.","type":["string","null"]},"size":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["path","content","size"]}}},"required":["files"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]}},"/v1/projects/{id}/chat/deploy":{"post":{"operationId":"post_projects_id_chat_deploy","summary":"Deploys the latest generated code again, for example to production.","description":"Deploys the latest generated code again, for example to production. Needs the `write` scope.","tags":["Chat"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"idempotency-key","in":"header","required":false,"schema":{"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours.","type":"string","pattern":"^[\\x21-\\x7e]{1,255}$"},"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours."}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deployment":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"target":{"type":"string","enum":["preview","production"]},"readyState":{"type":"string","enum":["QUEUED","BUILDING","READY","ERROR","CANCELED"]},"url":{"type":"string","description":"The URL that serves this deployment, and no other."},"errorMessage":{"description":"Why the build failed, or `null`.","type":["string","null"]},"source":{"type":"string","enum":["upload","git","chat"],"description":"What made the deployment: an upload, a Git commit, or the project chat."},"git":{"anyOf":[{"type":"object","properties":{"sha":{"type":"string","pattern":"^[0-9a-f]{40}$","description":"The full SHA-1 of the commit."},"ref":{"type":"string","description":"The branch of the commit, such as `main`."},"message":{"type":"string","description":"The first line of the commit message, or the title of the pull request, at most 200 characters."},"pullRequest":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The pull request number of a preview, or `null` for a push."}},"required":["sha","ref","message","pullRequest"]},{"type":"null"}],"description":"The commit of a Git deployment, or `null` for an upload or a chat."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","target","readyState","url","errorMessage","source","git","createdAt"]}},"required":["deployment"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"target":{"type":"string","enum":["preview","production"]}},"required":["target"]}}}}}},"/v1/sandboxes":{"get":{"operationId":"get_sandboxes","summary":"Lists the sandboxes.","description":"Lists the sandboxes. Needs the `read` scope.","tags":["Sandboxes"],"parameters":[],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sandboxes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["running","stopping","stopped"]},"runtime":{"type":"string","enum":["node24","node22","python3.13","universal"]},"ports":{"type":"array","items":{"type":"object","properties":{"port":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["port","url"]}},"timeoutMinutes":{"type":"number","description":"A running sandbox stops by itself after this time."},"stopsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the running sandbox stops by itself. `null` when it is stopped."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","status","runtime","ports","timeoutMinutes","stopsAt","createdAt"]}}},"required":["sandboxes"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]},"post":{"operationId":"post_sandboxes","summary":"Creates a sandbox and starts it. An empty body works.","description":"Creates a sandbox and starts it. An empty body works. Needs the `write` scope.","tags":["Sandboxes"],"parameters":[{"name":"idempotency-key","in":"header","required":false,"schema":{"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours.","type":"string","pattern":"^[\\x21-\\x7e]{1,255}$"},"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours."}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sandbox":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["running","stopping","stopped"]},"runtime":{"type":"string","enum":["node24","node22","python3.13","universal"]},"ports":{"type":"array","items":{"type":"object","properties":{"port":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["port","url"]}},"timeoutMinutes":{"type":"number","description":"A running sandbox stops by itself after this time."},"stopsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the running sandbox stops by itself. `null` when it is stopped."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","status","runtime","ports","timeoutMinutes","stopsAt","createdAt"]}},"required":["sandbox"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"runtime":{"default":"node24","type":"string","enum":["node24","node22","python3.13","universal"]},"ports":{"default":[],"description":"The ports that get a public HTTPS URL. Anyone with the URL can reach the port.","maxItems":4,"type":"array","items":{"type":"integer","minimum":1024,"maximum":65535}},"timeoutMinutes":{"default":5,"description":"A running sandbox stops by itself after this time.","type":"integer","minimum":1,"maximum":60},"env":{"default":{},"description":"Env vars that each command gets. They never return.","type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"additionalProperties":{"type":"string","maxLength":65536}}}}}}}}},"/v1/sandboxes/{id}":{"get":{"operationId":"get_sandboxes_id","summary":"Returns a sandbox. It does not start a stopped sandbox.","description":"Returns a sandbox. It does not start a stopped sandbox. Needs the `read` scope.","tags":["Sandboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sandbox":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["running","stopping","stopped"]},"runtime":{"type":"string","enum":["node24","node22","python3.13","universal"]},"ports":{"type":"array","items":{"type":"object","properties":{"port":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["port","url"]}},"timeoutMinutes":{"type":"number","description":"A running sandbox stops by itself after this time."},"stopsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the running sandbox stops by itself. `null` when it is stopped."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","status","runtime","ports","timeoutMinutes","stopsAt","createdAt"]}},"required":["sandbox"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]},"delete":{"operationId":"delete_sandboxes_id","summary":"Deletes a sandbox, its files, and its commands.","description":"Deletes a sandbox, its files, and its commands. Needs the `write` scope.","tags":["Sandboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/sandboxes/{id}/stop":{"post":{"operationId":"post_sandboxes_id_stop","summary":"Stops a sandbox. Its files stay.","description":"Stops a sandbox. Its files stay. Needs the `write` scope.","tags":["Sandboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sandbox":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["running","stopping","stopped"]},"runtime":{"type":"string","enum":["node24","node22","python3.13","universal"]},"ports":{"type":"array","items":{"type":"object","properties":{"port":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["port","url"]}},"timeoutMinutes":{"type":"number","description":"A running sandbox stops by itself after this time."},"stopsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the running sandbox stops by itself. `null` when it is stopped."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","status","runtime","ports","timeoutMinutes","stopsAt","createdAt"]}},"required":["sandbox"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/sandboxes/{id}/start":{"post":{"operationId":"post_sandboxes_id_start","summary":"Starts a stopped sandbox with its files.","description":"Starts a stopped sandbox with its files. Needs the `write` scope.","tags":["Sandboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sandbox":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["running","stopping","stopped"]},"runtime":{"type":"string","enum":["node24","node22","python3.13","universal"]},"ports":{"type":"array","items":{"type":"object","properties":{"port":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["port","url"]}},"timeoutMinutes":{"type":"number","description":"A running sandbox stops by itself after this time."},"stopsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the running sandbox stops by itself. `null` when it is stopped."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","status","runtime","ports","timeoutMinutes","stopsAt","createdAt"]}},"required":["sandbox"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/sandboxes/{id}/commands":{"post":{"operationId":"post_sandboxes_id_commands","summary":"Runs a command in `bash` and waits for its exit code and output, or starts it in the background.","description":"Runs a command in `bash` and waits for its exit code and output, or starts it in the background. Needs the `write` scope.","tags":["Sandboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"idempotency-key","in":"header","required":false,"schema":{"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours.","type":"string","pattern":"^[\\x21-\\x7e]{1,255}$"},"description":"A unique value for each operation, such as a UUID. Send the same value again when a retry must not do the operation two times. The API keeps a success response for 24 hours."}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"command":{"type":"object","properties":{"id":{"type":"string"},"sandboxId":{"type":"string"},"command":{"type":"string"},"status":{"type":"string","enum":["running","finished"]},"exitCode":{"description":"`null` until the command is finished.","type":["number","null"]},"stdout":{"description":"The last 1 MB of stdout. `null` until the command is finished.","type":["string","null"]},"stderr":{"description":"The last 1 MB of stderr. `null` until the command is finished.","type":["string","null"]},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"durationMs":{"description":"`null` until the command is finished.","type":["number","null"]}},"required":["id","sandboxId","command","status","exitCode","stdout","stderr","startedAt","durationMs"]}},"required":["command"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"command":{"type":"string","minLength":1,"maxLength":16384,"description":"The command. It runs in `bash`, so pipes, `&&`, and globs work."},"cwd":{"description":"The working directory of the command. A relative path starts in the working directory of the sandbox.","type":"string","minLength":1,"maxLength":1024},"env":{"default":{},"description":"Env vars of this command, added to those of the sandbox.","type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"additionalProperties":{"type":"string","maxLength":65536}},"background":{"default":false,"description":"`true` returns at once, and the command keeps running. Use it for a server, or for a command that runs longer than 280 seconds.","type":"boolean"},"timeoutSeconds":{"description":"The command stops after this time. Default 60 seconds and at most 280 seconds. A background command has no default, and can run up to 5 hours.","type":"integer","minimum":1,"maximum":18000}},"required":["command"]}}}}}},"/v1/sandboxes/{id}/commands/{commandId}":{"get":{"operationId":"get_sandboxes_id_commands_commandId","summary":"Returns a command, with its exit code and output when it is done.","description":"Returns a command, with its exit code and output when it is done. Needs the `read` scope.","tags":["Sandboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"commandId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"command":{"type":"object","properties":{"id":{"type":"string"},"sandboxId":{"type":"string"},"command":{"type":"string"},"status":{"type":"string","enum":["running","finished"]},"exitCode":{"description":"`null` until the command is finished.","type":["number","null"]},"stdout":{"description":"The last 1 MB of stdout. `null` until the command is finished.","type":["string","null"]},"stderr":{"description":"The last 1 MB of stderr. `null` until the command is finished.","type":["string","null"]},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"durationMs":{"description":"`null` until the command is finished.","type":["number","null"]}},"required":["id","sandboxId","command","status","exitCode","stdout","stderr","startedAt","durationMs"]}},"required":["command"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]}},"/v1/sandboxes/{id}/commands/{commandId}/kill":{"post":{"operationId":"post_sandboxes_id_commands_commandId_kill","summary":"Stops a running command.","description":"Stops a running command. Needs the `write` scope.","tags":["Sandboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"commandId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"command":{"type":"object","properties":{"id":{"type":"string"},"sandboxId":{"type":"string"},"command":{"type":"string"},"status":{"type":"string","enum":["running","finished"]},"exitCode":{"description":"`null` until the command is finished.","type":["number","null"]},"stdout":{"description":"The last 1 MB of stdout. `null` until the command is finished.","type":["string","null"]},"stderr":{"description":"The last 1 MB of stderr. `null` until the command is finished.","type":["string","null"]},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"durationMs":{"description":"`null` until the command is finished.","type":["number","null"]}},"required":["id","sandboxId","command","status","exitCode","stdout","stderr","startedAt","durationMs"]}},"required":["command"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/sandboxes/{id}/terminal":{"post":{"operationId":"post_sandboxes_id_terminal","summary":"Opens an interactive shell for the dashboard terminal.","description":"Opens an interactive shell for the dashboard terminal. Needs the `write` scope.","tags":["Sandboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"terminal":{"type":"object","properties":{"url":{"type":"string","description":"The WebSocket URL of the shell. Anyone with it can use the shell, so keep it secret."},"cwd":{"type":"string","description":"The working directory of the sandbox, for the `start` message."}},"required":["url","cwd"]}},"required":["terminal"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}]}},"/v1/sandboxes/{id}/files":{"put":{"operationId":"put_sandboxes_id_files","summary":"Writes files in a sandbox. Send binary files as base64.","description":"Writes files in a sandbox. Send binary files as base64. Needs the `write` scope.","tags":["Sandboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"written":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["written"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"files":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":1024,"description":"A relative path starts in the working directory of the sandbox."},"content":{"type":"string"},"encoding":{"default":"utf8","description":"`base64` for a binary file.","type":"string","enum":["utf8","base64"]}},"required":["path","content"]}}},"required":["files"]}}}}},"get":{"operationId":"get_sandboxes_id_files","summary":"Returns the raw bytes of one file.","description":"Returns the raw bytes of one file. Needs the `read` scope.","tags":["Sandboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":1024,"description":"A relative path starts in the working directory of the sandbox."},"description":"A relative path starts in the working directory of the sandbox."}],"responses":{"2XX":{"description":"Success. The body is the raw bytes.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]}},"/v1/ai/chat/completions":{"post":{"operationId":"post_ai_chat_completions","summary":"Sends a chat to a model, in the OpenAI chat completions format. With `\"stream\": true`, the response is server-sent events.","description":"Sends a chat to a model, in the OpenAI chat completions format. With `\"stream\": true`, the response is server-sent events. Needs the `write` scope.","tags":["AI"],"parameters":[],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"chat.completion"},"created":{"type":"number"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"message":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":["string","null"]},"refusal":{"type":["string","null"]},"reasoning":{"type":["string","null"]},"tool_calls":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"id":{"type":"string"},"type":{"type":"string"},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}}}}}}}},"finish_reason":{"type":["string","null"]}},"required":["index","message","finish_reason"]}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"number"},"completion_tokens":{"type":"number"},"total_tokens":{"type":"number"},"prompt_tokens_details":{"type":"object","properties":{"cached_tokens":{"type":"number"}}},"completion_tokens_details":{"type":"object","properties":{"reasoning_tokens":{"type":"number"}}}},"required":["prompt_tokens","completion_tokens","total_tokens"]}},"required":["id","object","created","model","choices"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":200},"messages":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool"]},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{}},{"type":"null"}]}},"required":["role"],"additionalProperties":{}}},"stream":{"default":false,"type":"boolean"},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}}},"max_tokens":{"type":"integer","minimum":1,"maximum":8192},"max_completion_tokens":{"type":"integer","minimum":1,"maximum":8192},"temperature":{"type":"number","minimum":0,"maximum":2},"top_p":{"type":"number","minimum":0,"maximum":1},"frequency_penalty":{"type":"number","minimum":-2,"maximum":2},"presence_penalty":{"type":"number","minimum":-2,"maximum":2},"stop":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"seed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tools":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}}},"tool_choice":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}}]},"parallel_tool_calls":{"type":"boolean"},"response_format":{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}},"reasoning_effort":{"type":"string"},"safety_identifier":{"type":"string"}},"required":["model","messages"]}}}}}},"/v1/ai/models":{"get":{"operationId":"get_ai_models","summary":"Lists the chat models.","description":"Lists the chat models. Needs the `read` scope.","tags":["AI"],"parameters":[],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"model"},"created":{"type":"number","description":"Unix time in seconds."},"owned_by":{"type":"string","description":"The creator of the model, such as `openai`."},"name":{"type":"string"},"description":{"type":"string"},"context_window":{"description":"The largest input, in tokens.","type":["number","null"]},"max_tokens":{"description":"The largest output, in tokens.","type":["number","null"]},"tags":{"type":"array","items":{"type":"string"}},"pricing":{"type":"object","properties":{"input_per_million":{"type":["number","null"]},"output_per_million":{"type":["number","null"]}},"required":["input_per_million","output_per_million"],"description":"US dollars for one million input or output tokens."}},"required":["id","object","created","owned_by","name","description","context_window","max_tokens","tags","pricing"]}}},"required":["object","data"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]}},"/v1/ai/usage":{"get":{"operationId":"get_ai_usage","summary":"Returns the AI use and limits of the current UTC day.","description":"Returns the AI use and limits of the current UTC day. Needs the `read` scope.","tags":["AI"],"parameters":[],"responses":{"2XX":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"usage":{"type":"object","properties":{"day":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$","description":"The UTC day, as `YYYY-MM-DD`."},"requests":{"type":"number"},"requestLimit":{"type":"number"},"spendUsd":{"type":"number"},"spendLimitUsd":{"type":"number"},"resetsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"The next midnight UTC, when both limits reset."}},"required":["day","requests","requestLimit","spendUsd","spendLimitUsd","resetsAt"]}},"required":["usage"]}}}},"default":{"description":"An error, with a `code` and a `message`. The API docs list each code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"bearer":[]},{"oauth2":["read"]}]}}},"components":{"schemas":{"ErrorResponse":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request","missing_files","sha_mismatch","unauthorized","forbidden","insufficient_scope","not_found","conflict","busy","no_code","github_not_connected","file_too_large","empty_commit","git_not_accessible","too_large","limit_exceeded","rate_limited","internal_error","generator_error","upstream_error","generation_unavailable","not_available","not_configured","idempotency_key_reused"]},"message":{"type":"string"},"reference":{"type":"string"},"detail":{"type":"string"}},"required":["code","message"]}},"required":["error"]}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"An API key of the user, or an OAuth access token: `Authorization: Bearer <token>`. A key has the scopes that the user gave it."},"oauth2":{"type":"oauth2","description":"An OAuth 2.0 sign-in with PKCE. A client can register itself at `/api/oauth/register`.","flows":{"authorizationCode":{"authorizationUrl":"https://vercel-on.vercel.app/oauth/authorize","tokenUrl":"https://vercel-on.vercel.app/api/oauth/token","scopes":{"read":"Read your account, projects, deployments, domains, sandboxes, and AI usage (GET requests only).","write":"Create, change, and delete projects, deployments, env vars, domains, stores, and sandboxes, and call AI models."}}}}}},"servers":[{"url":"https://vercel-on.vercel.app/api"}]}