{
  "info": {
    "name": "SafeEdge SMS API",
    "description": "The SafeEdge SMS API sends text messages to Ghana mobile numbers under your approved sender IDs, tells you\nexactly what happened to each one, and lets you buy SMS units.\n\n**Base URL:** `https://api.dinn.safeedgesystems.com`\n\n**Authentication:** every request carries your API key: `Authorization: Bearer ssk_live_…` (or `ssk_test_…`).\nA test key goes to the provider's sandbox: nothing is delivered and nothing is charged.\n\n**Answers:** success is `{ \"data\": … }`; a list adds `{ \"pagination\": { \"has_more\", \"next_cursor\" } }`; a failure is\n`{ \"error\": { \"code\", \"message\" } }` with one of the codes listed under **Error**. Every answer carries an\n`X-Request-Id` header: quote it when you contact SafeEdge.\n\n**Money** is in pesewas (GHS 1.00 = 100). **Times** are ISO 8601 in UTC (Ghana time).\n\n\nSet the collection variable `api_key` to your key (start with a test key).",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{api_key}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.dinn.safeedgesystems.com"
    },
    {
      "key": "api_key",
      "value": "ssk_test_"
    }
  ],
  "item": [
    {
      "name": "Account",
      "description": "Your account, units and limits.",
      "item": [
        {
          "name": "Your account",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/account",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "account"
              ]
            },
            "description": "Scope `read`."
          }
        },
        {
          "name": "Set your low-balance alert",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"low_balance_units\": 500\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/v1/account",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "account"
              ]
            },
            "description": "Scope `read`. The `balance.low` webhook fires once when your units fall below this level."
          }
        },
        {
          "name": "Your units statement",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/account/units",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "account",
                "units"
              ]
            },
            "description": "Every movement of your units, newest first. Scope `read`."
          }
        }
      ]
    },
    {
      "name": "Sender IDs",
      "description": "The names your messages are sent under. SafeEdge approves each one.",
      "item": [
        {
          "name": "Your sender IDs",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/sender-ids",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "sender-ids"
              ]
            },
            "description": "Scope `read`. Only a sender ID with `can_send` true can send."
          }
        },
        {
          "name": "Can this name be had?",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/sender-ids/check",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "sender-ids",
                "check"
              ],
              "query": [
                {
                  "key": "name",
                  "value": "ACMESHOP",
                  "disabled": true
                }
              ]
            },
            "description": "Scope `read`."
          }
        },
        {
          "name": "Ask for a new sender ID",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"sender_id\": \"ACMESHOP\",\n  \"description\": \"Order confirmations and delivery updates for customers of the Acme Shop online store in Accra.\",\n  \"organization_type\": \"Company\",\n  \"organization_name\": \"Acme Shop Ltd\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/v1/sender-ids/requests",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "sender-ids",
                "requests"
              ]
            },
            "description": "Scope `read`. SafeEdge reviews the request; nothing reaches the network registry until SafeEdge approves it.\nAt most 5 requests a day. A name the registry once refused can never be registered again, so check first.\n"
          }
        }
      ]
    },
    {
      "name": "Messages",
      "description": "Sending, and the log of everything you sent.",
      "item": [
        {
          "name": "The message log",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/messages",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "messages"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "delivered,failed",
                  "disabled": true
                },
                {
                  "key": "batch_id",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "sender_id",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "reference",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "to",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "mode",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "created_after",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "created_before",
                  "value": "",
                  "disabled": true
                }
              ]
            },
            "description": "Everything you sent, newest first. Scope `read`."
          }
        },
        {
          "name": "Send messages",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"sender_id\": \"ACMESHOP\",\n  \"message\": \"Hello {name}, order {order} has shipped.\",\n  \"recipients\": [\n    {\n      \"to\": \"0241234567\",\n      \"variables\": {\n        \"name\": \"Ama\",\n        \"order\": \"A12\"\n      },\n      \"reference\": \"ord-1\"\n    },\n    \"0201234567\",\n    {\n      \"to\": \"+233551234567\",\n      \"message\": \"A text just for this one\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/v1/messages",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "messages"
              ]
            },
            "description": "Scope `send`. 1 to 1000 recipients per request. Every recipient is answered, in order, with its own message id\nand status. A recipient that is `blocked` (invalid number, duplicate, missing variable, too long, spam,\nopted out) is never sent and never charged.\n\nOne unit is one page as the provider bills it: 150 characters of plain text a unit, or, when the text has\ncharacters outside the standard SMS alphabet such as emoji, 70 for one unit and then 67 a unit. At most 10.\n\nThe whole request is refused, and nothing is stored, when the account is suspended, the sender ID is not one\nof your approved ones, a limit is reached, or there are not enough units.\n"
          }
        },
        {
          "name": "Dry run",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/v1/messages/check",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "messages",
                "check"
              ]
            },
            "description": "Scope `send`. Exactly the checks a send makes, with the final text of each message, its pages and units, the\nunits needed against the units you have, and whether the send would wait for review. Nothing is stored,\nsent or charged.\n"
          }
        },
        {
          "name": "One message and its journey",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/messages/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "messages",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "description": "Scope `read`."
          }
        }
      ]
    },
    {
      "name": "Batches",
      "description": "One batch per send request.",
      "item": [
        {
          "name": "Your batches",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/batches",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "batches"
              ],
              "query": [
                {
                  "key": "mode",
                  "value": "",
                  "disabled": true
                }
              ]
            },
            "description": "Scope `read`."
          }
        },
        {
          "name": "One batch",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/batches/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "batches",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "description": "Scope `read`. Its messages are at `GET /v1/messages?batch_id=`."
          }
        }
      ]
    },
    {
      "name": "Usage",
      "description": "What you sent and spent, per day.",
      "item": [
        {
          "name": "Usage per day",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/usage",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "usage"
              ],
              "query": [
                {
                  "key": "from",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "to",
                  "value": "",
                  "disabled": true
                }
              ]
            },
            "description": "Scope `read`. Live messages are counted; test sends apart. At most 92 days; the last 30 by default."
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "description": "Your own HTTPS endpoints, told the moment something changes.",
      "item": [
        {
          "name": "Your endpoints",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/webhooks",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ]
            },
            "description": "Scope `read`. Never shows a secret."
          }
        },
        {
          "name": "Add an endpoint",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://shop.acme.example/safeedge-hooks\",\n  \"events\": [\n    \"message.status_changed\",\n    \"balance.low\",\n    \"purchase.completed\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/v1/webhooks",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ]
            },
            "description": "Scope `read`. At most 5 endpoints. The URL must be `https://` on a public host name (not an IP address or a\nprivate name). **The signing secret is in this answer once**: store it now.\n"
          }
        },
        {
          "name": "Change an endpoint",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/v1/webhooks/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id"
              ]
            },
            "description": "Scope `read`. A field left out stays as it is. Switching an endpoint back on clears its failures."
          }
        },
        {
          "name": "Delete an endpoint",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/webhooks/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id"
              ]
            },
            "description": "Scope `read`."
          }
        },
        {
          "name": "A new signing secret",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/webhooks/:id/rotate-secret",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id",
                "rotate-secret"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "description": "Scope `read`. The new secret is in this answer once; the old one stops working at once."
          }
        },
        {
          "name": "Send a test event",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/webhooks/:id/test",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id",
                "test"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "description": "Scope `read`. A `webhook.test` event to this endpoint only."
          }
        },
        {
          "name": "Deliveries to an endpoint",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/webhooks/:id/deliveries",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id",
                "deliveries"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "",
                  "disabled": true
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "description": "Scope `read`. Every delivery and its outcome, newest first."
          }
        },
        {
          "name": "Send a delivery again",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/webhooks/:id/deliveries/:delivery_id/retry",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":id",
                "deliveries",
                ":delivery_id",
                "retry"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                },
                {
                  "key": "delivery_id",
                  "value": ""
                }
              ]
            },
            "description": "Scope `read`. Now, with a fresh retry schedule."
          }
        }
      ]
    },
    {
      "name": "Purchases",
      "description": "Buying SMS units.",
      "item": [
        {
          "name": "Packages you can buy",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/packages",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "packages"
              ]
            },
            "description": "Scope `read`."
          }
        },
        {
          "name": "Your purchases",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/purchases",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "purchases"
              ]
            },
            "description": "Scope `billing`."
          }
        },
        {
          "name": "Buy a package",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"package_id\": \"6f1c2f9e-4b7a-4c55-9a51-1f2a3b4c5d6e\",\n  \"method\": \"checkout\",\n  \"callback_url\": \"https://shop.acme.example/paid\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/v1/purchases",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "purchases"
              ]
            },
            "description": "Scope `billing`. Two ways to pay:\n\n* `checkout`: a Paystack page (card or mobile money). Send the payer to `checkout_url`. Paystack's charge is\n  added on top (`surcharge_pesewas`). `callback_url` is where Paystack sends them back.\n* `send_and_claim`: pay `amount_pesewas` by mobile money to the merchant number and quote the `code` as the\n  reference. No charge on top.\n\nThe units arrive the moment the payment is confirmed, with a `purchase.completed` webhook. An unpaid checkout\nexpires after 24 hours. At most 5 unpaid purchases at once.\n"
          }
        },
        {
          "name": "One purchase",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/purchases/:id",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "purchases",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            },
            "description": "Scope `billing`. A pending checkout is checked with Paystack before the answer."
          }
        }
      ]
    },
    {
      "name": "Opt-outs",
      "description": "Numbers that must get no more of your messages.",
      "item": [
        {
          "name": "Your opt-out list",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/v1/opt-outs",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "opt-outs"
              ]
            },
            "description": "Scope `read`."
          }
        },
        {
          "name": "Opt a number out",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/v1/opt-outs",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "opt-outs"
              ]
            },
            "description": "Scope `read`. A send to this number is then blocked (`opted_out`) and never charged."
          }
        },
        {
          "name": "Take a number off the list",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{base_url}}/v1/opt-outs/remove",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "v1",
                "opt-outs",
                "remove"
              ]
            },
            "description": "Scope `read`. The number is in the body, never in a URL."
          }
        }
      ]
    }
  ]
}
