> ## Documentation Index
> Fetch the complete documentation index at: https://developers.aptranet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Distributions

> Create, inspect, and delete Cloud CDN delivery resources.

A distribution connects an origin group to an Aptranet edge hostname. Its configuration determines delivery behavior.

## Create a distribution

Provide:

* A name between 4 and 64 characters.
* An origin group ID from the same project.
* An origin connection protocol: `http`, `https`, or `match`.

`match` uses the visitor's protocol for the origin connection, so the origin must support both HTTP and HTTPS. Prefer `https` for a consistent encrypted origin path.

```bash theme={null}
curl --request POST \
  --url https://api.aptranet.com/cloud-cdn/distributions \
  --header "Authorization: Bearer $APTRANET_ACCESS_KEY" \
  --header "Aptranet-Secret: $APTRANET_SECRET" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "production-web",
    "origin_group_id": 42,
    "origin_connection_protocol": "https"
  }'
```

## Lifecycle states

| Status | Meaning |
| - | - |
| `provisioning` | The edge resource is being prepared |
| `active` | The distribution can serve traffic |
| `inactive` | Delivery is not active |
| `suspended` | Delivery is restricted by platform or account state |
| `deleted` | The resource has been removed from service |

Do not assume a create response means every edge location is ready. Poll the distribution list and test the assigned hostname.

## Delete a distribution

Deletion removes the delivery resource. Remove production DNS records first, account for their TTL, and retain the origin until traffic has drained.

<Warning>
  Distribution deletion is destructive. Cache contents, configuration, and the assigned delivery resource cannot be recovered through the API.
</Warning>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.