# Postscript

> Grow and text your Shopify store's SMS subscribers in Postscript: add, find, tag and opt out subscribers, text them, send events to flows, and start workflows when someone opts in, opts out or texts the shop.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/postscript

## Actions

### Add subscriber

Sign a phone number up to the shop's texts through a keyword. Only add people who agreed to get marketing texts: Postscript texts them to confirm and adds them only once they reply. Until then the id returned is a pending one.

**Inputs**

- Phone number (`phone_number`, text, required): Their mobile number in any format. Without a country code it is read as a US number.
- Keyword (`keyword`, text, required): The keyword they sign up through, which sets the reply they get. Pick one, or type the keyword.
- Source (`origin`, text): Where they signed up. Defaults to other. One of: `other` (Other (default)), `website`, `social`.
- Email (`email`, text): Their email, kept on the subscriber and used to find their Shopify customer.
- Shopify customer ID (`shopify_customer_id`, number): The Shopify customer this phone number belongs to.
- Tags (`tags`, list): Tags to add, for segments. Pick from the tags on recent subscribers or type new ones.
- Custom properties (`properties`, object): Up to 20 keys and values to filter segments by: text, whole numbers, lists of text or dates.

**Outputs**

- `phone_number` (text): The phone number sent, in E.164
- `subscriber` (object): The pending subscriber
- `subscriber_id` (text): The pending subscriber's id

**Example output**

```json
{
  "phone_number": "+14155550123",
  "subscriber": {
    "created_at": "2026-10-15T09:00:00Z",
    "data": {},
    "email": "jo@example.com",
    "id": "ps_pending_123",
    "phone_number": "+14155550123",
    "properties": {
      "birthday": "1991-01-01",
      "has_purchased": true
    },
    "ps_id": 42,
    "shopify_customer_id": 6123456789,
    "subscriptions": {
      "promotional": {
        "can_send": true
      },
      "transactional": {
        "can_send": true
      }
    },
    "tags": [
      "VIP"
    ],
    "updated_at": "2026-10-16T09:00:00Z"
  },
  "subscriber_id": "ps_pending_123"
}
```

### Create webhook

Have Postscript send one kind of event, such as a subscriber opting in, to an https address you have.

**Inputs**

- Event (`event`, text, required): Which event to send. One of: `shop.test` (Test event (shop.test)), `shop.incoming_message` (Incoming message (shop.incoming_message)), `shop.subscriber.opt_in` (Subscriber opted in (shop.subscriber.opt_in)), `shop.subscriber.opt_out` (Subscriber opted out (shop.subscriber.opt_out)), `shop.email_collected` (Email collected (shop.email_collected)).
- Address (`callback_url`, text, required): The https:// address to send it to.
- Headers (`headers`, object): Header names and values Postscript adds to every delivery, such as a token your endpoint checks.

**Outputs**

- `webhook` (object): The webhook

**Example output**

```json
{
  "webhook": {
    "callback_url": "https://example.com/postscript",
    "created_at": "2026-10-15T09:00:00Z",
    "event": "shop.subscriber.opt_in",
    "headers": {},
    "id": "a47606a1-5b39-4a81-9480-c2cb738ff675",
    "updated_at": "2026-10-15T09:00:00Z"
  }
}
```

### Delete webhook

Delete a webhook so Postscript stops sending to it.

**Inputs**

- Webhook (`webhook_id`, text, required): The webhook. Pick one, or give its id from an earlier step.

**Outputs**

- `deleted` (true/false): Always true once deleted
- `webhook_id` (text): The webhook deleted

**Example output**

```json
{
  "deleted": true,
  "webhook_id": "a47606a1-5b39-4a81-9480-c2cb738ff675"
}
```

### Erase subscriber data

Erase a person's data from Postscript for a privacy request, found by id, phone, email or Shopify customer. It opts them out too and can't be undone.

**Inputs**

- Subscriber ID (`subscriber_id`, text): Their Postscript id.
- Phone number (`phone_number`, text): Their phone number, in any format.
- Email (`email`, text): Their email address.
- Shopify customer ID (`shopify_customer_id`, text): Their Shopify customer id.

**Outputs**

- `message` (text): Postscript's answer
- `redacted` (true/false): True once Postscript accepted it

**Example output**

```json
{
  "message": "OK",
  "redacted": true
}
```

### Find subscriber

Look up a subscriber by phone number (in any format) or email. Says whether one was found instead of failing.

**Inputs**

- Phone number (`phone_number`, text): Their phone number, such as (415) 555-0123 or +44 7700 900123. Used first when both are given.
- Email (`email`, text): Their email address.

**Outputs**

- `count` (number): How many matched
- `found` (true/false): Whether a subscriber matched
- `subscriber` (object): The subscriber; empty if none matched
- `subscriber_id` (text): Their id; empty if none matched

**Example output**

```json
{
  "count": 1,
  "found": true,
  "subscriber": {
    "created_at": "2026-10-15T09:00:00Z",
    "data": {},
    "email": "jo@example.com",
    "id": "s_1234567abcd",
    "phone_number": "+14155550123",
    "properties": {
      "birthday": "1991-01-01",
      "has_purchased": true
    },
    "ps_id": 42,
    "shopify_customer_id": 6123456789,
    "subscriptions": {
      "promotional": {
        "can_send": true
      },
      "transactional": {
        "can_send": true
      }
    },
    "tags": [
      "VIP"
    ],
    "updated_at": "2026-10-16T09:00:00Z"
  },
  "subscriber_id": "s_1234567abcd"
}
```

### Get connected shop

Get the Postscript shop the connection acts for: its id and name.

**Inputs**: None.

**Outputs**

- `resource_type` (text): What the key belongs to: shop or partner
- `shop_id` (text): The shop's Postscript id
- `shop_name` (text): The shop's name

**Example output**

```json
{
  "resource_type": "shop",
  "shop_id": "shop_1234567abcde",
  "shop_name": "Acme"
}
```

### Get keyword

Get one keyword with how many times it was texted in.

**Inputs**

- Keyword (`keyword_id`, text, required): The keyword. Pick one, or give its id (kw_...).

**Outputs**

- `keyword` (object): The keyword

**Example output**

```json
{
  "keyword": {
    "created_at": "2026-10-01T03:17:09.306630",
    "id": "kw_31afjew824892ks",
    "keyword": "JOIN",
    "triggered_count": 10,
    "updated_at": "2026-10-01T03:17:09.306639"
  }
}
```

### Get message request

Check a text sent with 'Send text message': its status, and the sent text once Postscript has sent it.

**Inputs**

- Message request ID (`message_request_id`, text, required): The id 'Send text message' returned.

**Outputs**

- `message_request` (object): The message request
- `sent` (true/false): Whether Postscript has sent the text yet
- `sent_message_id` (text): The sent text's id once sent; empty until then
- `status` (text): Where the message is: processing, scheduled, sent and so on

**Example output**

```json
{
  "message_request": {
    "body": "Your order has shipped!",
    "category": "promotional",
    "created_at": "2026-10-16T09:00:00Z",
    "id": "mr_1b2a005a386281c9",
    "phone": "+14155550123",
    "scheduled_at": "",
    "sent_message": {
      "body": "Acme: Your order has shipped!",
      "created_at": "2026-10-16T09:00:05Z",
      "credits_used": 1,
      "id": "sm_1b2a005a386281c9",
      "media_url": "",
      "phone": "+14155550123",
      "shop_id": "shop_1234567abcd",
      "subscriber_id": "s_1234567abcd"
    },
    "status": "sent",
    "status_code": 0,
    "subscriber_id": "s_1234567abcd",
    "updated_at": "2026-10-16T09:00:05Z"
  },
  "sent": true,
  "sent_message_id": "sm_1b2a005a386281c9",
  "status": "sent"
}
```

### Get sent message

Get a text Postscript sent, with what it said and the credits it used.

**Inputs**

- Sent message ID (`sent_message_id`, text, required): The sent text's id, from 'Get message request'.

**Outputs**

- `sent_message` (object): The sent text

**Example output**

```json
{
  "sent_message": {
    "body": "Acme: Your order has shipped!",
    "created_at": "2026-10-16T09:00:05Z",
    "credits_used": 1,
    "id": "sm_1b2a005a386281c9",
    "media_url": "",
    "phone": "+14155550123",
    "shop_id": "shop_1234567abcd",
    "subscriber_id": "s_1234567abcd"
  }
}
```

### Get subscriber

Get one subscriber with their tags, properties and whether the shop may text them promotions or order updates.

**Inputs**

- Subscriber ID (`subscriber_id`, text, required): The subscriber's Postscript id (it starts with s_), from 'Find subscriber', 'List subscribers' or a trigger.

**Outputs**

- `subscriber` (object): The subscriber

**Example output**

```json
{
  "subscriber": {
    "created_at": "2026-10-15T09:00:00Z",
    "data": {},
    "email": "jo@example.com",
    "id": "s_1234567abcd",
    "phone_number": "+14155550123",
    "properties": {
      "birthday": "1991-01-01",
      "has_purchased": true
    },
    "ps_id": 42,
    "shopify_customer_id": 6123456789,
    "subscriptions": {
      "promotional": {
        "can_send": true
      },
      "transactional": {
        "can_send": true
      }
    },
    "tags": [
      "VIP"
    ],
    "updated_at": "2026-10-16T09:00:00Z"
  }
}
```

### Get webhook

Get one webhook with its event, address and headers.

**Inputs**

- Webhook (`webhook_id`, text, required): The webhook. Pick one, or give its id from an earlier step.

**Outputs**

- `webhook` (object): The webhook

**Example output**

```json
{
  "webhook": {
    "callback_url": "https://example.com/postscript",
    "created_at": "2026-10-15T09:00:00Z",
    "event": "shop.subscriber.opt_in",
    "headers": {},
    "id": "a47606a1-5b39-4a81-9480-c2cb738ff675",
    "updated_at": "2026-10-15T09:00:00Z"
  }
}
```

### List keywords

List the shop's active keywords, the words people text in to sign up, with how often each was used.

**Inputs**: None.

**Outputs**

- `count` (number): How many
- `keywords` (list): The keywords

**Example output**

```json
{
  "count": 1,
  "keywords": [
    {
      "created_at": "2026-10-01T03:17:09.306630",
      "id": "kw_31afjew824892ks",
      "keyword": "JOIN",
      "triggered_count": 10,
      "updated_at": "2026-10-01T03:17:09.306639"
    }
  ]
}
```

### List subscribers

List the shop's SMS subscribers, filtered by email, phone, Shopify customer or when they joined or changed. Gets one page; run it again with the next page number to see more.

**Inputs**

- Subscribed to (`subscription_type`, text): Promotional subscribers (the default), transactional ones, or all. One of: `promotional` (Promotional (default)), `transactional`, `all`.
- Email is (`email`, text): Only the subscriber with exactly this email.
- Email contains (`email_contains`, text): Only subscribers whose email contains this, such as @acme.com.
- Phone number (`phone_number`, text): Only the subscriber with this phone number, in any format.
- Shopify customer ID (`shopify_customer_id`, text): Only the subscriber linked to this Shopify customer.
- Joined after (`created_after`, date and time): Only subscribers who joined after this time.
- Joined before (`created_before`, date and time): Only subscribers who joined before this time.
- Changed after (`updated_after`, date and time): Only subscribers changed after this time.
- Changed before (`updated_before`, date and time): Only subscribers changed before this time.
- Order (`sort`, text): How to sort them. Leave empty for Postscript's order. One of: `created_at__desc` (Newest first), `created_at__asc` (Oldest first), `updated_at__desc` (Recently changed first), `updated_at__asc` (Least recently changed first), `phone_number__asc` (Phone number, A to Z), `phone_number__desc` (Phone number, Z to A), `shopify_customer_id__asc` (Shopify customer ID, low to high), `shopify_customer_id__desc` (Shopify customer ID, high to low).
- Page (`page`, number): Which page to get, from 1. The result says how many there are. At least 1.

**Outputs**

- `count` (number): How many on this page
- `has_more` (true/false): Whether there is a page after this one
- `page` (number): This page's number
- `subscribers` (list): The subscribers
- `total_pages` (number): How many pages there are

**Example output**

```json
{
  "count": 1,
  "has_more": false,
  "page": 1,
  "subscribers": [
    {
      "created_at": "2026-10-15T09:00:00Z",
      "data": {},
      "email": "jo@example.com",
      "id": "s_1234567abcd",
      "phone_number": "+14155550123",
      "properties": {
        "birthday": "1991-01-01",
        "has_purchased": true
      },
      "ps_id": 42,
      "shopify_customer_id": 6123456789,
      "subscriptions": {
        "promotional": {
          "can_send": true
        },
        "transactional": {
          "can_send": true
        }
      },
      "tags": [
        "VIP"
      ],
      "updated_at": "2026-10-16T09:00:00Z"
    }
  ],
  "total_pages": 1
}
```

### List webhooks

List the shop's webhooks: which event each sends, and where.

**Inputs**: None.

**Outputs**

- `count` (number): How many
- `webhooks` (list): The webhooks

**Example output**

```json
{
  "count": 1,
  "webhooks": [
    {
      "callback_url": "https://example.com/postscript",
      "created_at": "2026-10-15T09:00:00Z",
      "event": "shop.subscriber.opt_in",
      "headers": {},
      "id": "a47606a1-5b39-4a81-9480-c2cb738ff675",
      "updated_at": "2026-10-15T09:00:00Z"
    }
  ]
}
```

### Send custom event

Send an event, such as QuizCompleted, that Postscript flows can start from or wait for, tied to a subscriber by id, phone or email.

**Inputs**

- Event name (`event_type`, text, required): The event's name as flows show it, after the shop's name. Letters, digits and underscores only.
- Subscriber ID (`subscriber_id`, text): The subscriber's Postscript id.
- Phone number (`phone_number`, text): The subscriber's phone number, in any format.
- Email (`email`, text): The subscriber's email.
- Happened at (`occurred_at`, date and time): When it happened. Leave empty for now.
- Details (`properties`, object): Keys and values flows can filter on and put in texts: text, numbers, true or false, or dates.
- Your event ID (`external_id`, text): The event's id in your own system, if it has one.

**Outputs**

- `accepted` (true/false): True once Postscript accepted it
- `event_ids` (list): The ids Postscript gave the event
- `event_type` (text): The event's name

**Example output**

```json
{
  "accepted": true,
  "event_ids": [
    "1234-abcd-5678"
  ],
  "event_type": "QuizCompleted"
}
```

### Send test webhook

Have Postscript send made-up data to every webhook of the shop for one event, to check the address receives it.

**Inputs**

- Event (`event`, text): Which event to send a test of. Defaults to the test event. One of: `shop.test` (Test event (shop.test)), `shop.incoming_message` (Incoming message (shop.incoming_message)), `shop.subscriber.opt_in` (Subscriber opted in (shop.subscriber.opt_in)), `shop.subscriber.opt_out` (Subscriber opted out (shop.subscriber.opt_out)), `shop.email_collected` (Email collected (shop.email_collected)).

**Outputs**

- `event` (text): The event tested
- `message` (text): Postscript's answer
- `sent` (true/false): True once Postscript accepted it

**Example output**

```json
{
  "event": "shop.test",
  "message": "OK",
  "sent": true
}
```

### Send text message

Text one existing subscriber who agreed to get the shop's texts. Postscript starts it with the shop's name, and holds a promotional text until the subscriber's waking hours.

**Inputs**

- Subscriber ID (`subscriber_id`, text): Their Postscript id. Give this or the phone number.
- Phone number (`phone_number`, text): A subscriber's phone number, in any format.
- Country (`country`, text): The two-letter country of a phone number written without a country code. Defaults to US.
- Message (`body`, text, required): What to text them.
- Kind (`category`, text): Promotional (the default). Transactional and conversational need Postscript's approval first. One of: `promotional` (Promotional (default)), `transactional`, `conversational`.
- Send at (`scheduled_at`, date and time): A later time to send it. Leave empty to send now.
- Image link (`media_url`, text): An https link to a JPEG, PNG or GIF up to 1 MB, sent as a picture message (MMS costs more).

**Outputs**

- `message_request` (object): The message request
- `message_request_id` (text): The request's id, for 'Get message request'
- `sent_message_id` (text): The sent text's id if already sent
- `status` (text): Where it is: processing, scheduled, sent and so on

**Example output**

```json
{
  "message_request": {
    "body": "Your order has shipped!",
    "category": "promotional",
    "created_at": "2026-10-16T09:00:00Z",
    "id": "mr_1b2a005a386281c9",
    "phone": "+14155550123",
    "scheduled_at": "",
    "sent_message": {
      "body": "Acme: Your order has shipped!",
      "created_at": "2026-10-16T09:00:05Z",
      "credits_used": 1,
      "id": "sm_1b2a005a386281c9",
      "media_url": "",
      "phone": "+14155550123",
      "shop_id": "shop_1234567abcd",
      "subscriber_id": "s_1234567abcd"
    },
    "status": "sent",
    "status_code": 0,
    "subscriber_id": "s_1234567abcd",
    "updated_at": "2026-10-16T09:00:05Z"
  },
  "message_request_id": "mr_1b2a005a386281c9",
  "sent_message_id": "sm_1b2a005a386281c9",
  "status": "sent"
}
```

### Unsubscribe subscriber

Opt a subscriber out of the shop's texts, by id or phone number, for example when they ask you to stop texting them.

**Inputs**

- Subscriber ID (`subscriber_id`, text): Their Postscript id. Give this or the phone number.
- Phone number (`phone_number`, text): Their phone number, in any format.

**Outputs**

- `message` (text): Postscript's answer
- `phone_number` (text): The phone number given, in E.164, if any
- `subscriber_id` (text): The id given, if any
- `unsubscribed` (true/false): True once Postscript accepted it

**Example output**

```json
{
  "message": "OK",
  "phone_number": "",
  "subscriber_id": "s_1234567abcd",
  "unsubscribed": true
}
```

### Update subscriber

Add tags, set custom properties or give a subscriber an email. Tags only add, other properties are kept, and an email is saved only if they have none yet.

**Inputs**

- Subscriber ID (`subscriber_id`, text, required): The subscriber's Postscript id (it starts with s_), from 'Find subscriber', 'List subscribers' or a trigger.
- Email (`email`, text): Their email. Postscript keeps an email they already have.
- Tags (`tags`, list): Tags to add, for segments. Pick from the tags on recent subscribers or type new ones.
- Custom properties (`properties`, object): Keys and values to set; the subscriber's other properties stay. Up to 50 in all.

**Outputs**

- `subscriber` (object): The subscriber

**Example output**

```json
{
  "subscriber": {
    "created_at": "2026-10-15T09:00:00Z",
    "data": {},
    "email": "jo@example.com",
    "id": "s_1234567abcd",
    "phone_number": "+14155550123",
    "properties": {
      "birthday": "1991-01-01",
      "has_purchased": true
    },
    "ps_id": 42,
    "shopify_customer_id": 6123456789,
    "subscriptions": {
      "promotional": {
        "can_send": true
      },
      "transactional": {
        "can_send": true
      }
    },
    "tags": [
      "VIP",
      "Gold"
    ],
    "updated_at": "2026-10-16T09:00:00Z"
  }
}
```

### Update webhook

Change where a webhook sends, or add or change its headers. The headers not named are kept.

**Inputs**

- Webhook (`webhook_id`, text, required): The webhook. Pick one, or give its id from an earlier step.
- Address (`callback_url`, text): A new https:// address. Leave empty to keep it.
- Headers (`headers`, object): Header names and values Postscript adds to every delivery, such as a token your endpoint checks.

**Outputs**

- `webhook` (object): The webhook

**Example output**

```json
{
  "webhook": {
    "callback_url": "https://example.com/postscript",
    "created_at": "2026-10-15T09:00:00Z",
    "event": "shop.subscriber.opt_in",
    "headers": {
      "X-Token": "abc123"
    },
    "id": "a47606a1-5b39-4a81-9480-c2cb738ff675",
    "updated_at": "2026-10-15T09:00:00Z"
  }
}
```
