# Create bundle for project

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

Endpoint: POST /v1/projects/{projectId}/bundles
Version: 1.2.91
Security: BasicAuth, BearerAuth, OAuth2Production

## Path parameters:

  - `projectId` (string, required)
    The unique ID of the project. You can find this on the Sinch Dashboard.

## Request fields (application/json):

  - `body` (BundlesInputBundlesDto (object), required)
    - `region` (string, required)
      Region to create resources in.
 (Allowed values for staging environment: EU or US).
      Enum: "BR", "EU", "US"
    - `name` (string)
      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"
    - `subproject` (array)
      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.
      Example: true
      - `name` (string)
        Name of subproject to create. If not set, will use name from root object. If neither this value or the name in the root is set, then the request will fail.
      - `labels` (object)
        Optional labels to attach to the subproject. If provided must be an object with string keys and string values.
    - `smsApp` (array)
      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.
      Example: true
      - `name` (string)
        Name of SMS App to create. If not set, will use name from root object. If neither this value or the name in the root is set, then the request will fail.
      - `test` (boolean)
        Deprecated. This field is no longer used and will be removed in a future release.
    - `convApp` (array)
      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.
      Example: true
      - `name` (string)
        Name of Conversation API App to create. If not set, will use name from root object. If neither this value or the name in the root is set, then the request will fail.
      - `webhooks` (array)
        Conversation API webhooks to create for the new App. See Conversation API documentation for all options.
      - `webhooks.target` (string, required)
        The target url where events should be sent to. The conversation-api.*.sinch.com subdomains are forbidden.
      - `webhooks.triggers` (array, required)
        An array of triggers that should trigger the webhook and result in an event being sent to the target url.
      - `webhooks.secret` (string)
        Optional secret used to sign contents of webhooks sent by the Conversation API. You can then use the secret to verify the signature.
      - `webhooks.targetType` (string)
        Conversation API webhook target type.
        Enum: "DISMISS", "GRPC", "HTTP"
      - `processingMode` (string)
        Conversation API processing mode. May be changed later by using Conversation App API.
        Enum: "CONVERSATION", "DISPATCH"
      - `retentionPolicy` (array) — one of:
        Conversation API retention policy for messages and conversations. May be changed later by using Conversation App API.
        - BundlesConversationAppConversationRetentionPolicyInputDto:
          - `retentionPolicyType` (string)
            Conversation API conversation retention policy type.
            Enum: "CONVERSATION_EXPIRE_POLICY", "MESSAGE_EXPIRE_POLICY", "PERSIST_RETENTION_POLICY"
          - `ttl` (number)
            Conversation API conversation retention time in days.
        - BundlesConversationAppDispatchRetentionPolicyInputDto:
          - `retentionPolicyType` (string)
            Conversation API dispatch retention policy type.
            Enum: "MESSAGE_EXPIRE_POLICY"
          - `ttl` (number)
            Conversation API dispatch retention time in days.
      - `consentManagerSettings` (object)
        Conversation API consent manager settings.
      - `consentManagerSettings.mode` (string, required)
        Conversation API consent manager settings mode.
        Enum: "DISABLED", "PRIMARY", "SECONDARY"
    - `webhooks` (array)
      Webhook targets for the Provisioning API.
  
Field 'target' must have unique values across items.
    - `webhooks.target` (string, required)
      A valid target url where events should be sent to.
    - `webhooks.secret` (string, required)
      Secret to be used to sign contents of webhooks sent by the provisioning API. You can then use the secret to verify the signature. Please not that secret should have a high entropy to be considered secure.
    - `webhooks.triggers` (array, required)
      List of triggers you want to be notified about on your webhook. To be able to listen to all type of events use ALL.
- Common: ALL
- Bundles: BUNDLE_DONE
- WhatsApp Sender: WHATSAPP_SENDER_ACTIVE, WHATSAPP_SENDER_COMMENT_ADDED, WHATSAPP_SENDER_DAILY_LIMIT_CHANGED, WHATSAPP_SENDER_DELETED, WHATSAPP_SENDER_ERROR, WHATSAPP_SENDER_INACTIVE, WHATSAPP_SENDER_PENDING_VERIFICATION, WHATSAPP_SENDER_QUALITY_RATING_CHANGED, WHATSAPP_SENDER_REJECTED or WHATSAPP_SENDER_USERNAME_UPDATED
- WhatsApp Template: WHATSAPP_TEMPLATE_APPROVED, WHATSAPP_TEMPLATE_CATEGORY_FUTURE_UPDATE, WHATSAPP_TEMPLATE_CATEGORY_UPDATED, WHATSAPP_TEMPLATE_COMMENT_ADDED, WHATSAPP_TEMPLATE_DELETED, WHATSAPP_TEMPLATE_QUALITY_SCORE_UPDATED, WHATSAPP_TEMPLATE_REJECTED or WHATSAPP_TEMPLATE_STATUS_UPDATED
- WhatsApp Account: WHATSAPP_ACCOUNT_COMMENT_ADDED, WHATSAPP_ACCOUNT_DAILY_LIMIT_CHANGED, WHATSAPP_ACCOUNT_ONBOARDED, WHATSAPP_ACCOUNT_PENDING_VERIFICATION, WHATSAPP_ACCOUNT_REJECTED or WHATSAPP_WABA_ACCOUNT_CHANGED
- RCS Sender: RCS_BRAND_REGISTRATION_PROCESS_STATUS_UPDATED, RCS_SENDER_COMMENT_ADDED, RCS_SENDER_OPERATOR_STATUS_UPDATED or RCS_SENDER_STATUS_UPDATED
- KakaoTalk Sender: KAKAOTALK_SENDER_ACTIVE, KAKAOTALK_SENDER_COMMENT_ADDED, KAKAOTALK_SENDER_INACTIVE or KAKAOTALK_SENDER_REJECTED
- KakaoTalk Template: KAKAOTALK_TEMPLATE_APPROVED, KAKAOTALK_TEMPLATE_COMMENT_ADDED or KAKAOTALK_TEMPLATE_REJECTED

## Response 201 fields (application/json):

  - `id` (string, required)
    Id of bundle created.

  - `projectId` (string, required)
    The project or subproject id where resources have been created.

  - `state` (string, required)
    Current state.
    Enum: "DONE", "FAILED", "IN_PROGRESS"

  - `region` (string, required)
    Region resources were create in.
    Enum: same as `region` (3 values)

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

  - `webhookDeliveryStatuses` (array)
    List delivery statuses for all BUNDLE_DONE webhooks.

  - `webhookDeliveryStatuses.webhookId` (string, required)

  - `webhookDeliveryStatuses.httpStatusCode` (number, required)
    Enum: 100, 101, 102, 103, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301, 302, 303, 304, 305, 306, 307, 308, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 421, 422, 423, 424, 425, 426, 428, 429, 431, 451, 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, 511

  - `webhookDeliveryStatuses.date` (string, required)

  - `webhookDeliveryStatuses.errorMessage` (string)

  - `subproject` (object)
    Subproject created, if requested.

  - `subproject.id` (string, required)
    Subproject id.

  - `subproject.name` (string, required)
    Name of Subproject.

  - `subproject.parentProjectId` (string, required)
    Parent project id which the subproject is associated with.

  - `subproject.status` (string, required)
    Status of subproject.
    Enum: "PENDING", "READY"

  - `subproject.labels` (object)
    Project labels, if provided.

  - `smsApp` (object)
    SMS App created, if requested.

  - `smsApp.id` (string, required)
    SMS App id.

  - `smsApp.smsServiceId` (string, required)
    Id of the SMS Service which the SMS App belongs to.

  - `smsApp.name` (string, required)
    Name of SMS App.

  - `smsApp.status` (string, required)
    Status of SMS App.
    Enum: "ACTIVE", "BLOCKED", "DELETED", "DEPROVISIONING", "DEPROVISIONING_FAILED", "FAILED_ADD", "FAILED_BLOCK", "FAILED_DELETE", "FAILED_UNBLOCK", "FAILED_UPDATE", "IN_PROGRESS_ADD", "IN_PROGRESS_BLOCK", "IN_PROGRESS_DELETE", "IN_PROGRESS_UNBLOCK", "IN_PROGRESS_UPDATE", "PENDING_ADD", "PENDING_BLOCK", "PENDING_DELETE", "PENDING_UNBLOCK", "PENDING_UPDATE", "PROVISIONING", "PROVISIONING_ADD", "PROVISIONING_ADD_FAILED", "PROVISIONING_BLOCK", "PROVISIONING_BLOCK_FAILED", "PROVISIONING_FAILED", "PROVISIONING_UNBLOCK", "PROVISIONING_UNBLOCK_FAILED", "PROVISIONING_UPDATE", "PROVISIONING_UPDATE_FAILED", "STATUS_UNSPECIFIED", "UNRECOGNIZED"

  - `smsApp.regions` (array, required)
    List of regions of the app.
    Enum: "AU", "BR", "CA", "EU", "US", "UNRECOGNIZED"

  - `smsApp.test` (boolean, required)
    True if the app is a test app.

  - `convApp` (object)
    Conversation App created, if requested.

  - `convApp.id` (string, required)
    Conversation App id.

  - `convApp.name` (string, required)
    Name of Conversation App.

  - `convApp.processingMode` (string, required)
    Conversation API processing mode.
    Enum: "CONVERSATION", "DISPATCH", "UNRECOGNIZED", "UNSPECIFIED"

  - `convApp.webhooks` (array)
    List all webhooks for a given app.

  - `convApp.webhooks.id` (string, required)
    The ID of the webhook.

  - `convApp.webhooks.target` (string, required)
    The target url where events should be sent to.

  - `convApp.webhooks.triggers` (array, required)
    An array of triggers that should trigger the webhook and result in an event being sent to the target url.

  - `convApp.webhooks.secret` (string)
    Optional secret used to sign contents of webhooks sent by the Conversation API. You can then use the secret to verify the signature.

  - `convApp.retentionPolicy` (object)
    Conversation API retention policy for messages and conversations.

  - `convApp.retentionPolicy.retentionPolicyType` (string, required)
    Conversation API retention policy type.
    Enum: "CONVERSATION_EXPIRE_POLICY", "MESSAGE_EXPIRE_POLICY", "PERSIST_RETENTION_POLICY", "UNRECOGNIZED"

  - `convApp.retentionPolicy.ttl` (number)
    Conversation API retention time in days.

  - `convApp.consentManagerSettings` (object)
    Conversation API consent manager settings.

  - `convApp.consentManagerSettings.mode` (string, required)
    Conversation API consent manager settings mode.
    Enum: "DISABLED", "PRIMARY", "SECONDARY", "UNRECOGNIZED"

  - `convApp.smsChannelStatus` (string)
    Status of the SMS channel credentials integration.
    Enum: "ACTIVE", "FAILING", "PENDING", "UNRECOGNIZED"

  - `webhooks` (array)
    Webhooks registered, if requested.

  - `webhooks.id` (string, required)
    The ID of the webhook.

  - `webhooks.target` (string, required)
    The target url where events will be sent to.

  - `webhooks.projectId` (string, required)
    The project that this webhook belongs to.

  - `webhooks.triggers` (array, required)
    List of triggers this webhook is triggered by.

## Response 400 fields (application/json):

  - `body` (InvalidInputErrorTitle (object) or InvalidPayloadErrorTitle (object) or NoServicesToCreateErrorTitle (object) or MissingNameErrorTitle (object) or InvalidWebhooksErrorTitle (object) or InvalidStagingBundlesInputRegionErrorTitle (object) or ConversationAppAlreadyConnectedToSmsAppErrorTitle (object)) — one of:
    - InvalidInputErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "invalid_input"
      - `message` (string)
        Human readable message.
        Example: "Invalid input."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Correct the validation errors and submit again."
      - `additionalInformation` (object)
        Additional information for error.
        Example: {"validationErrors":["subproject must be boolean or object"]}
    - InvalidPayloadErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "invalid_payload"
      - `message` (string)
        Human readable message.
        Example: "Invalid payload."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Correct payload and submit again."
    - NoServicesToCreateErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "no_services_to_create"
      - `message` (string)
        Human readable message.
        Example: "No services to create."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Add at least one service to create."
    - MissingNameErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "missing_name"
      - `message` (string)
        Human readable message.
        Example: "Missing name for bundles."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Make sure you have given a separate service name or principal."
    - InvalidWebhooksErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "invalid_webhooks"
      - `message` (string)
        Human readable message.
        Example: "Unable to create webhooks."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Please try again."
    - InvalidStagingBundlesInputRegionErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "invalid_staging_bundles_input_region"
      - `message` (string)
        Human readable message.
        Example: "Invalid bundles region for staging."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Verify that bundles region is valid for staging. Allowed bundles regions for staging EU, US."
    - ConversationAppAlreadyConnectedToSmsAppErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "conversation_app_already_connected_to_sms_app"
      - `message` (string)
        Human readable message.
        Example: "Conversation App is already connected to an SMS App."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Use the SMS App that is already connected to the Conversation App or disconnect the currently connected SMS App before connecting another SMS App."

## Response 401 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: "unauthorized_error"

  - `message` (string)
    Human readable message.
    Example: "Unauthorized error."

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: "Verify that projectId is correct."

## Response 403 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: "forbidden_payload"

  - `message` (string)
    Human readable message.
    Example: "Forbidden payload."

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: "Please ensure that you have permission to use that payload."

## Response 404 fields (application/json):

  - `body` (ConversationAppNotFoundErrorTitle (object) or SmsAppNotFoundErrorTitle (object) or DefaultSmsAppNotFoundErrorTitle (object)) — one of:
    - ConversationAppNotFoundErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "conversation_app_not_found"
      - `message` (string)
        Human readable message.
        Example: "Conversation App not found."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Verify that the appId is correct."
    - SmsAppNotFoundErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "sms_app_not_found"
      - `message` (string)
        Human readable message.
        Example: "SmsApp not found."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Verify that the appId is correct."
    - DefaultSmsAppNotFoundErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "default_sms_app_not_found"
      - `message` (string)
        Human readable message.
        Example: "Default SmsApp not found."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Create SmsApp in test mode to use in request."

## Response 409 fields (application/json):

  - `body` (WebhookExistsErrorTitle (object) or ConversationAppIsAlreadyInBundlesProcessErrorTitle (object) or MoreThanOneSmsAppErrorTitle (object) or SmsAppIsAlreadyLinkedToConversationAppErrorTitle (object) or SmsAppIsAlreadyInBundlesProcessErrorTitle (object) or AllowedOnlyForDefaultTestSmsAppErrorTitle (object) or NotAllowedForSubprojectErrorTitle (object) or NotAllowedForNonTestAccountErrorTitle (object) or OnlyOneTestNumberAllowedErrorTitle (object)) — one of:
    - WebhookExistsErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "webhook_exists"
      - `message` (string)
        Human readable message.
        Example: "Webhook with the provided target already exists."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Webhooks must have a unique target. Change the target and submit again."
    - ConversationAppIsAlreadyInBundlesProcessErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "conversation_app_is_already_in_bundles_process"
      - `message` (string)
        Human readable message.
        Example: "Conversation App is already in Bundles process."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Please select another conversationAppId for which the request is to be made."
    - MoreThanOneSmsAppErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "more_than_one_sms_app"
      - `message` (string)
        Human readable message.
        Example: "More than one SmsApp."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Please select the smsAppId for which the request is to be made."
    - SmsAppIsAlreadyLinkedToConversationAppErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "sms_app_is_already_linked_to_conversation_app"
      - `message` (string)
        Human readable message.
        Example: "SmsApp is already linked to ConversationApp."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Please select another smsAppId for which the request is to be made."
    - SmsAppIsAlreadyInBundlesProcessErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "sms_app_is_already_in_bundles_process"
      - `message` (string)
        Human readable message.
        Example: "SmsApp is already in Bundles process."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Please select another smsAppId for which the request is to be made."
    - AllowedOnlyForDefaultTestSmsAppErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "allowed_only_for_default_test_sms_app"
      - `message` (string)
        Human readable message.
        Example: "Allowed only for default test SMS app."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Verify that the SMS app is marked as defaultTest."
    - NotAllowedForSubprojectErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "not_allowed_for_subproject"
      - `message` (string)
        Human readable message.
        Example: "Not allowed for subproject."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Verify that the subproject is eligible for test numbers."
    - NotAllowedForNonTestAccountErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "not_allowed_for_non_test_account"
      - `message` (string)
        Human readable message.
        Example: "Not allowed for non test account."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Verify that the account is a test account."
    - OnlyOneTestNumberAllowedErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "only_one_test_number_allowed"
      - `message` (string)
        Human readable message.
        Example: "Only one active test number is allowed per project."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Verify that there are no other active test numbers in the project."

## Response 424 fields (application/json):

  - `errorCode` (string)
    Error code allows to programmatically handle errors.
    Example: "webhook_limit_reached"

  - `message` (string)
    Human readable message.
    Example: "Number of webhooks has reached the limit."

  - `resolution` (string)
    Human readable message with an explanation of how to solve the error.
    Example: "Delete some webhooks to be able to add more."

## Response 500 fields (application/json):

  - `body` (FailedToCreateSubprojectErrorTitle (object) or FailedToCreateSmsServiceErrorTitle (object) or FailedToCreateConversationServiceErrorTitle (object) or InternalErrorErrorTitle (object)) — one of:
    - FailedToCreateSubprojectErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "failed_to_create_subproject"
      - `message` (string)
        Human readable message.
        Example: "Failed to create subproject."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Please try again."
    - FailedToCreateSmsServiceErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "failed_to_create_sms_service"
      - `message` (string)
        Human readable message.
        Example: "Failed to create sms service."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Please try again."
    - FailedToCreateConversationServiceErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "failed_to_create_conversation_service"
      - `message` (string)
        Human readable message.
        Example: "Failed to create conversation service."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Please try again."
    - InternalErrorErrorTitle:
      - `errorCode` (string)
        Error code allows to programmatically handle errors.
        Example: "internal_error"
      - `message` (string)
        Human readable message.
        Example: "Internal server error."
      - `resolution` (string)
        Human readable message with an explanation of how to solve the error.
        Example: "Please wait and try again, if the error persist please contact support."


