{
  "_type": "export",
  "__export_format": 4,
  "__export_source": "smsfabric.quickstart",
  "resources": [
    {
      "_id": "wrk_smsfabric",
      "_type": "workspace",
      "parentId": null,
      "name": "SMSFabric API",
      "description": "The SMSFabric API with an API key: send a message, read its timeline, then verify, contacts, templates, campaigns and webhooks. Set `apiKey` to a key from the API keys page of the web app (a test key sends through the sandbox).",
      "scope": "collection"
    },
    {
      "_id": "env_smsfabric_base",
      "_type": "environment",
      "parentId": "wrk_smsfabric",
      "name": "Base Environment",
      "data": {
        "baseUrl": "https://api.smsfabric.com",
        "apiKey": "",
        "messageId": "",
        "poolId": "",
        "scheduledAt": "",
        "verificationId": "",
        "templateId": "",
        "campaignId": "",
        "webhookId": ""
      }
    },
    {
      "_id": "fld_messages",
      "_type": "request_group",
      "parentId": "wrk_smsfabric",
      "name": "Messages",
      "metaSortKey": 100
    },
    {
      "_id": "req_messages_send",
      "_type": "request",
      "parentId": "fld_messages",
      "name": "Send a message",
      "description": "Sends one SMS through your default SIM. Answers 201 with the message in `data[0]`, status `queued`. Needs the `messages:send` scope. `to` also takes up to 100 numbers.",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/messages",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Idempotency-Key",
          "value": "{% uuid 'v4' %}"
        }
      ],
      "parameters": [],
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"to\": \"+201001234567\",\n  \"body\": \"Your order is out for delivery.\"\n}"
      },
      "authentication": {},
      "metaSortKey": 200
    },
    {
      "_id": "req_messages_send_to_pool",
      "_type": "request",
      "parentId": "fld_messages",
      "name": "Send through a pool",
      "description": "Routes round-robin over the online phones in the pool. If a phone drops, another phone in the pool takes the message. Run \"Create a pool\" first and put at least one phone in it.",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/messages",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Idempotency-Key",
          "value": "{% uuid 'v4' %}"
        }
      ],
      "parameters": [],
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"to\": \"+201001234567\",\n  \"body\": \"Your order is out for delivery.\",\n  \"poolId\": \"{{ _.poolId }}\"\n}"
      },
      "authentication": {},
      "metaSortKey": 300
    },
    {
      "_id": "req_messages_schedule",
      "_type": "request",
      "parentId": "fld_messages",
      "name": "Schedule a message",
      "description": "Sends at `scheduledAt` (ISO 8601, UTC). Answers 403 `feature_not_in_plan` when the plan has no scheduled sends.",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/messages",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Idempotency-Key",
          "value": "{% uuid 'v4' %}"
        }
      ],
      "parameters": [],
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"to\": \"+201001234567\",\n  \"body\": \"Your order is out for delivery.\",\n  \"scheduledAt\": \"{{ _.scheduledAt }}\"\n}"
      },
      "authentication": {},
      "metaSortKey": 400
    },
    {
      "_id": "req_messages_get",
      "_type": "request",
      "parentId": "fld_messages",
      "name": "Get a message with its timeline",
      "description": "The message plus `events[]`: every step from queued to delivered or failed, with times.",
      "method": "GET",
      "url": "{{ _.baseUrl }}/v1/messages/{{ _.messageId }}",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        }
      ],
      "parameters": [],
      "body": {},
      "authentication": {},
      "metaSortKey": 500
    },
    {
      "_id": "req_messages_list",
      "_type": "request",
      "parentId": "fld_messages",
      "name": "List messages",
      "description": "A page of messages. Filters: `direction`, `status`, `deviceId`, `campaignId`, `q` (phone), `from`, `to`. Pass `nextCursor` back as `cursor` for the next page.",
      "method": "GET",
      "url": "{{ _.baseUrl }}/v1/messages",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        }
      ],
      "parameters": [
        {
          "name": "direction",
          "value": "outbound"
        },
        {
          "name": "limit",
          "value": "20"
        }
      ],
      "body": {},
      "authentication": {},
      "metaSortKey": 600
    },
    {
      "_id": "fld_devices",
      "_type": "request_group",
      "parentId": "wrk_smsfabric",
      "name": "Devices",
      "metaSortKey": 700
    },
    {
      "_id": "req_devices_list",
      "_type": "request",
      "parentId": "fld_devices",
      "name": "List devices",
      "description": "Your paired phones with `status`, `battery`, `signal`, `lastSeenAt` and `sims[]`.",
      "method": "GET",
      "url": "{{ _.baseUrl }}/v1/devices",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        }
      ],
      "parameters": [],
      "body": {},
      "authentication": {},
      "metaSortKey": 800
    },
    {
      "_id": "fld_pools",
      "_type": "request_group",
      "parentId": "wrk_smsfabric",
      "name": "Pools",
      "metaSortKey": 900
    },
    {
      "_id": "req_pools_create",
      "_type": "request",
      "parentId": "fld_pools",
      "name": "Create a pool",
      "description": "A pool is a group of phones that take over for each other. Needs the `devices:manage` scope. Add a phone with `PATCH /v1/devices/:id { poolId }`. Answers 409 `pool_exists` for a name already in use.",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/pools",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "parameters": [],
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"name\": \"Cairo\"\n}"
      },
      "authentication": {},
      "metaSortKey": 1000
    },
    {
      "_id": "fld_verify",
      "_type": "request_group",
      "parentId": "wrk_smsfabric",
      "name": "Verify",
      "metaSortKey": 1100
    },
    {
      "_id": "req_verify_send",
      "_type": "request",
      "parentId": "fld_verify",
      "name": "Send a code",
      "description": "Texts a 6-digit code that expires in 10 minutes. The code is never in the response: only the recipient sees it. Needs the `verify:send` scope. Optional: `locale` (`en` or `ar`), `codeLength`, `ttlSeconds`, `template`.",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/verifications",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Idempotency-Key",
          "value": "{% uuid 'v4' %}"
        }
      ],
      "parameters": [],
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"to\": \"+201001234567\",\n  \"channel\": \"sms\"\n}"
      },
      "authentication": {},
      "metaSortKey": 1200
    },
    {
      "_id": "req_verify_check",
      "_type": "request",
      "parentId": "fld_verify",
      "name": "Check a code",
      "description": "Replace `code` with the digits the phone received. `approved` means it matched; `pending` comes with `attemptsLeft`; the 5th wrong code is `denied`. Needs the `verify:check` scope.",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/verifications/{{ _.verificationId }}/check",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "parameters": [],
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"code\": \"123456\"\n}"
      },
      "authentication": {},
      "metaSortKey": 1300
    },
    {
      "_id": "req_verify_get",
      "_type": "request",
      "parentId": "fld_verify",
      "name": "Get a verification",
      "description": "Status, attempts and expiry. `to` is masked to the calling code and the last 4 digits.",
      "method": "GET",
      "url": "{{ _.baseUrl }}/v1/verifications/{{ _.verificationId }}",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        }
      ],
      "parameters": [],
      "body": {},
      "authentication": {},
      "metaSortKey": 1400
    },
    {
      "_id": "fld_contacts",
      "_type": "request_group",
      "parentId": "wrk_smsfabric",
      "name": "Contacts",
      "metaSortKey": 1500
    },
    {
      "_id": "req_contacts_create",
      "_type": "request",
      "parentId": "fld_contacts",
      "name": "Create a contact",
      "description": "One contact per number. Answers 409 `contact_exists` for a number you already have. Needs the `contacts:manage` scope.",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/contacts",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Idempotency-Key",
          "value": "{% uuid 'v4' %}"
        }
      ],
      "parameters": [],
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"phone\": \"+201001234567\",\n  \"firstName\": \"Mona\",\n  \"lastName\": \"Hassan\",\n  \"tags\": [\n    \"vip\"\n  ],\n  \"consent\": {\n    \"source\": \"api\"\n  }\n}"
      },
      "authentication": {},
      "metaSortKey": 1600
    },
    {
      "_id": "req_contacts_list",
      "_type": "request",
      "parentId": "fld_contacts",
      "name": "List contacts",
      "description": "Newest first. Filters: `q` (number, last 4 digits, name or email), `tag`, `groupId`, `optedOut`.",
      "method": "GET",
      "url": "{{ _.baseUrl }}/v1/contacts",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        }
      ],
      "parameters": [
        {
          "name": "tag",
          "value": "vip"
        },
        {
          "name": "limit",
          "value": "20"
        }
      ],
      "body": {},
      "authentication": {},
      "metaSortKey": 1700
    },
    {
      "_id": "fld_templates",
      "_type": "request_group",
      "parentId": "wrk_smsfabric",
      "name": "Templates",
      "metaSortKey": 1800
    },
    {
      "_id": "req_templates_create",
      "_type": "request",
      "parentId": "fld_templates",
      "name": "Create a template",
      "description": "Variables are `{{first_name}}`, `{{last_name}}` and `{{custom.<key>}}`, each with an optional fallback after `|`. Needs the `campaigns:manage` scope. Answers 409 `template_exists` for a name already in use.",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/templates",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "parameters": [],
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"name\": \"Out for delivery\",\n  \"body\": \"Hi {% raw %}{{first_name|there}}{% endraw %}, your order is out for delivery.\"\n}"
      },
      "authentication": {},
      "metaSortKey": 1900
    },
    {
      "_id": "req_templates_preview",
      "_type": "request",
      "parentId": "fld_templates",
      "name": "Preview a template",
      "description": "Renders the text for a sample contact (or add `contactId` for a real one) and counts segments. Problems come back in `issues`, never as a 400.",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/templates/preview",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "parameters": [],
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"body\": \"Hi {% raw %}{{first_name|there}}{% endraw %}, your order is out for delivery.\"\n}"
      },
      "authentication": {},
      "metaSortKey": 2000
    },
    {
      "_id": "fld_campaigns",
      "_type": "request_group",
      "parentId": "wrk_smsfabric",
      "name": "Campaigns",
      "metaSortKey": 2100
    },
    {
      "_id": "req_campaigns_create",
      "_type": "request",
      "parentId": "fld_campaigns",
      "name": "Create a campaign",
      "description": "Creates a draft for every contact tagged `vip`. Nothing is sent until `POST /v1/campaigns/:id/start`. Needs the `campaigns:manage` scope.",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/campaigns",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "parameters": [],
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"name\": \"Delivery notice\",\n  \"tags\": [\n    \"vip\"\n  ],\n  \"templateId\": \"{{ _.templateId }}\",\n  \"ratePerMinute\": 60\n}"
      },
      "authentication": {},
      "metaSortKey": 2200
    },
    {
      "_id": "req_campaigns_estimate",
      "_type": "request",
      "parentId": "fld_campaigns",
      "name": "Estimate a campaign",
      "description": "Recipients, exclusions, segments and how long the send takes on your phones. Sends nothing.",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/campaigns/{{ _.campaignId }}/estimate",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        }
      ],
      "parameters": [],
      "body": {},
      "authentication": {},
      "metaSortKey": 2300
    },
    {
      "_id": "fld_webhooks",
      "_type": "request_group",
      "parentId": "wrk_smsfabric",
      "name": "Webhooks",
      "metaSortKey": 2400
    },
    {
      "_id": "req_webhooks_create",
      "_type": "request",
      "parentId": "fld_webhooks",
      "name": "Create a webhook",
      "description": "Replace `url` with your HTTPS endpoint. The response includes `signingSecret` once: store it to verify the `SMSFabric-Signature` header. Needs the `webhooks:manage` scope.",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/webhooks",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "parameters": [],
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"url\": \"https://example.com/hooks/smsfabric\",\n  \"events\": [\n    \"message.delivered\",\n    \"message.failed\",\n    \"message.received\"\n  ]\n}"
      },
      "authentication": {},
      "metaSortKey": 2500
    },
    {
      "_id": "req_webhooks_test",
      "_type": "request",
      "parentId": "fld_webhooks",
      "name": "Send a test event",
      "description": "Sends a `webhook.test` event to the endpoint, signed like any other.",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/webhooks/{{ _.webhookId }}/test",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        }
      ],
      "parameters": [],
      "body": {},
      "authentication": {},
      "metaSortKey": 2600
    },
    {
      "_id": "req_webhooks_deliveries",
      "_type": "request",
      "parentId": "fld_webhooks",
      "name": "List deliveries",
      "description": "Each attempt to reach your endpoint. A delivery that fails is tried up to 8 times over about 24 hours.",
      "method": "GET",
      "url": "{{ _.baseUrl }}/v1/webhooks/{{ _.webhookId }}/deliveries",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        }
      ],
      "parameters": [],
      "body": {},
      "authentication": {},
      "metaSortKey": 2700
    },
    {
      "_id": "fld_blacklist",
      "_type": "request_group",
      "parentId": "wrk_smsfabric",
      "name": "Blacklist",
      "metaSortKey": 2800
    },
    {
      "_id": "req_blacklist_add",
      "_type": "request",
      "parentId": "fld_blacklist",
      "name": "Block a number",
      "description": "Sends to this number come back with status `blocked`. Needs the `blacklist:manage` scope.",
      "method": "POST",
      "url": "{{ _.baseUrl }}/v1/blacklist",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        },
        {
          "name": "Content-Type",
          "value": "application/json"
        }
      ],
      "parameters": [],
      "body": {
        "mimeType": "application/json",
        "text": "{\n  \"phone\": \"+201009876543\",\n  \"reason\": \"Asked not to be contacted\"\n}"
      },
      "authentication": {},
      "metaSortKey": 2900
    },
    {
      "_id": "req_blacklist_list",
      "_type": "request",
      "parentId": "fld_blacklist",
      "name": "List blocked numbers",
      "description": "`source` is `manual`, or `opt_out` when the recipient replied STOP.",
      "method": "GET",
      "url": "{{ _.baseUrl }}/v1/blacklist",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        }
      ],
      "parameters": [],
      "body": {},
      "authentication": {},
      "metaSortKey": 3000
    },
    {
      "_id": "fld_plan",
      "_type": "request_group",
      "parentId": "wrk_smsfabric",
      "name": "Plan",
      "metaSortKey": 3100
    },
    {
      "_id": "req_plan_get",
      "_type": "request",
      "parentId": "fld_plan",
      "name": "Get your plan and usage",
      "description": "Limits, features and what you have used today and this month, with `dayResetsAt` and `monthResetsAt`.",
      "method": "GET",
      "url": "{{ _.baseUrl }}/v1/org/plan",
      "headers": [
        {
          "name": "X-Api-Key",
          "value": "{{ _.apiKey }}"
        }
      ],
      "parameters": [],
      "body": {},
      "authentication": {},
      "metaSortKey": 3200
    }
  ]
}
