---
schema_version: "1"
id: 06673834894e2c6126539ed1ad5401f227ac1593bd633c415e0b55a31ec7f310
title: CloudHub 2.0 API
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/cloudhub-2/ch2-api.md
canonical_url: https://docs.mulesoft.com/cloudhub-2/ch2-api
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 449f0b662506e9afed26811be819cb12036ebd219c0c8600d8d56bfdca18e44d
description: MuleSoft Documentation Site
latest: true
---
---
product: CloudHub 2.0
---

# CloudHub 2.0 API

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Programmatically manage your CloudHub 2.0 resources with two APIs:

**CloudHub 2.0 API**

Manages infrastructure-level resources, such as:

- Manage private spaces:

  - List available TCP ports for a private space

  - Retrieve availability zones and AWS account information.

  - Upgrade a private space.

- Manage VPC endpoints (Private Link):

  - Create, list, update, and delete VPC endpoints.

  - Get VPC endpoint details and provisioning status.

- Manage VPNs:

  - Update VPN settings (for example, enable VPN logs).

- Manage transit gateways:

  - Delete a transit gateway from the organization.

- Manage schedulers:

  - Reset the scheduler configuration for a specific flow.

**Application Manager API**

Manages application-level resources, such as:

- Deploy and update applications with TCP port mapping.

For an interactive reference that includes supported resources, methods, required properties, and
expected responses, see
[CloudHub 2.0 API](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/cloudhub-20-api/)
and
[Application Manager API](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/amc-application-manager/)
on Exchange.

These APIs manage only applications and infrastructure deployed to CloudHub 2.0. To manage CloudHub
1.0 resources, see
[CloudHub API](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/cloudhub-api/).

## Base URLs

Each API uses a different base URL:

<table><colgroup><col> <col></colgroup><thead><tr><th>API</th><th>Base URL</th></tr></thead><tbody><tr><td><p>CloudHub 2.0 API</p></td><td><p><code>https://anypoint.mulesoft.com/runtimefabric/api</code></p></td></tr><tr><td><p>Application Manager API</p></td><td><p><code>https://anypoint.mulesoft.com/amc/application-manager/api/v2</code></p></td></tr></tbody></table>

## Use the CloudHub 2.0 APIs

You can use any HTTP client with the CloudHub 2.0 APIs.

To access operations, you must:

1.  Generate an authorization bearer token to authenticate with the API.

    Follow the instructions from [Anypoint identity](https://docs.mulesoft.com/access-management/saml-bearer-token) or
    [external identity](https://help.salesforce.com/s/articleView?id=001115323&type=1) to get a
    bearer access token for your Anypoint organization.

    The token owner must have the appropriate permissions for the resources being managed. For
    example, managing private spaces requires private space management permissions.

2.  Get the organization ID.

    See the
    [`/api/me`](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/access-management-api/minor/1.0/console/method/%234250/)
    endpoint in
    [Access Management API](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/access-management-api/minor/1.0/pages/home/).

3.  Get the environment ID.

    See the
    [`/api/organizations/_ORG_ID_/environments`](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/access-management-api/minor/1.0/console/method/%234762/)
    endpoint in
    [Access Management API](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/access-management-api/minor/1.0/pages/home/).

### List VPC Endpoints for a Private Space

To list all VPC endpoints for a private space, run the following `curl` command:

```curl
curl -X GET \
  --url https://anypoint.mulesoft.com/runtimefabric/api/organizations/{orgId}/privatespaces/{spaceId}/vpces \
  -H 'Authorization: Bearer AUTH_BEARER_TOKEN'
```

## Data Format

Resources and methods that return or accept a type use the JSON data format. Here is an example of
data received in JSON format in response to a request to list VPC endpoints:

```json
[
  {
    "name": "S3-Global",
    "vpceId": "ec6a2988-5529-4fac-9262-9b9962ce0b50",
    "serviceName": "com.amazonaws.s3-global.accesspoint",
    "serviceRegion": "us-east-1",
    "serviceOwner": "amazon",
    "azIds": ["use1-az1", "use1-az2"]
  },
  {
    "name": "Custom Service",
    "vpceId": "fc5c9c55-d943-4383-88ac-cc2b51446d54",
    "serviceName": "com.amazonaws.vpce.us-east-1.vpce-svc-03cef49533264d928",
    "serviceRegion": "us-east-1",
    "serviceOwner": "055970264539",
    "azIds": ["use1-az1"]
  }
]
```

## Rate Limits

The CloudHub 2.0 API enforces a global rate limit of 15 requests per second per remote IP address.

When you reach the rate limit, the API returns a `429` status code.

## Status Codes and Error Handling

When you call the CloudHub 2.0 APIs, the following status codes are returned:

<table><colgroup><col> <col></colgroup><thead><tr><th>Status Code</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p>200</p></div></div></td><td><div><div><p>The operation was successful.</p></div></div></td></tr><tr><td><div><div><p>201</p></div></div></td><td><div><div><p>The resource was created.</p></div><div><p>The <code>Location</code> header contains the location of the resource.</p></div></div></td></tr><tr><td><div><div><p>400</p></div></div></td><td><div><div><p>The request was invalid. Check the request body for details.</p></div></div></td></tr><tr><td><div><div><p>401</p></div></div></td><td><div><div><p>Authentication failed. Verify your bearer token.</p></div></div></td></tr><tr><td><div><div><p>403</p></div></div></td><td><div><div><p>The authenticated user doesn’t have the required permissions.</p></div></div></td></tr><tr><td><div><div><p>404</p></div></div></td><td><div><div><p>The resource was not found.</p></div></div></td></tr><tr><td><div><div><p>429</p></div></div></td><td><div><div><p>The operation was unsuccessful due to reaching the rate limit.</p></div><div><p>Retry the operation after a short delay.</p></div></div></td></tr><tr><td><div><div><p>500</p></div></div></td><td><div><div><p>The operation was unsuccessful.</p></div><div><p>See the HTTP body for details.</p></div></div></td></tr></tbody></table>

When errors occur, the HTTP response contains a JSON body with an error message:

```json
{
  "message": "Some error message."
}
```

## See Also

- [CloudHub 2.0 API Reference](https://docs.mulesoft.com/cloudhub-2/ch2-api-reference)

- [CloudHub 2.0 API](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/cloudhub-20-api/)

- [Application Manager API](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/amc-application-manager/)

- [Access Management API](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/access-management-api/)

- [Deploying Apps to CloudHub 2.0](https://docs.mulesoft.com/cloudhub-2/ch2-deploy)

- [Setting Up an Outbound Private Link Connection](https://docs.mulesoft.com/cloudhub-2/ps-outbound-private-link)
