{
  "manifest_version": "1.0.0",
  "template": {
    "id": "a2d89b28-70c2-43b9-b3f2-50bf376068e3",
    "slug": "paperclip-ai-company-hq",
    "name": "Paperclip AI Company HQ",
    "description": "Run a team of AI agents with goals, budgets and org charts.",
    "url": "https://railway.com/deploy/paperclip-ai-company-hq",
    "upstream": {
      "image": "ghcr.io/paperclipai/paperclip:2026.1005.0"
    }
  },
  "services": [
    {
      "name": "Paperclip",
      "source": {
        "image": "ghcr.io/paperclipai/paperclip:2026.1005.0"
      },
      "needs_volume": true,
      "volume_mount_path": "/paperclip",
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "HOST",
      "service": "Paperclip",
      "description": "Listen on all interfaces so Railway's edge and private network can reach the server.",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "PORT",
      "service": "Paperclip",
      "description": "Port the Paperclip server listens on; the public domain targets it.",
      "secret": false,
      "strategy": "default",
      "default": "3100"
    },
    {
      "key": "TRUST_PROXY",
      "service": "Paperclip",
      "description": "Trust exactly one proxy hop (Railway's edge) for client IPs used by rate limiting.",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "DATABASE_URL",
      "service": "Paperclip",
      "description": "Postgres connection string on the private network (replaces the embedded database).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "AWS_ACCESS_KEY_ID",
      "service": "Paperclip",
      "description": "Bucket access key (read by the AWS SDK).",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "BETTER_AUTH_SECRET",
      "service": "Paperclip",
      "description": "Session signing secret for Better Auth (generated).",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PAPERCLIP_PUBLIC_URL",
      "service": "Paperclip",
      "description": "Canonical public URL for auth callbacks, invite links and the hostname allow-list. Change it when you add a custom domain.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "AWS_SECRET_ACCESS_KEY",
      "service": "Paperclip",
      "description": "Bucket secret key (read by the AWS SDK).",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERCLIP_DEPLOYMENT_MODE",
      "service": "Paperclip",
      "description": "Login required (Better Auth). Never use local_trusted on a public URL.",
      "secret": false,
      "strategy": "default",
      "default": "authenticated"
    },
    {
      "key": "PAPERCLIP_AGENT_JWT_SECRET",
      "service": "Paperclip",
      "description": "Signing secret for short-lived agent API tokens (generated, kept separate from the session secret).",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PAPERCLIP_STORAGE_PROVIDER",
      "service": "Paperclip",
      "description": "Store attachments and uploads in the Railway Bucket instead of the volume.",
      "secret": false,
      "strategy": "default",
      "default": "s3"
    },
    {
      "key": "PAPERCLIP_ALLOWED_HOSTNAMES",
      "service": "Paperclip",
      "description": "Extra hostnames accepted by the private-host guard: Railway's healthcheck and the private network. The public URL host is added automatically.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PAPERCLIP_STORAGE_S3_BUCKET",
      "service": "Paperclip",
      "description": "Bucket name.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERCLIP_STORAGE_S3_PREFIX",
      "service": "Paperclip",
      "description": "Key prefix inside the bucket.",
      "secret": false,
      "strategy": "default",
      "default": "paperclip"
    },
    {
      "key": "PAPERCLIP_STORAGE_S3_REGION",
      "service": "Paperclip",
      "description": "Bucket region.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERCLIP_SECRETS_MASTER_KEY",
      "service": "Paperclip",
      "description": "32-byte (64 hex) key encrypting company secrets in Postgres. Back it up; losing it makes stored secrets unreadable.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PAPERCLIP_DEPLOYMENT_EXPOSURE",
      "service": "Paperclip",
      "description": "Upstream's appliance mode: enables the browser 'Claim this instance' first-admin flow and the hostname allow-list.",
      "secret": false,
      "strategy": "default",
      "default": "private"
    },
    {
      "key": "PAPERCLIP_STORAGE_S3_ENDPOINT",
      "service": "Paperclip",
      "description": "S3 endpoint of the Railway Bucket (virtual-hosted style).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERCLIP_MIGRATION_AUTO_APPLY",
      "service": "Paperclip",
      "description": "Apply database migrations automatically on start and upgrade.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "PAPERCLIP_AUTH_RATE_LIMIT_ENABLED",
      "service": "Paperclip",
      "description": "Rate-limit sign-in attempts (off by default in private mode upstream).",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Paperclip",
      "description": "Lets running heartbeats and agent processes stop cleanly on redeploy.",
      "secret": false,
      "strategy": "default",
      "default": "30"
    },
    {
      "key": "PAPERCLIP_TOOL_ACTION_SIGNING_SECRET",
      "service": "Paperclip",
      "description": "Signs tool-action approvals. Without it approvals cannot be issued (generated).",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Location where the database will be initialized",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Railway Private Domain Name.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Port to connect to Postgres.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Required variable for Data panel",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Required variable for the data panel.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Required variable for Data panel",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Default database created when image is started.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "URL to connect to Postgres database.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "User to connect to Postgres DB",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "SSL certificate expiry in days.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Password to connect to DB",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Allow Postgres to cleanly shut down",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "paperclip-ai-company-hq"
      }
    },
    "cli": "railway deploy --template paperclip-ai-company-hq",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "a2d89b28-70c2-43b9-b3f2-50bf376068e3",
            "serializedConfig": {
              "buckets": {
                "06e049be-b087-5199-bb8d-360e53697476": {
                  "name": "Bucket"
                }
              },
              "services": {
                "78a71347-b394-56f0-ae99-bfc29d7d1971": {
                  "icon": "https://raw.githubusercontent.com/paperclipai/paperclip/master/ui/public/apple-touch-icon.png",
                  "name": "Paperclip",
                  "deploy": {
                    "healthcheckPath": "/api/health",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 300,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/paperclipai/paperclip:2026.1005.0"
                  },
                  "variables": {
                    "HOST": {
                      "isOptional": true,
                      "description": "Listen on all interfaces so Railway's edge and private network can reach the server.",
                      "defaultValue": "0.0.0.0"
                    },
                    "PORT": {
                      "isOptional": true,
                      "description": "Port the Paperclip server listens on; the public domain targets it.",
                      "defaultValue": "3100"
                    },
                    "TRUST_PROXY": {
                      "isOptional": true,
                      "description": "Trust exactly one proxy hop (Railway's edge) for client IPs used by rate limiting.",
                      "defaultValue": "1"
                    },
                    "DATABASE_URL": {
                      "isOptional": true,
                      "description": "Postgres connection string on the private network (replaces the embedded database).",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "GEMINI_API_KEY": {
                      "isOptional": true,
                      "description": "Optional. Gemini API key (must be restricted to the Gemini API) for gemini_local agents.",
                      "defaultValue": ""
                    },
                    "OPENAI_API_KEY": {
                      "isOptional": true,
                      "description": "Optional. Lets codex_local agents run with an API key; alternatively `codex login --device-auth` via Railway SSH.",
                      "defaultValue": ""
                    },
                    "ANTHROPIC_API_KEY": {
                      "isOptional": true,
                      "description": "Optional. Lets claude_local agents run with an API key; alternatively run `claude` login via Railway SSH (stored on the volume).",
                      "defaultValue": ""
                    },
                    "AWS_ACCESS_KEY_ID": {
                      "isOptional": true,
                      "description": "Bucket access key (read by the AWS SDK).",
                      "defaultValue": "${{Bucket.ACCESS_KEY_ID}}"
                    },
                    "BETTER_AUTH_SECRET": {
                      "isOptional": true,
                      "description": "Session signing secret for Better Auth (generated).",
                      "defaultValue": "{{BETTER_AUTH_SECRET}}"
                    },
                    "PAPERCLIP_PUBLIC_URL": {
                      "isOptional": true,
                      "description": "Canonical public URL for auth callbacks, invite links and the hostname allow-list. Change it when you add a custom domain.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "AWS_SECRET_ACCESS_KEY": {
                      "isOptional": true,
                      "description": "Bucket secret key (read by the AWS SDK).",
                      "defaultValue": "${{Bucket.SECRET_ACCESS_KEY}}"
                    },
                    "PAPERCLIP_DEPLOYMENT_MODE": {
                      "isOptional": true,
                      "description": "Login required (Better Auth). Never use local_trusted on a public URL.",
                      "defaultValue": "authenticated"
                    },
                    "PAPERCLIP_AGENT_JWT_SECRET": {
                      "isOptional": true,
                      "description": "Signing secret for short-lived agent API tokens (generated, kept separate from the session secret).",
                      "defaultValue": "{{PAPERCLIP_AGENT_JWT_SECRET}}"
                    },
                    "PAPERCLIP_STORAGE_PROVIDER": {
                      "isOptional": true,
                      "description": "Store attachments and uploads in the Railway Bucket instead of the volume.",
                      "defaultValue": "s3"
                    },
                    "PAPERCLIP_ALLOWED_HOSTNAMES": {
                      "isOptional": true,
                      "description": "Extra hostnames accepted by the private-host guard: Railway's healthcheck and the private network. The public URL host is added automatically.",
                      "defaultValue": "healthcheck.railway.app,${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PAPERCLIP_STORAGE_S3_BUCKET": {
                      "isOptional": true,
                      "description": "Bucket name.",
                      "defaultValue": "${{Bucket.BUCKET}}"
                    },
                    "PAPERCLIP_STORAGE_S3_PREFIX": {
                      "isOptional": true,
                      "description": "Key prefix inside the bucket.",
                      "defaultValue": "paperclip"
                    },
                    "PAPERCLIP_STORAGE_S3_REGION": {
                      "isOptional": true,
                      "description": "Bucket region.",
                      "defaultValue": "${{Bucket.REGION}}"
                    },
                    "PAPERCLIP_SECRETS_MASTER_KEY": {
                      "isOptional": true,
                      "description": "32-byte (64 hex) key encrypting company secrets in Postgres. Back it up; losing it makes stored secrets unreadable.",
                      "defaultValue": "{{PAPERCLIP_SECRETS_MASTER_KEY}}"
                    },
                    "PAPERCLIP_DEPLOYMENT_EXPOSURE": {
                      "isOptional": true,
                      "description": "Upstream's appliance mode: enables the browser 'Claim this instance' first-admin flow and the hostname allow-list.",
                      "defaultValue": "private"
                    },
                    "PAPERCLIP_STORAGE_S3_ENDPOINT": {
                      "isOptional": true,
                      "description": "S3 endpoint of the Railway Bucket (virtual-hosted style).",
                      "defaultValue": "${{Bucket.ENDPOINT}}"
                    },
                    "PAPERCLIP_MIGRATION_AUTO_APPLY": {
                      "isOptional": true,
                      "description": "Apply database migrations automatically on start and upgrade.",
                      "defaultValue": "true"
                    },
                    "PAPERCLIP_AUTH_RATE_LIMIT_ENABLED": {
                      "isOptional": true,
                      "description": "Rate-limit sign-in attempts (off by default in private mode upstream).",
                      "defaultValue": "true"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": true,
                      "description": "Lets running heartbeats and agent processes stop cleanly on redeploy.",
                      "defaultValue": "30"
                    },
                    "PAPERCLIP_TOOL_ACTION_SIGNING_SECRET": {
                      "isOptional": true,
                      "description": "Signs tool-action approvals. Without it approvals cannot be issued (generated).",
                      "defaultValue": "{{PAPERCLIP_TOOL_ACTION_SIGNING_SECRET}}"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {
                      "<hasDomain>:3100": {
                        "port": 3100
                      }
                    }
                  },
                  "volumeMounts": {
                    "9c18094d-db53-565f-a28e-d993d8a0bd4d": {
                      "mountPath": "/paperclip"
                    }
                  }
                },
                "b3343e65-2195-57e6-aef6-a7067f406ce6": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": true,
                      "description": "Location where the database will be initialized",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": true,
                      "description": "Railway Private Domain Name.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": true,
                      "description": "Port to connect to Postgres.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": true,
                      "description": "Required variable for Data panel",
                      "defaultValue": "${{ POSTGRES_USER }}"
                    },
                    "PGDATABASE": {
                      "isOptional": true,
                      "description": "Required variable for the data panel.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": true,
                      "description": "Required variable for Data panel",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": true,
                      "description": "Default database created when image is started.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": true,
                      "description": "URL to connect to Postgres database.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": true,
                      "description": "User to connect to Postgres DB",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": true,
                      "description": "SSL certificate expiry in days.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": true,
                      "description": "Password to connect to DB",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": true,
                      "description": "Allow Postgres to cleanly shut down",
                      "defaultValue": "60"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "8a46f106-9225-5a4e-a12b-5b51dbc7070e": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Paperclip",
      "method": "GET",
      "path": "/api/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-10-11T16:14:40.554Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-10-11T14:34:01.066Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_bdd50ad87f2e47f79c56",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": false,
        "detail": "Your workspace has been restricted. Please contact support to resolve this."
      }
    ]
  }
}
