# API reference

Manage instances, networks, storage, databases and keys from code, whether that is scripts, CI pipelines, Terraform or AI agents, with an API key.

Source: https://docs.pantechdynamics.com/api

The public API does everything the console does for your infrastructure: create and manage instances, VPC networks, firewalls, public IPs, volumes, snapshots, managed databases, SSH keys and webhooks, and read what they cost.

```http
https://api.pantechdynamics.com/public/v1
```

## Your first three calls

You need an [API key](https://docs.pantechdynamics.com/getting-started/api-keys). Keep it in an environment variable, never in code.

```console
$ export PANTECH_API_KEY=PAN_…
```

1. Check the key, and what it may do:

   ```console
   $ curl https://api.pantechdynamics.com/public/v1/me \
       -H "Authorization: Bearer $PANTECH_API_KEY"
   ```

2. See what you can create. Plans are instance sizes; images are operating systems:

   ```console
   $ curl https://api.pantechdynamics.com/public/v1/plans \
       -H "Authorization: Bearer $PANTECH_API_KEY"
   $ curl https://api.pantechdynamics.com/public/v1/images \
       -H "Authorization: Bearer $PANTECH_API_KEY"
   ```

3. List your instances:

   ```console
   $ curl https://api.pantechdynamics.com/public/v1/instances \
       -H "Authorization: Bearer $PANTECH_API_KEY"
   ```

From there, [Examples](https://docs.pantechdynamics.com/api/examples) builds a server end to end.

## How the API works

These rules hold for every endpoint, so learn them once.

- **Authentication.** Send your key on every request: `Authorization: Bearer PAN_…`. A read key can call every `GET`; a write key can also create, change and delete. See [Authentication](https://docs.pantechdynamics.com/api/authentication).
- **Changes are asynchronous.** A write returns `202 Accepted` with an `operation_id`. Poll [the operation](https://docs.pantechdynamics.com/api/operations) until its `status` is `succeeded` or `failed`. A new instance or database returns an order instead: an [instance order](https://docs.pantechdynamics.com/api/instance-orders) or a [database order](https://docs.pantechdynamics.com/api/database-orders).
- **Every write needs an `Idempotency-Key`.** Send a fresh UUID per change, and the same one when you retry it. A retry never does the work twice.
- **Lists are paged.** They return `{ "data": [...], "next_cursor": "…" }`. Pass `next_cursor` back as `cursor` until it is `null`.
- **Errors say what went wrong.** Every error is a JSON problem document with a stable `code`, like `INSUFFICIENT_CREDIT`. Branch on `code`. See [Errors](https://docs.pantechdynamics.com/api/errors).
- **Rate limits are per key.** Every response says how many requests you have left in `RateLimit-Remaining`.
- **Money is in minor units.** `amount_minor: 1059200` in NGN is ₦10,592.00. In USD it is cents.

[Requests and responses](https://docs.pantechdynamics.com/api/conventions) covers each of these in full.

## What you can manage

::::cards
:::card[Instances]{href=/api/instances cta="Reference"}
Create, power, resize, rebuild, restore and delete virtual machines.
:::
:::card[VPC networks]{href=/api/networks cta="Reference"}
Private networks, subnets and subnet firewall rules.
:::
:::card[Public IPs]{href=/api/public-ips cta="Reference"}
Addresses for VPC instances, with static NAT or port forwarding.
:::
:::card[Security groups]{href=/api/security-groups cta="Reference"}
Reusable firewalls for standard instances.
:::
:::card[Volumes]{href=/api/volumes cta="Reference"}
Data disks you attach, grow and detach.
:::
:::card[Snapshots]{href=/api/snapshots cta="Reference"}
Point-in-time copies, restores and automatic schedules.
:::
:::card[Databases]{href=/api/databases cta="Reference"}
Managed PostgreSQL, MySQL and MariaDB: create, secure, set passwords and delete.
:::
::::

Also: [SSH keys](https://docs.pantechdynamics.com/api/ssh-keys), [webhooks](https://docs.pantechdynamics.com/api/webhooks) that tell you when something changes, the [catalogue](https://docs.pantechdynamics.com/api/catalogue) of plans, images and prices, [operations](https://docs.pantechdynamics.com/api/operations), [usage](https://docs.pantechdynamics.com/api/usage), [billing](https://docs.pantechdynamics.com/api/billing) and [your key](https://docs.pantechdynamics.com/api/account).

## For AI agents and tools

The API is described by an OpenAPI 3.1 contract, and these docs are published as plain text, so an agent or a code generator can read them directly:

- The [agent brief](https://docs.pantechdynamics.com/agent-brief.md): the whole API in one Markdown file, written for agents. Give an agent this link and a key.
- The contract: [`/openapi/public-api.yaml`](https://docs.pantechdynamics.com/openapi/public-api.yaml) and [`/openapi/public-api.json`](https://docs.pantechdynamics.com/openapi/public-api.json).
- Collections of every endpoint, ready to run, for [Postman](https://docs.pantechdynamics.com/postman/pantech-public-api.postman_collection.json), [Insomnia](https://docs.pantechdynamics.com/insomnia/pantech-public-api.insomnia.json) and [Bruno](https://docs.pantechdynamics.com/bruno/pantech-public-api.bruno.zip). [Collections and OpenAPI](https://docs.pantechdynamics.com/api/postman-openapi) shows how to import each.
- A [Terraform provider](https://docs.pantechdynamics.com/terraform), for managing your infrastructure as code.
- An index of these docs: [`/llms.txt`](https://docs.pantechdynamics.com/llms.txt). The whole API reference as one file: [`/llms-full.txt`](https://docs.pantechdynamics.com/llms-full.txt). Any single page as Markdown: `/md/` plus its path, such as [`/md/api/instances`](https://docs.pantechdynamics.com/md/api/instances).

[Using the API from an AI agent](https://docs.pantechdynamics.com/api/ai-agents) explains how to give an agent safe access.

## What the API does not do

Billing, payments, team members, invites, organization settings and API keys themselves are managed in the [console](https://console.pantechdynamics.com) only. A key cannot reach them, so a leaked key cannot change who has access or how you pay.
