---
title: "Create a Supabase Send SMS hook that delivers codes by WhatsApp"
method: POST
path: "/api/v1/projects/{projectId}/auth-hooks"
tags: ["Auth hooks"]
---

# Create a Supabase Send SMS hook that delivers codes by WhatsApp

`POST /api/v1/projects/{projectId}/auth-hooks`

## Request

- Base URL: `https://otprun.com`
- URL: `https://otprun.com/api/v1/projects/{projectId}/auth-hooks`
- Auth: HTTP bearer

## Path parameters

- `projectId` integer, required

## Request body

- CreateInputBody6
  - `app_name` string
  - `code_ttl_seconds` integer: Defaults to 60, the Supabase default
  - `locale` string

## Response `201`

Created

- AuthHookBody
  - `app_name` string, required: Replaces {app} in the code text, empty means the project sender name
  - `code_ttl_seconds` integer, required: Code lifetime shown in the text, set it to the SMS OTP expiry in Supabase
  - `created_at` string, date-time, required
  - `enabled` boolean, required: A turned off hook answers Supabase with an error and sends no codes
  - `has_next_secret` boolean, required
  - `has_secret` boolean, required
  - `id` string, required: Public hook id, part of the hook URL
  - `last_used_at` string, date-time, nullable, required
  - `locale` string, required: Language of the code text, empty means the project language
  - `project_id` string, required
  - `provider` 'supabase', required
  - `url` string, required: Paste this URL into Supabase: Authentication, Hooks, Send SMS hook, HTTPS

## Other responses

- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `422`: Unprocessable Entity
- `500`: Internal Server Error

---

[API](https://skmtc.dev/otprun/apis/otp-run-api.md) · [All operations](https://skmtc.dev/otprun/apis/otp-run-api/llms.txt) · [OpenAPI document](https://skmtc.dev/otprun/apis/otp-run-api/revisions/43d40d5f4050?raw)
