Skip to content
Back

Domain not available

  • 0
  • Functions
  • Cloud
fd
6 Sep, 2025, 15:52

Message: After creating a function using the Functions API, the domain is not created automatically, even though the documentation says a domain should be created after each deployment.

What I did:

Connected GitHub, got the installationId and repositoryId.

Successfully uploaded the function and deployed it.

However, the domain was not created, I had to create it manually.

I also tried uploading via file (Manual), and again the domain was not created.

I checked that when I create a function via the UI, the domain is created automatically. But when using the API, I need to create the domain manually and then redeploy.

My question: Is this the expected behavior, or am I doing something wrong in my code? If this is how it’s supposed to work, that’s fine — I’ll just create the domain manually.

TL;DR
Developers are creating functions using the Functions API, but the domain is not automatically created as expected after deployment. The developer had to create the domain manually even though the API documentation indicates it should be created automatically. They tried with GitHub connections and manual file uploads, but the issue persisted. The domain is created automatically when using the UI, leading to confusion. The developer is seeking clarification on whether this is the expected behavior or if there might be an issue in their code. Solution: The automatic creation of domains after deployment using the Functions API is not supported. Manual creation of the domain is required post-deployment when using the API. This behavior
fd
6 Sep, 2025, 15:53

Code:

TypeScript
const myFunc = await functions.create({
  functionId: ID.unique(),
  name: "My Function 3",
  runtime: "node-18.0",
  execute: [],
  scopes: ["users.read"],
  installationId: "",
  providerRepositoryId: "",
  providerBranch: "main",
  providerRootDirectory: "./",
  providerSilentMode: false,
  entrypoint: "src/index.js",
  commands: "npm install",
})

const myDeployment = await functions.createVcsDeployment({
    functionId: myFunc.$id,
    type: "branch",
    reference: "main",
    activate: true, // optional
});
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more