فراز اس ام اس مستندات وب‌سرویس

Home › Patterns

Create New Pattern — FarazSMS SMS web service

POST https://api.iranpayamak.com/ws/v1/patterns

Purpose: Create a new pattern (template) with variables; the prerequisite of pattern send. Needs approval after creation.

Create a new pattern with API

Authentication

This endpoint requires the Api-Key header — get the key from the FarazSMS panel. The header name is case-sensitive and the key must never travel in a query string.

Request fields

  • text (string) — required
  • description (string) — required — nullable
  • share (integer) — required — boolean
  • website (string) — required
  • category (integer) — required — 1 = otp, 2 = club, 3 = order, 255 = others
  • vars (array) — required

Notes for this endpoint

  • Create a new pattern here. Define variables in vars and place them in text as %name%.
  • After creation the pattern must be approved before it can send.

Example body

{
  "text": "test text %var%, %var2%",
  "description": "test desc",
  "share": 1,
  "website": "example.com",
  "category": 1,
  "vars": [
    {
      "var": "var",
      "length": 12,
      "type": "int"
    },
    {
      "var": "var2",
      "length": 12,
      "type": "int"
    }
  ]
}

Responses

  • 201 — Pattern created successfully.

Related endpoints in Patterns

All FarazSMS web services · llms.txt · OpenAPI