APIv4 Reference

APIv4 Reference

Clever Cloud provides a public REST API used by its own services and customers, known as /v2. As our platform evolves, we’re progressively moving to /v4 endpoints, adding functionalities, with a more modern approach:

https://api.clever-cloud.com/v4/

While the documentation moves towards completion, this page presents the most useful endpoints and example requests available now.

ℹ️
Each query response contains a Sozu-Id. If you need help from our support team, it can help to provide it.

Billing

  • /v4/billing/organisations/{orgid}/invoices
  • /v4/billing/organisations/{orgid}/invoices/{invoiceid}
  • /v4/billing/organisations/{orgid}/invoices/{invoiceid}.html
  • /v4/billing/organisations/{orgid}/invoices/{invoiceid}.pdf
  • Type: GET

You can use optional parameters to filter it:

ParameterTypeComment
limitint
sincestringISO 8601 formatted
untilstringISO 8601 formatted

Example response, for each invoice:

[
    {
    "invoice_number": "",
    "kind": "",
    "owner_id": "",
    "address": {
      "address_id": "",
      "owner_id": "",
      "name": "",
      "company": "",
      "address": "",
      "city": "",
      "zipcode": "",
      "country_alpha2": "",
      "vat_number": "",
      "vat_percent": float,
      "customer_cost_center": "",
      "customer_purchase_order": ""
    },
    "emission_date": "",
    "pay_date": "",
    "status": "",
    "currency": "",
    "price_factor": float,
    "discount": float,
    "vat_percent": float,
    "total_tax_excluded": {
      "currency": "",
      "amount": float,
      "amount_formatted": "",
      "default_display": ""
    },
    "total_tax": {
      "currency": "",
      "amount": float,
      "amount_formatted": "",
      "default_display": ""
    },
    "category": "",
    "payment_provider": "",
    "transaction_id": "",
    "customer_order_id": ""
  },
  {...}
]

Deployments

  • /v4/orchestration/organisations/{ownerId}/applications/{applicationId}/deployments
  • /v4/orchestration/organisations/{ownerId}/applications/{applicationId}/deployments/{deploymentId}
  • Type: GET

Example response, for each deployment:

[
  {
    "id": "",
    "ownerId": "",
    "applicationId": "",
    "startDate": "",
    "state": "",
    "steps": [
      {
        "state": "",
        "date": ""
      },
      {
        "state": "",
        "date": ""
      },
      {
        "state": "",
        "date": ""
      }
    ],
    "version": {
      "commitId": ""
    },
    "origin": {
      "action": "",
      "cause": "",
      "source": "",
      "authorId": "",
      "constraints": [
        ""
      ],
      "priority": ""
    },
    "hasDedicatedBuild": boolean
  },
  {...}
]

Instances

  • /v4/orchestration/organisations/{ownerId}/applications/{applicationId}/instances
  • Type: GET

You can use optional parameters to filter it:

ParameterTypeComment
deploymentIdstring
limitint
excludeDeletedboolean
sincestringISO 8601 formatted
untilstringISO 8601 formatted
orderstringASC or DESC
includeStatestringcase sensitive, repeated
excludeStatestringcase sensitive, repeated

Example response, for each instance:

[
  {
    "id": "",
    "ownerId": "",
    "applicationId": "",
    "deploymentId": "",
    "name": "",
    "flavor": "",
    "index": int,
    "state": "",
    "creationDate": "",
    "deletionDate": "",
    "network": {
      "ip": "",
      "port": int
    },
    "isBuildVm": boolean
  },
  {...}
]

Load Balancers

  • /v4/load-balancers/organisations/{ownerId}/applications/{applicationId}/load-balancers/default
  • Type: GET

Example response:

[
  {
    "id": "",
    "name": "",
    "zoneId": "",
    "dns": {
      "cname": "",
      "a": []
    }
  }
]

Logs

  • /v4/logs/organisations/{ownerId}/applications/{applicationId}/logs
  • Type: GET

Answers with logs in a SSE (Server-Sent Events) stream. You can use optional parameters to filter it:

ParameterTypeComment
deploymentIdstring
instanceIdstring
sincestringISO 8601 formatted
untilstringISO 8601 formatted
fieldstringAllow to get only asked fields, repeated
filterstringCase insensitive contains type search
limitint64Minimum: 1
servicestringsystemd service name, repeated (default: bas and bas-deploy, can be all)
throttleElementsintMaximum elements read per throttlePerInMilliseconds, default 100
throttlePerInMillisecondslongDefault 300

Products zones

  • /v4/products/zones
  • /v4/products/zones/{name}
  • Type: GET

Example response, for each zone:

[
  {
    "id": "",
    "name": "",
    "country": "",
    "countryCode": "",
    "city": "",
    "displayName": "",
    "lat": float,
    "lon": float,
    "outboundIPs": [],
    "tags": []
  },
  {...}
]

Pulsar policies

  • /v4/addon-providers/addon-pulsar/addons/{addon-id}/storage-policies
  • Type: GET/PATCH

Define or get offload/retention policies of a Pulsar add-on. Retention is how long messages are kept in the topic. Offload is how long messages are kept in the hot storage (NVMe SSD) before being moved to Cellar object storage (S3 compatible, HDD).

Example query/response:

{
  "retentionPolicies": {
    "sizeInMB": number,
    "durationInDays": number
  },
  "offloadPolicies": {
    "durationInDays": number,
    "sizeInMB": number
  }
}

A null value means an infinite retention or no offload.

Last updated on

Did this documentation help you ?