---
search:
  tags:
    - customers
    - POST
seo:
  description: >-
    Inbound SMS agent webhook (PILE-395). An SMS provider… Reference for the
    POST /workspaces/{organizationId}/customers/sms-inbound endpoint in the Pile
    API.
sidebar:
  label: Create customer sms inbound
  badge: POST
title: Create customer sms inbound
type: openapi-operation
---
Inbound SMS agent webhook (PILE-395). An SMS provider (Sendblue-style) POSTs each inbound text; a deterministic parser performs CRM ops on the sender's customer record — knock/visit logging, quoted-$ → proposal deal, follow-up scheduling, and 'what's due' list. Auth is a shared webhook secret via ?secret= or the x-sms-secret header compared against SMS_INBOUND_SECRET; the endpoint refuses (503 NOT_CONFIGURED) when the secret is unset so inbound is never unauthenticated. Retries dedupe on messageId.

`POST /workspaces/{organizationId}/customers/sms-inbound`

**Request body** (`application/json`)

- `from` (string, required)
- `text` (string, required)
- `to` (string)
- `messageId` (string)
- `receivedAt` (string)

Request body example:

```json
{
  "from": "string",
  "text": "string",
  "to": "string",
  "messageId": "string",
  "receivedAt": "string"
}
```

**Responses**

- `200` — SMS interpreted — actions taken plus the SMS reply text
- `401` — Missing or invalid webhook secret
- `503` — SMS\_INBOUND\_SECRET not configured

Response example, 200:

```json
{
  "ok": true,
  "deduplicated": true,
  "customer": {
    "id": "string",
    "name": "string",
    "phone": "string",
    "statusId": "string",
    "nextStepText": "string",
    "nextStepDueAt": "string"
  },
  "actions": [
    {
      "type": "interaction_logged",
      "interactionId": "string",
      "outcome": "string"
    }
  ],
  "replyText": "string"
}
```
