Skip to content

Create bundle for project
GA

Request

Creates a new bundle of resources based on the input work order.

Security
BasicAuth and BearerAuth and OAuth2Production
Path
projectIdstringrequired

The unique ID of the project. You can find this on the Sinch Dashboard.

Bodyapplication/jsonrequired

Example Bundle create requests

Any of:
regionstring(BundlesBundlesInputRegion)required

Region to create resources in. (Allowed values for staging environment: EU or US).

Enum:"BR""EU""US"
Example:"US"
namestring, [ 1 .. 255 ] characters

Name of bundle to create. If a name is not specified in the resource blocks then they will be created with this name.

Example:"Sample bundle"
subprojectBundlesSubprojectInputDto (object) or boolean
Example:true
One of:

Subproject resource block.

If set to true, a subproject will be created under the provided projectId with default name from the root object. Optionally a different name can be specified as well as labels on the project.

If not provided or set to false, a subproject will not be created and instead all resources will be created under the projectId provided in the request.

smsAppBundlesInputBundlesSmsAppDto (object) or boolean
Example:true
One of:

SMS Application resource block.

If set to true, an SMS Application will be created under the project or subproject specified. Optionally a different name can specified.

If not provided or set to false, an SMS Application will not be created.

convAppBundlesConversationAppInputDto (object) or boolean
Example:true
One of:

Conversation Application resource block.

If set to true, a Conversation Application will be created under the project or subproject specified. All other resources created will be associated with the Conversation Application. Optionally a different name can specified as well as Conversation API webhooks.

If not provided or set to false, a Conversation Application will not be created.

webhooksArray of objects, [ 1 .. 15 ] items, unique(BundlesWebhookInputDto)

Webhook targets for the Provisioning API.

Field 'target' must have unique values across items.

Small example to create a subproject, SMS App and Conversation App. The webhooks for Conversation API and Provisioning API are examples and can be extended.

curl -i -X POST \
  -u '<username>:<password>' \
  'https://provisioning.api.sinch.com/v1/projects/{projectId}/bundles' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Small bundle example",
    "region": "US",
    "subproject": true,
    "smsApp": true,
    "convApp": {
      "name": "Conversation App Example",
      "webhooks": [
        {
          "target": "https://webhook.site/d614d077-302a-4e0b-a06a-276923f7d8d4",
          "secret": "secret",
          "triggers": [
            "MESSAGE_DELIVERY"
          ]
        }
      ],
      "processingMode": "DISPATCH",
      "retentionPolicy": {
        "retentionPolicyType": "MESSAGE_EXPIRE_POLICY",
        "ttl": 7
      },
      "consentManagerSettings": {
        "mode": "PRIMARY"
      }
    },
    "webhooks": [
      {
        "target": "https://webhook.site/d614d077-302a-4e0b-a06a-276923f7d8d4",
        "secret": "secret",
        "triggers": [
          "BUNDLE_DONE"
        ]
      }
    ]
  }'

Responses

Responds with the bundle created. At time of response the bundle might not be completed. To receive the complete payload register a webhook for the BUNDLE_DONE trigger.

Bodyapplication/json
idstringrequired

Id of bundle created.

projectIdstringrequired

The project or subproject id where resources have been created.

statestring(BundlesBundleServicesState)required

Current state.

Enum:"DONE""FAILED""IN_PROGRESS"
regionstring(BundlesBundlesRegion)required

Region resources were create in.

Enum:"BR""EU""US"
namestring, <= 255 characters

Name of bundle created. If a name was not specified in the resource blocks then they were created with this name.

webhookDeliveryStatusesArray of objects(BundlesWebhookDeliveryStatusDto)

List delivery statuses for all BUNDLE_DONE webhooks.

subprojectobject(BundlesSubprojectDto)

Subproject created, if requested.

smsAppobject(BundlesBundlesSmsAppDto)

SMS App created, if requested.

convAppobject(BundlesConversationAppDto)

Conversation App created, if requested.

webhooksArray of objects(BundlesWebhookDto)

Webhooks registered, if requested.

Response

Response if the SMS App is not ready. This is the most likely response.

{ "id": "62a02dd40000000000000000", "projectId": "ea026751-3edf-40a9-ad93-1b382bd60a78", "name": "Sample response", "region": "US", "subproject": { "id": "ea026751-3edf-40a9-ad93-1b382bd60a78", "name": "Sample response", "parentProjectId": "18bbdcc8-117d-42f0-85cc-e30462c49404", "status": "PENDING" }, "smsApp": { "id": "54e5eb6cae6242c88c132c8da8bb1072", "smsServiceId": "d84b09da00fb4b76ff63f2fcea8d46c7", "name": "Sample response", "status": "PENDING_ADD", "regions": [ … ], "test": false }, "convApp": { "id": "31c12b1042d14b37ae96df96bb13575b", "name": "Sample response", "processingMode": "CONVERSATION" }, "webhooks": [ { … } ], "state": "IN_PROGRESS" }

Callbacks

Bundle Done Event
post
We'd love to hear from you!
Rate this content: