v1

latestOpenAPI 3.1.12026-08-063445179.6 KB
apps

Create app

Apps can reference layers for shared configuration, have app-specific environment variables, and a config that provides defaults for revisions.

post/v2/apps

Request body

slugstring

App slug. If omitted, a random slug is generated. App slugs must be 3–32 characters long, may contain only lowercase letters, numbers, and hyphens, cannot contain underscores, must not start or end with a hyphen, must not have consecutive hyphens in positions 3 and 4, and cannot be a reserved slug.

labelsLabels

Example request

{
  "labels": {
    "custom.customer_id": "cust_123",
    "custom.environment": "production",
    "custom.regions": [
      "us-east",
      "eu-west"
    ]
  },
  "env_vars": [
    {
      "key": "DATABASE_URL",
      "value": "postgres://localhost/dev"
    }
  ],
  "config": {
    "framework": "nextjs",
    "install": "npm install",
    "build": "npm run build"
  }
}

Response

OK

idstring uuid required

Unique app identifier (UUID)

slugstring required

Human-readable app slug. App slugs must be 3–32 characters long, may contain only lowercase letters, numbers, and hyphens, cannot contain underscores, must not start or end with a hyphen, must not have consecutive hyphens in positions 3 and 4, and cannot be a reserved slug.

labelsLabels
updated_atstring required

ISO 8601 timestamp of last modification

created_atstring required

ISO 8601 timestamp of creation

Example response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "slug": "my-customer-app",
  "labels": {
    "custom.customer_id": "cust_123",
    "custom.environment": "production"
  },
  "layers": [
    {
      "id": "lyr_abc123",
      "slug": "shared-secrets"
    }
  ],
  "env_vars": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "key": "APP_NAME",
      "value": "My Customer App",
      "secret": false,
      "contexts": "all"
    }
  ],
  "config": {
    "framework": "nextjs",
    "install": "npm install",
    "build": "npm run build"
  },
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}