Messaging Supabase Auth

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
PATCH
DELETE
POST

Retrieve messaging supabase auth emails settings

Send a Supabase project's auth emails through transactional email templates.

Required API key scopes

hog_flow:read

Response


Example request

GET /api/projects/:project_id/messaging_supabase_auth_emails/settings
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/messaging_supabase_auth_emails/settings/

Example response

Status 200
RESPONSE
{
"supabase_url": "string",
"has_hook_secret": true,
"templates": {
"property1": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"property2": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
},
"hook_url": "string",
"email_types": [
{
"value": "signup",
"label": "string",
"has_starter_template": true
}
]
}

Update messaging supabase auth emails settings

Send a Supabase project's auth emails through transactional email templates.

Required API key scopes

hog_flow:write

Request parameters

  • supabase_url
    string
  • hook_secret
    string
  • templates
    object

Response


Example request

PATCH /api/projects/:project_id/messaging_supabase_auth_emails/settings
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/messaging_supabase_auth_emails/settings/\
-d supabase_url="string"

Example response

Status 200 The saved settings
RESPONSE
{
"supabase_url": "string",
"has_hook_secret": true,
"templates": {
"property1": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"property2": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
},
"hook_url": "string",
"email_types": [
{
"value": "signup",
"label": "string",
"has_starter_template": true
}
]
}
Status 400 A field is invalid. The error names the field to fix.

Delete messaging supabase auth emails settings

Remove the project URL, hook secret and template mappings. The hook then refuses every call, so turn off the Send Email hook in Supabase first. The templates themselves stay.

Required API key scopes

hog_flow:write

Response


Example request

DELETE /api/projects/:project_id/messaging_supabase_auth_emails/settings
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/messaging_supabase_auth_emails/settings/

Example response

Status 200 The empty settings
RESPONSE
{
"supabase_url": "string",
"has_hook_secret": true,
"templates": {
"property1": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"property2": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
},
"hook_url": "string",
"email_types": [
{
"value": "signup",
"label": "string",
"has_starter_template": true
}
]
}

Create messaging supabase auth emails starter templates

Create a transactional template for each core Supabase auth email that has no template yet, and map it. Needs a verified email sender.

Required API key scopes

hog_flow:write

Response


Example request

POST /api/projects/:project_id/messaging_supabase_auth_emails/starter_templates
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/messaging_supabase_auth_emails/starter_templates/

Example response

Status 200 The saved settings
RESPONSE
{
"supabase_url": "string",
"has_hook_secret": true,
"templates": {
"property1": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"property2": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
},
"hook_url": "string",
"email_types": [
{
"value": "signup",
"label": "string",
"has_starter_template": true
}
]
}
Status 400 The team has no verified email sender