sent-profile-provisioning
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSent Profile Provisioning
Sent配置文件预配
This skill is the execution counterpart to profile architecture: once the tenancy boundary is decided, it drives the API calls, the completion callback, the campaign registration, and the user administration that make a profile able to send. Design the boundary with first; provision it here.
sender-profile-architect本技能是配置文件架构的执行环节:一旦确定租户边界,它将驱动API调用、完成回调、活动注册以及用户管理操作,使配置文件具备发送能力。请先使用设计边界,再在此处进行预配。
sender-profile-architectProvisioning sequence
预配流程
- Confirm the credential. requires an organization key with
POST /v3/profiles. Profile-scoped keys cannot create profiles, and a profile key that sendsadminreceivesx-profile-id.403 - Decide inheritance and sharing before the call. These flags shape compliance posture and are awkward to unwind later.
- Create the profile, validating the payload with first when the shape is uncertain. Use a different idempotency key for the live create because a successful sandbox response is cached for 24 hours.
"sandbox": true - Attach or inherit WhatsApp via exactly one of the three supported paths.
- Register campaigns for US SMS under the profile.
- Complete the profile with and a reachable
POST /v3/profiles/{profileId}/complete.webHookUrl - Reconcile status from the callback, or by polling if the callback is missed.
- Invite users with least-privilege roles.
- 确认凭证。接口需要具备
POST /v3/profiles权限的组织密钥。配置文件级别的密钥无法创建配置文件,携带admin的配置文件密钥会返回x-profile-id错误。403 - 调用前确定继承与共享设置。这些标志会影响合规状态,后续修改较为繁琐。
- 创建配置文件,当不确定请求体格式时,先使用验证请求体。正式创建时需使用不同的幂等键,因为成功的沙箱响应会被缓存24小时。
"sandbox": true - 通过以下三种支持路径之一关联或继承WhatsApp。
- 为配置文件下的美国短信注册活动。
- 调用完成配置文件,并提供可访问的
POST /v3/profiles/{profileId}/complete。webHookUrl - 通过回调协调状态,若错过回调则通过轮询获取。
- 邀请用户并分配最小权限角色。
Create payload essentials
创建请求体要点
namejson
{
"name": "Northwind Retail",
"short_name": "Northwind",
"description": "Retail brand tenant",
"allow_contact_sharing": false,
"allow_template_sharing": false,
"inherit_contacts": false,
"inherit_templates": false,
"inherit_tcr_brand": true,
"inherit_tcr_campaign": true,
"billing_model": "profile",
"billing_contact": {
"name": "Ada Ops",
"email": "ops@example.com",
"phone": "+14155550100",
"address": "1 Example Way, Springfield"
},
"sandbox": true
}short_nameCreate permits alone, but completion also requires , , profile KYC information, and any required campaign or channel setup. When is true, the API rejects a object in the create request even though the profile still needs its own KYC submission; complete that KYC through the dashboard before calling the completion endpoint.
nameshort_namedescriptioninherit_tcr_brandbrandbilling_modelprofileorganizationprofile_and_organizationprofilebilling_contactpayment_detailsField-by-field rules, error codes, and the update-only fields are in references/profile-lifecycle.md.
namejson
{
"name": "Northwind Retail",
"short_name": "Northwind",
"description": "Retail brand tenant",
"allow_contact_sharing": false,
"allow_template_sharing": false,
"inherit_contacts": false,
"inherit_templates": false,
"inherit_tcr_brand": true,
"inherit_tcr_campaign": true,
"billing_model": "profile",
"billing_contact": {
"name": "Ada Ops",
"email": "ops@example.com",
"phone": "+14155550100",
"address": "1 Example Way, Springfield"
},
"sandbox": true
}short_name创建配置文件时仅需提供即可,但完成配置还需要、、配置文件KYC信息,以及任何必要的活动或渠道设置。当为true时,API会拒绝创建请求中的对象,尽管配置文件仍需提交自身的KYC信息;请在调用完成端点前通过控制台完成KYC提交。
nameshort_namedescriptioninherit_tcr_brandbrandbilling_modelprofileorganizationprofile_and_organizationprofilebilling_contactpayment_details字段规则、错误码以及仅支持更新的字段请参考references/profile-lifecycle.md。
Inheritance decisions
继承决策
| Flag | | Consequence |
|---|---|---|
| Use the organization's registered brand | A |
| Use the organization's campaigns | Those campaigns are read-only for this profile; creating one returns a validation error |
| Read the organization's contacts | No contact isolation between tenants |
| Read the organization's templates | No template isolation between tenants |
An inherited brand with is a supported and common pattern: shared legal identity, dedicated messaging use cases per tenant.
inherit_tcr_campaign: false| 标志 | | 影响 |
|---|---|---|
| 使用组织已注册的品牌 | 同一请求中的 |
| 使用组织的活动 | 这些活动对本配置文件只读,创建新活动会返回验证错误 |
| 读取组织的联系人 | 租户间无联系人隔离 |
| 读取组织的模板 | 租户间无模板隔离 |
继承品牌且是一种受支持的常见模式:共享法律身份,每个租户拥有独立的消息使用场景。
inherit_tcr_campaign: falseWhatsApp: exactly three paths
WhatsApp:三种路径可选
- Organization Embedded Signup, performed in the Sent Dashboard. No public endpoint starts this flow.
- Child-profile inheritance — omit once the organization has a WABA.
whatsapp_business_account - Dedicated profile credentials — supply with
whatsapp_business_accountandwaba_id, optionallyaccess_token.phone_number_id
Supplying credentials on is not an Embedded Signup endpoint. Omitting when the organization has no WABA configured returns ; complete organization Embedded Signup or supply valid direct credentials. Use for the operational signup flow.
POST /v3/profileswhatsapp_business_account422waba-embedded-signup- 组织嵌入式注册,在Sent控制台中执行。无公开端点可启动此流程。
- 子配置文件继承——组织已有WABA时,省略字段。
whatsapp_business_account - 专用配置文件凭证——提供包含和
waba_id的access_token,可选提供whatsapp_business_account。phone_number_id
在中提供凭证并非嵌入式注册端点。当组织未配置WABA时省略会返回错误;请完成组织嵌入式注册或提供有效的直接凭证。使用处理操作注册流程。
POST /v3/profileswhatsapp_business_account422waba-embedded-signupCompletion and status
完成与状态
POST /v3/profiles/{profileId}/completewebHookUrljson
{
"webHookUrl": "https://provisioning.example.com/callbacks/profile-complete",
"sandbox": false
}A means processing started and carries no final status. A means the profile was already complete and its body carries a status. The callback body is and is delivered once with no retry, so the receiver must be live before the call and the flow must degrade to polling . This callback is separate from subscribed Sent webhooks and is not documented as carrying the webhook HMAC headers; use a unique callback path tied to the provisioning record, reject unknown profile ids, and treat polling as the authoritative recovery path.
202200{profileId, success, status, timestamp}GET /v3/profiles/{profileId}Profile status vocabulary differs by surface: the create response demonstrates lowercase , the completion demonstrates lowercase , the completion callback uses , , and , and documents , , , and . Do not assert a closed enum, do not lowercase-normalize into a fixed set, and record which surface produced each value. Compare statuses case-insensitively and preserve unknown strings.
incomplete200completedCOMPLETEDSUBMITTEDfailedGET /v3/profiles/{id}approvedsubmittedprocessingfailedPOST /v3/profiles/{profileId}/completewebHookUrljson
{
"webHookUrl": "https://provisioning.example.com/callbacks/profile-complete",
"sandbox": false
}202200{profileId, success, status, timestamp}GET /v3/profiles/{profileId}配置文件状态的表述因场景而异:创建响应中使用小写的,完成接口的响应中使用小写的,完成回调中使用、和,而接口文档中使用、、和。请勿断言固定的枚举值,请勿将所有状态统一转为小写,需记录每个状态的来源场景。比较状态时不区分大小写,并保留未知字符串。
incomplete200completedCOMPLETEDSUBMITTEDfailedGET /v3/profiles/{id}approvedsubmittedprocessingfailedCampaigns per profile
配置文件专属活动
Campaign management lives under the profile: and . There are no standalone brand endpoints; a dedicated brand is created with the profile.
<!-- sent-campaign-request -->
GET|POST /v3/profiles/{profileId}/campaignsPUT|DELETE /v3/profiles/{profileId}/campaigns/{campaignId}json
{
"campaign": {
"name": "Northwind order notifications",
"description": "Order and delivery notifications for opted-in Northwind customers.",
"type": "App",
"useCases": [
{
"messagingUseCaseUs": "ACCOUNT_NOTIFICATION",
"sampleMessages": [
"Northwind: Your order 12345 has shipped. Reply STOP to opt out."
]
}
],
"volume": "1500",
"messageFlow": "Customers opt in at checkout before notifications begin.",
"privacyPolicyLink": "https://example.com/privacy",
"termsAndConditionsLink": "https://example.com/terms"
}
}messagingUseCaseUssampleMessagesvolumeSENT_CREATEDACTIVEEXPIREDsms-10dlc-registration活动管理属于配置文件范畴:和。无独立的品牌端点;专用品牌会随配置文件一同创建。
<!-- sent-campaign-request -->
GET|POST /v3/profiles/{profileId}/campaignsPUT|DELETE /v3/profiles/{profileId}/campaigns/{campaignId}json
{
"campaign": {
"name": "Northwind order notifications",
"description": "Order and delivery notifications for opted-in Northwind customers.",
"type": "App",
"useCases": [
{
"messagingUseCaseUs": "ACCOUNT_NOTIFICATION",
"sampleMessages": [
"Northwind: Your order 12345 has shipped. Reply STOP to opt out."
]
}
],
"volume": "1500",
"messageFlow": "Customers opt in at checkout before notifications begin.",
"privacyPolicyLink": "https://example.com/privacy",
"termsAndConditionsLink": "https://example.com/terms"
}
}messagingUseCaseUssampleMessagesvolumeSENT_CREATEDACTIVEEXPIREDsms-10dlc-registrationUsers and roles
用户与角色
Five operations administer access: , (invite), , (role), and . None is exposed through MCP. Assignable roles are , , and ; is implicit for the creating account and never appears in the list. Mutations require .
GET /v3/usersPOST /v3/usersGET /v3/users/{userId}PATCH /v3/users/{userId}DELETE /v3/users/{userId}adminbillingdeveloperowneradminRole checks resolve against the email that owns the API key and pass only for the owner or an active user with an allowed role — , , and users fail. Organization-level access cascades to child profiles. Invitations expire after seven days, and inviting an existing user returns .
invitedsuspendedrejected409Before any user mutation, read the current state, then confirm explicitly with the operator. The API refuses to let you change your own role, demote the last admin, remove yourself, or remove the last admin, but checking first produces a clear explanation instead of a validation error. The full role matrix and key-hygiene rules are in references/users-and-roles.md.
There is no endpoint to list, create, or revoke API keys; key management is a dashboard operation. Rotation is create-new, deploy, verify with , then disable or delete the old key — deleting first only when the key is compromised.
GET /v3/me有五项操作用于管理访问权限:、(邀请)、、(角色修改)和。这些操作均未通过MCP暴露。可分配的角色包括、和;是创建账户的隐含角色,不会出现在角色列表中。修改操作需要权限。
GET /v3/usersPOST /v3/usersGET /v3/users/{userId}PATCH /v3/users/{userId}DELETE /v3/users/{userId}adminbillingdeveloperowneradmin角色校验基于API密钥所属的邮箱,仅所有者或活跃且拥有允许角色的用户可通过校验——、和状态的用户会校验失败。组织级访问权限会向下传递至子配置文件。邀请链接7天后过期,邀请已存在的用户会返回错误。
invitedsuspendedrejected409在进行任何用户修改操作前,请先读取当前状态,再与操作员确认。API不允许修改自身角色、降级最后一名管理员、移除自身或移除最后一名管理员,但提前检查可给出清晰的解释,而非返回验证错误。完整的角色矩阵和密钥安全规则请参考references/users-and-roles.md。
无端点可列出、创建或撤销API密钥;密钥管理是控制台操作。密钥轮换流程为:创建新密钥、部署、通过验证,然后禁用或删除旧密钥——仅当密钥泄露时才先删除旧密钥。
GET /v3/meMulti-tenant provisioning notes
多租户预配注意事项
Webhook events never carry your application's tenant identifier. Before the first send, persist and . Do not infer tenant ownership from , since many tenant profiles can share one organization. Provision one webhook registration per environment so a failing lower-environment receiver cannot auto-disable production.
message_id -> {tenant, profile, logical_send_id, channel}receiving_number -> {tenant, profile}account_idWebhook事件从不携带您应用的租户标识符。首次发送前,请持久化存储和映射关系。请勿通过推断租户归属,因为多个租户配置文件可共享一个组织。为每个环境预配一个webhook注册,避免低环境接收方故障导致生产环境自动禁用。
message_id -> {tenant, profile, logical_send_id, channel}receiving_number -> {tenant, profile}account_idBoundaries
边界划分
Use for the isolation, credential, and blast-radius design decision; for the WhatsApp signup flow; for brand vetting and campaign policy; and for subscribed message-event receivers. Profile-completion callbacks use the separate verification and polling guidance in this skill.
sender-profile-architectwaba-embedded-signupsms-10dlc-registrationsent-webhook-engineer请使用进行隔离、凭证和影响范围的设计决策;使用处理WhatsApp注册流程;使用进行品牌审核和活动策略制定;使用处理已订阅的消息事件接收方。配置文件完成回调需遵循本技能中单独的验证和轮询指南。
sender-profile-architectwaba-embedded-signupsms-10dlc-registrationsent-webhook-engineer