SGTM Containers Edge Function
Manages Server-side Google Tag Manager container lifecycle including creation, infrastructure provisioning, and verification.
POST /sgtm-containers - Create a new container with infrastructure
POST /sgtm-containers/:id/verify - Re-verify an existing container
Required - JWT in Authorization header
This is the main orchestration function for container management:
Create Flow (POST /sgtm-containers):
Verify Flow (POST /sgtm-containers/:id/verify):
Tables touched:
External services:
{ "clientId": "uuid", "name": "My Container", "domains": ["example.com", "shop.example.com"], "webGtmIds": { "example.com": "GTM-XXXX" }, "containerConfigB64": "base64-encoded-config"} Copy
{ "clientId": "uuid", "name": "My Container", "domains": ["example.com", "shop.example.com"], "webGtmIds": { "example.com": "GTM-XXXX" }, "containerConfigB64": "base64-encoded-config"}
200 - Success with container details
400 - Invalid request (missing fields, invalid config)
401 - Unauthorized
403 - Insufficient permissions
404 - Container not found (verify endpoint)
405 - Method not allowed
500 - Internal server error or infrastructure failure
503 - No available ports
Fileoverview
SGTM Containers Edge Function
Manages Server-side Google Tag Manager container lifecycle including creation, infrastructure provisioning, and verification.
Endpoint
POST /sgtm-containers - Create a new container with infrastructure
Endpoint
POST /sgtm-containers/:id/verify - Re-verify an existing container
Auth
Required - JWT in Authorization header
Remarks
This is the main orchestration function for container management:
Create Flow (POST /sgtm-containers):
Verify Flow (POST /sgtm-containers/:id/verify):
Tables touched:
External services:
Example: Create request body
Returns
200 - Success with container details
Returns
400 - Invalid request (missing fields, invalid config)
Returns
401 - Unauthorized
Returns
403 - Insufficient permissions
Returns
404 - Container not found (verify endpoint)
Returns
405 - Method not allowed
Returns
500 - Internal server error or infrastructure failure
Returns
503 - No available ports