Skip to main content
Prerequisites: Obtaining an API Key

Flow Overview

The customer creation process follows a four-step sequence:
  1. Customer Creation — Establish the customer organization
  2. Onboarding Link Generation — Create AWS CloudFormation resources
  3. Integration Setup — Configure customer-specific integrations
  4. Add Users (optional) — Add users to the newly created customer

Authentication

All API calls require these headers:
X-API-Key: <your-api-key>
Content-Type: application/json
For Step 2, you must include the impersonation header:X-Wiv-Impersonated-Tenant-Id: <customer_id>This allows the MSP to perform actions on behalf of the newly created customer.

Step 1: Create Customer

Endpoint: POST /msp/customers Headers
X-API-Key: <your-api-key>
Content-Type: application/json
Body
{
  "name": "Wiv-MSP-Customer"
}
Response
{
  "data": {
    "name": "Wiv-MSP-Customer",
    "customer_id": "f7016a5c-42fc-46d5-a344-3e63d756f4f5"
  }
}
Save the customer_id from the response — it is required for all subsequent API calls.

Endpoint: POST /onboarding/aws/cloudformation-link Headers
X-API-Key: <your-api-key>
Content-Type: application/json
X-Wiv-Impersonated-Tenant-Id: <customer_id>
Body
{
  "account_type": "payer",
  "cur_config_type": "cur"
}
Response
{
  "data": {
    "cloudformation_url": "https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/review?templateURL=...",
    "pre_signed_url": "<stack-template-file>",
    "external_id": "unique-external-identifier"
  },
  "message": "CloudFormation Link created successfully."
}
Save the external_id from the response — it is required in Step 3.

Step 3: Create Customer Integration

Endpoint: POST /msp/customers/<customer_id>/integrations Headers
X-API-Key: <your-api-key>
Content-Type: application/json
{
  "type": "AWS",
  "name": "<Customer_Name>-AWS",
  "integration_secret": {
    "role_arn": "arn:aws:iam::123456789012:role/WivAccessRole",
    "external_id": "<external_id>"
  }
}
Response
{
  "data": {
    "customer_id": "<customer_id>",
    "customer_integration": {
      "integration_id": "<integration_id>",
      "name": "<Customer_Name>-AWS",
      "type": "AWS",
      "mode": "STANDARD",
      "timestamp": "2025-06-19 13:12:33.599888"
    },
    "customer_name": "Wiv-MSP-Customer"
  }
}

Step 4 (Optional): Add Users

Endpoint: POST /msp/customers/<customer_id>/users Headers
X-API-Key: <your-api-key>
Content-Type: application/json
Body
{
  "user_emails": ["user@example.com"],
  "role": "MSP-Admin"
}
Response
{
  "data": {
    "added_users": [
      { "email": "user@example.com", "role": "MSP-Admin", "user_id": "b07457bc-..." }
    ],
    "failed_users": [
      { "email": "other@example.com", "reason": "User not found" }
    ],
    "summary": {
      "failed": 1,
      "successfully_added": 1,
      "total_requested": 2
    },
    "customer_id": "f0d2b747-...",
    "customer_name": "Wiv-MSP-Customer"
  }
}