> Source: [sk162573](https://support.checkpoint.com/results/sk/sk162573)

# sk162573 - Use the CloudGuard MSP REST API

| Property | Value |
|----------|-------|
| Solution ID | sk162573 |
| Date Created | 2019-09-22 |
| Last Modified | 2022-11-22 |
| Technical Level | General |
| Products | Cloud Firewall |
| Versions | R82.10, R81.20, R82 |

## Solution

This article illustrates how to use the REST API for your CloudGuard Managed Service Providers (MSP) account.  
URL: https://api-msp.dome9.com/msp/v2/  

**Note:** This is the Base URL of the MSP. To use it, provide the required actions below.

Create a CloudGuard API Key
---------------------------

Log in to the CloudGuard root account and go to **Settings** \> **Credentials**to create an API key.

The account must be an MSP account.

Get All Accounts
----------------

This returns all the child accounts for a parent MSP account.

### Request

` `

`curl -X GET \`

` `

`https://api-msp.dome9.com/msp/v2/account \`

` `

`-H 'authorization: Basic '\`

` `

`-H 'cache-control: no-cache' \`

` `

`-H 'content-type: application/json'`

### Response

        {
           "accountId": 12345,
            "adminUserId": 99999,
            "trust": {
                "id": "55555555-7777-4444-9999-000000000000",
                "targetAccountName": "CloudGuard",
                "sourceAccountName": "CloudGuard Main Account",
                "sourceAccountId": "88888888-3333-4444-9999-ffffffffffff",
                "description": "Trust 'CloudGuard Main Demo Account'",
                "restrictions": {
                    "roles": []
                }
            },
            "iconUrl": "http://assets.dome9.com/icons/52ZioIgTGbxC14ZFjBGVbSDHDQD-pTbEr32vZJ8MPQA",
            "trialExpiration": null,
            "companyName": "CloudGuard",
            "pointOfContact": "Offir",
            "adminEmail": "someone@acme.com",
            "adminFirstName": "D",
            "adminLastName": "Someone",
            "parentAccountId": 301,
            "planName": "MSP",
            "licensingInfo": {
               ...
                },
                "complianceEnabled": {
                   ...
                },
                "iamsafeEnabled": {
                  ...
                },
                "enterpriseEnabled": {
                ...
                },
                "fimEnabled": {
                 ...
                },
                "allowedUsers": {
            ...
                }
            }
        },
        
Create a New Child Account
--------------------------

This creates a child account in CloudGuard for the parent account.

### Request

```

```

curl -X POST \\

```

```

https://api-msp.dome9.com/msp/v2/account \\

```

```

-H 'authorization: Basic \<your api key and secret in base64 encoding\>' \\

```

```

-H 'cache-control: no-cache' \\

```

```

-H 'content-type: application/json' \\

```

```

-d '{"parentAccountId":\<parent-account-id\>,"companyName":"account-name","pointOfContact":"email-addr@domain.com","adminEmail":"email-addr@domain.com","adminFirstName":"first-name","adminLastName":"last-name","planName":"Enterprise","trustMspAccount":true,"licensingInfo":{"networkEnabled":{"value":true},"enterpriseEnabled":{"value":true},"complianceEnabled":{"value":true},"iamsafeEnabled":{"value":true},"fimEnabled":{"value":false},"allowedUsers":{"value":null}}}'

```

```

Where:

*Parent-account-id* = the CloudGuard cloud account id of the parent account (under which the child account will be created) - this account must be an MSP account in CloudGuard. In the response to the GET method, above, the parent account is the accountId (12345, in the example response above). This field is mandatory.

*planName* = "MSP" or "Enterprise". If set to MSP, the child account will itself be an MSP account (capable of creating its own children accounts). If set to Enterprise, the child account is an enterprise account managed by the parent account.

### Response

The response will contain the child account id in the field *accountId*.

    
    {
       "accountId": 123456,
        "adminUserId": 111111,
        "trust": {
            "id": "99999999-cccc-4444-bbbb-777777777777",
            "targetAccountName": "ABC",
            "sourceAccountName": "msp-reseller1",
            "sourceAccountId": "ffffffff-7777-4444-8888-222222222222",
            "description": "Trust 'msp-reseller1'",
            "restrictions": {
                "roles": []
            }
        },
        "iconUrl": null,
        "trialExpiration": null,
        "companyName": "ABC",
        "pointOfContact": "msp@domain.com",
        "adminEmail": "email@domain.com",
        "adminFirstName": "first-name",
        "adminLastName": "last-name",
        "parentAccountId": 12345,
        "planName": "Enterprise",
        "licensingInfo": {
          ...
            },
            "complianceEnabled": {
               ...
            },
            "iamsafeEnabled": {
              ...
            },
            "enterpriseEnabled": {
             ...
            },
            "fimEnabled": {
                ...
            },
            "allowedUsers": {
              ...
            }
        }
    }

Delete a Child Account
----------------------

```

```

curl -X DELETE \\

```

```

https://api-msp.dome9.com/msp/v2/account/{child-account-id} \\

```

```

-H 'authorization: Basic \<your api key and secret in base64 encoding\>' \\

```

```

-H 'cache-control: no-cache' \\

```

```

-H 'content-type: application/json'

```

```

Where

*Child-account-id*= the cloud account id of the child account (from previous Create Child Account step)

---

# Agent Instructions

This content is from the Check Point Support Center (https://support.checkpoint.com), the official knowledge base for Check Point cybersecurity products.

## Navigating This Knowledge Base

- **Complete index**: [llms.txt](https://support.checkpoint.com/llms.txt)
- **All SK articles**: [SecureKnowledge Sitemap](https://support.checkpoint.com/sitemaps/secureknowledge-sitemap-index.xml)
- **SK article URL pattern**: `https://support.checkpoint.com/results/sk/{skId}`
- **Markdown responses**: AI bot User-Agents automatically receive `text/markdown` content
