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

# Endpoints

> Key API endpoints and resource overview for the Upsun REST API.

All API requests are made to the base URL:

```
https://api.upsun.com
```

The API follows the OpenAPI (Swagger) specification and returns [HAL-style JSON](/api/rest/errors#hal-response-structure) over HTTPS.

## Resource overview

The API is organized around these primary resources:

| Resource          | Base path                         | Description                                          |
| ----------------- | --------------------------------- | ---------------------------------------------------- |
| **Organizations** | `/organizations`                  | Create, list, update, and delete organizations       |
| **Projects**      | `/projects`                       | Manage projects and their settings                   |
| **Environments**  | `/projects/{id}/environments`     | Branch, merge, activate, and deactivate environments |
| **Subscriptions** | `/subscriptions`                  | Manage project subscriptions and plans               |
| **Users**         | `/users`                          | User profiles and account management                 |
| **Members**       | `/organizations/{id}/members`     | Organization membership and permissions              |
| **Invitations**   | `/organizations/{id}/invitations` | Invite users to organizations                        |

## Common patterns

### Pagination

List endpoints support pagination with query parameters:

| Parameter      | Description                        |
| -------------- | ---------------------------------- |
| `page[size]`   | Number of results per page (1–100) |
| `page[before]` | Cursor for previous page           |
| `page[after]`  | Cursor for next page               |

### Sorting

Use the `sort` parameter on list endpoints. Prefix with `-` for descending order:

```bash theme={null}
# Sort by creation date, newest first
curl -H "Authorization: Bearer $TOKEN" \
  "https://api.upsun.com/organizations?sort=-created_at"
```

### Filtering

Most list endpoints accept filter parameters specific to the resource:

```bash theme={null}
# Filter organizations by status
curl -H "Authorization: Bearer $TOKEN" \
  "https://api.upsun.com/organizations?filter[status]=active"
```

## Quick reference

<CardGroup cols={2}>
  <Card title="OpenAPI Reference" icon="book-open" href="/api/rest/overview">
    Browse the full interactive API reference with schemas and example payloads.
  </Card>

  <Card title="Authentication" icon="lock" href="/api/rest/authentication">
    Set up API tokens and authenticate your requests.
  </Card>
</CardGroup>
