InsertTreatmentType or UpdateTreatmentType, so this endpoint removes the manual console step from an otherwise API-driven treatment type integration.
API Definition
InsertSurface requires a Treatment Management API key, passed in the x-api-key header. A key without Treatment Management permissions is rejected with 403 PERMISSION_DENIED. The key is validated against the projectId in the request: a key issued for one project cannot create a Surface on another.Entities
SurfacePb
InsertSurface
API to register a Surface
Surface name rules
:::caution
Surfaces cannot be deleted. Creating one also provisions the per-Surface event schemas and data fields behind it. Validate the name on your side before calling, since a typo results in a permanent Surface.
:::
Sample cURL Request
Sample Response
Errors
Registering a Surface and a Treatment Type together
InsertTreatmentType and UpdateTreatmentType validate that every Surface named in surfaces already exists for the project, and reject the request with 400 otherwise:
InsertSurface first for each Surface name, then reference those names in the treatment type request:
POST /v1/InsertSurfacefor each Surface the treatment type will usePOST /v1/InsertTreatmentTypewithsurfaces: [{ "surfaceName": "IN_APP_CONTENT" }]POST /v1/InsertTreatmentto add content to the treatment type