{
  "info": {
    "name": "Labspace SMS API v2",
    "description": "Labspace SMS 企業簡訊平台 API v2 官方 Postman Collection。\n\n使用方式：\n1. 匯入後於 Variables 確認 base_url_v2（正式站 https://sms-api.labspace.com.tw）\n2. 於會員中心建立 API Key，填入 jwt_token 變數\n3. 所有請求皆以 Authorization: Bearer {{jwt_token}} 認證\n\n文件：https://sms.labspace.com.tw/docs",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "📦 API v2 · Phase 7 (2026-08-07)",
      "description": "客戶可用 API · 涵蓋 7/15 以來新加所有 endpoint。詳見 docs/20260807-CLIENT_FACING_API_INDEX.md",
      "item": [
        {
          "name": "🗓 排程發送",
          "description": "排程時間 5min~30day、TW 時區。scheduled_at 有值走排程分流、不呼叫 provider、不扣點",
          "item": [
            {
              "name": "POST /send · 立即送",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/send",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "send"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"dstaddr\": \"0912345678\",\n  \"smbody\": \"測試訊息\"\n}"
                }
              },
              "response": [],
              "description": "單筆立即送 · 不帶 scheduled_at"
            },
            {
              "name": "POST /send · 排程送",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/send",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "send"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"dstaddr\": \"0912345678\",\n  \"smbody\": \"排程訊息\",\n  \"scheduled_at\": \"2026-08-10 09:00:00\"\n}"
                }
              },
              "response": [],
              "description": "單筆排程 · 帶 scheduled_at (2026-08-07 加)"
            },
            {
              "name": "POST /send/bulk · 立即送",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/send/bulk",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "send",
                    "bulk"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"upload_id\": \"<from-bulk-upload>\",\n  \"message\": \"訊息 template\",\n  \"phone_column\": \"phone\"\n}"
                }
              },
              "response": [],
              "description": "批次立即送 · 先呼叫 /bulk-upload 取得 upload_id"
            },
            {
              "name": "POST /send/bulk · 排程送",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/send/bulk",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "send",
                    "bulk"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"upload_id\": \"<from-bulk-upload>\",\n  \"message\": \"訊息 template\",\n  \"phone_column\": \"phone\",\n  \"scheduled_at\": \"2026-08-10 09:00:00\"\n}"
                }
              },
              "response": [],
              "description": "批次排程"
            },
            {
              "name": "GET /sms/scheduled · 排程佇列",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/sms/scheduled",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "sms",
                    "scheduled"
                  ]
                }
              },
              "response": [],
              "description": "回自己所有排程 · 依 scheduled_at desc · 限 50 筆"
            },
            {
              "name": "GET /sms/scheduled/{batch_id} · 排程 detail",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/sms/scheduled/{{batch_id}}",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "sms",
                    "scheduled",
                    "{{batch_id}}"
                  ]
                }
              },
              "response": [],
              "description": "看完整內容 + 收件人清單 + 統計 (2026-08-07 加)"
            },
            {
              "name": "DELETE /sms/scheduled/{batch_id} · 取消",
              "request": {
                "method": "DELETE",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/sms/scheduled/{{batch_id}}",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "sms",
                    "scheduled",
                    "{{batch_id}}"
                  ]
                }
              },
              "response": [],
              "description": "只能取消 queued 狀態、其他 404"
            },
            {
              "name": "GET /sms/available-points · 可用點數",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/sms/available-points",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "sms",
                    "available-points"
                  ]
                }
              },
              "response": [],
              "description": "回 last_total / queued_reserved / available_for_new"
            }
          ]
        },
        {
          "name": "👥 子帳號 API 代送",
          "description": "母帳號 API 指定發送歸屬給某個子帳號 · 點數扣母、統計歸子",
          "item": [
            {
              "name": "POST /send · 代子帳號送",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/send",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "send"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"dstaddr\": \"0912345678\",\n  \"smbody\": \"訊息\",\n  \"sub_account_id\": 15\n}"
                }
              },
              "response": [],
              "description": "sub_account_id 必須屬同戶 + status=1"
            },
            {
              "name": "POST /send/bulk · 代子帳號批次送",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/send/bulk",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "send",
                    "bulk"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"upload_id\": \"<x>\",\n  \"message\": \"訊息\",\n  \"phone_column\": \"phone\",\n  \"sub_account_id\": 15\n}"
                }
              },
              "response": [],
              "description": "同上 · 批次版"
            }
          ]
        },
        {
          "name": "🧾 Portal 電子發票查詢",
          "description": "客戶自助查發票 · PDF binary 需 fetch+blob (不能 window.open)",
          "item": [
            {
              "name": "GET /me/invoices · 列表",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/me/invoices",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "me",
                    "invoices"
                  ],
                  "query": [
                    {
                      "key": "page",
                      "value": "1"
                    },
                    {
                      "key": "limit",
                      "value": "20"
                    }
                  ]
                }
              },
              "response": [],
              "description": "分頁、可 filter year"
            },
            {
              "name": "GET /me/invoices/{id} · 詳細",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/me/invoices/{{invoice_id}}",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "me",
                    "invoices",
                    "{{invoice_id}}"
                  ]
                }
              },
              "response": [],
              "description": "含 pm_invoice_id / tax_amount / buyer info"
            },
            {
              "name": "GET /me/invoices/{id}/pdf · PDF 下載",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/me/invoices/{{invoice_id}}/pdf",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "me",
                    "invoices",
                    "{{invoice_id}}",
                    "pdf"
                  ]
                }
              },
              "response": [],
              "description": "Response: application/pdf binary。前端注意: fetch+blob、不能 window.open"
            }
          ]
        },
        {
          "name": "🏷 實名品牌 tag 客戶自助",
          "description": "wisetech 事件觸發 · 電信端反詐騙 · 訊息開頭【】品牌需登記",
          "item": [
            {
              "name": "GET /realname/whitelist · 已核准清單",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/realname/whitelist",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "realname",
                    "whitelist"
                  ]
                }
              },
              "response": [],
              "description": "含 auto_legit_brands (公司名 + 客戶名自動放行)"
            },
            {
              "name": "POST /realname/applications · 提出申請",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "multipart/form-data",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/realname/applications",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "realname",
                    "applications"
                  ]
                }
              },
              "response": [],
              "description": "multipart/form-data · evidence_file JPG/PNG 3MB · 對齊三竹規格"
            },
            {
              "name": "GET /me/realname/applications/{id}/evidence · 看證明檔",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/me/realname/applications/{{application_id}}/evidence",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "me",
                    "realname",
                    "applications",
                    "{{application_id}}",
                    "evidence"
                  ]
                }
              },
              "response": [],
              "description": "Image binary · 同 pdf fetch+blob"
            },
            {
              "name": "GET /realname/whitelist/check · 送前檢查 (tag)",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/realname/whitelist/check",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "realname",
                    "whitelist",
                    "check"
                  ],
                  "query": [
                    {
                      "key": "tag",
                      "value": "男人夢想網"
                    }
                  ]
                }
              },
              "response": [],
              "description": "用 ?tag=<品牌名>"
            },
            {
              "name": "GET /realname/whitelist/check · 送前檢查 (smbody)",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/realname/whitelist/check",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "realname",
                    "whitelist",
                    "check"
                  ],
                  "query": [
                    {
                      "key": "smbody",
                      "value": "【男人夢想網】您的驗證碼 123456"
                    }
                  ]
                }
              },
              "response": [],
              "description": "用 ?smbody=<整則訊息> · 後端幫抽 tag (2026-08-07 加、B2B 友善)"
            }
          ]
        },
        {
          "name": "📜 Lab-URL 授權管理",
          "description": "Consent + first-login · Portal 內部 flow · 對外文件不必列",
          "item": [
            {
              "name": "GET /consents · 查同意狀態",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/consents",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "consents"
                  ]
                }
              },
              "response": [],
              "description": "列所有 partner consent"
            },
            {
              "name": "POST /consents/{channel} · 授予同意",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/consents/lab-url",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "consents",
                    "lab-url"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"scope\": \"provision\"\n}"
                }
              },
              "response": [],
              "description": "partner_channel 目前只有 lab-url"
            },
            {
              "name": "DELETE /consents/{channel} · 撤回同意",
              "request": {
                "method": "DELETE",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/consents/lab-url",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "consents",
                    "lab-url"
                  ]
                }
              },
              "response": [],
              "description": "撤回後 partner 端 provision 會被擋"
            },
            {
              "name": "POST /settings/lab-url/first-login-complete",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{jwt_token}}",
                    "type": "text"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json",
                    "type": "text"
                  }
                ],
                "url": {
                  "raw": "{{base_url_v2}}/api/v2/settings/lab-url/first-login-complete",
                  "host": [
                    "{{base_url_v2}}"
                  ],
                  "path": [
                    "api",
                    "v2",
                    "settings",
                    "lab-url",
                    "first-login-complete"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"url\": \"https://portal.lab-url.com/first-login/xxx\"\n}"
                }
              },
              "response": [],
              "description": "Lab-URL 首次登入後通知 sms mark done"
            }
          ]
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "base_url_v2",
      "value": "https://sms-api.labspace.com.tw"
    },
    {
      "key": "jwt_token",
      "value": ""
    }
  ]
}