Skip to content

Make your first API call

Create an API key, then list your organization and its projects with curl.

Updated View as Markdown

You need an account in an organization. See Create an account.

Create an API key

An API key acts as you, with exactly your access. See Authentication.

  1. In the console, open the account menu (your name or email, top right) and click API keys.
  2. Click Create API key.
  3. Enter a Name, choose when it Expires (30 days, 90 days, 1 year or Never), and click Next.
  4. Check the details and click Create key.
  5. Click Copy. The key isn’t shown again.

Install the CLI first. On macOS and Linux:

curl -fsSL https://get.ezghcloud.com | sh
ezgh login
ezgh iam api-keys create my-first-key --expires-in-days 30

The key is printed once, on standard output. --expires-in-days takes 1 to 365; without it, the key doesn’t expire.

Keep the key in an environment variable:

export EZGH_API_KEY=ezgh_...

List your organization

curl https://orgs.ezghcloud.com/v1/organizations \
  -H "Authorization: Bearer $EZGH_API_KEY"
{
  "organizations": [
    {
      "id": "0199a3c2-5b1e-7d40-9f3a-2c8e6b1d4f70",
      "name": "Acme",
      "slug": "org_k3f9a0x2m7qp",
      "resourceName": "ezgh::org_k3f9a0x2m7qp",
      "createdAt": "2026-09-01T08:00:00.000Z",
      "updatedAt": "2026-09-01T08:00:00.000Z",
      "isRoot": true
    }
  ],
  "nextCursor": null
}

isRoot says whether the key’s owner is the organization’s root user. Save the id:

export ORG_ID=0199a3c2-5b1e-7d40-9f3a-2c8e6b1d4f70

List your projects

curl https://orgs.ezghcloud.com/v1/organizations/$ORG_ID/projects \
  -H "Authorization: Bearer $EZGH_API_KEY"
{
  "projects": [
    {
      "id": "0199a3c4-7a2b-7c1d-8e3f-4a5b6c7d8e9f",
      "organizationId": "0199a3c2-5b1e-7d40-9f3a-2c8e6b1d4f70",
      "name": "web",
      "slug": "prj_g7h8i9j0k1l2",
      "resourceName": "ezgh::org_k3f9a0x2m7qp:prj_g7h8i9j0k1l2",
      "createdAt": "2026-09-01T08:01:00.000Z",
      "updatedAt": "2026-09-01T08:01:00.000Z"
    }
  ],
  "nextCursor": null
}

The list shows the projects you’re allowed to list. A nextCursor that isn’t null means there’s another page. See Requests.

Next steps

Navigation

Type to search…

↑↓ navigate↵ selectEsc close