# Upsert Social Proof Template

POST /api/v2/projects/{projectId}/social-proof/templates

Creates a notification template, or updates one when template.id is set. Omitting position appends the template after the current last one.

## Request

- projectId: string, path, required — ID of the project that owns the template.
- template: object, required — Template to create, or to replace when id is set.
  - name: string, required — Dashboard name. Not shown to visitors.
  - template: string, required — Message with {variable} placeholders, for example Someone from {location} just signed up {timeAgo}.
  - action: string — Analytics event action this template matches, for example Signed Up. Null makes it a routing-only box that incoming events never match directly.
  - enabled: boolean, default true — When false, this template is not served to visitors. Defaults to true.
  - eventRules: object[] — If/then rules applied when the feed is built. They can block an event or rewrite a field.
    - field: string, required
    - operator: IS_SET | IS_NOT_SET | EQUALS | NOT_EQUALS | CONTAINS | NOT_CONTAINS | GREATER_THAN | GREATER_THAN_OR_EQUAL | LESS_THAN | LESS_THAN_OR_EQUAL, required
    - outcome: block | set_value | route, required
    - replacement: string
    - targetTemplateId: string
    - value: string
  - fallbackImageUrl: string — Static https image used when the primary image fails or a {property} image never resolves.
  - id: string — ID of an existing template to update. Omit to create one.
  - imageUrl: value — Image beside the message: an https URL, or a {property} token resolved per event.
  - linkToEvent: boolean, default false — When true, a click opens linkUrl or the event href, with Saasco UTM parameters.
  - linkUrl: string — Fixed click URL. When linkToEvent is on and this is set, it wins over the even
…

## Response

- 200: Successful response
  - enabled: boolean, required, default true — When false, this template is not served to visitors. Defaults to true.
  - eventRules: object[], required — If/then rules applied when the feed is built. They can block an event or rewrite a field.
    - field: string, required
    - operator: IS_SET | IS_NOT_SET | EQUALS | NOT_EQUALS | CONTAINS | NOT_CONTAINS | GREATER_THAN | GREATER_THAN_OR_EQUAL | LESS_THAN | LESS_THAN_OR_EQUAL, required
    - outcome: block | set_value | route, required
    - replacement: string
    - targetTemplateId: string
    - value: string
  - id: string, required — ID of the template.
  - linkToEvent: boolean, required, default false — When true, a click opens linkUrl or the event href, with Saasco UTM parameters.
  - name: string, required — Dashboard name. Not shown to visitors.
  - position: integer, required, default 0 — Order among this project's templates. Lower comes first.
  - template: string, required — Message with {variable} placeholders, for example Someone from {location} just signed up {timeAgo}.
  - action: string — Analytics event action this template matches, for example Signed Up. Null makes it a routing-only box that incoming events never match directly.
  - fallbackImageUrl: string — Static https image used when the primary image fails or a {property} image never resolves.
  - imageUrl: value — Image beside the message: an https URL, or a {property} token resolved per event.
  - linkUrl: string — Fixed click URL. When linkToEvent is on and this is set, it wins over the event href.
- 400: Invalid input d
…
