Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api basic #198

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions apps/docs/content/references/api.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
title: REST API Reference
desc: Overview of Zerops REST API endpoints and authentication, designed to help you integrate with Zerops programmatically
---

The Zerops REST API allows you to programmatically interact with Zerops platform by providing access to resources like projects, services, users, billing, and configurations.

## Base URL

All API requests should be made to:
```
https://api.app-prg1.zerops.io/api/rest/public
```

## Authentication

The API uses Bearer token authentication. You can obtain your Personal access token from the **Access Token management** section in the Zerops GUI.

Include the token in the Authorization header:
```
Authorization: Bearer <your-token>
```

## API Resources

:::note
Some resource groups have non-obvious naming:
- `/service-stack` endpoints handle services management
- `/user-data` endpoints handle environment variables management
:::

View the [full Swagger documentation](https://api.app-prg1.zerops.io/api/rest/public/swagger) or jump to a specific resource group:

<table className="w-full">
<thead className="rounded-lg">
<tr>
<th className="w-auto"><strong>Group</strong></th>
<th className="w-full"><strong>Description</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicAppVersion">/app-version</a></strong></td>
<td className="w-fit">Manage application versions, builds, and deployments</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicAuth">/auth</a></strong></td>
<td className="w-fit">Authentication and token management</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicBilling">/billing</a></strong></td>
<td className="w-fit">Billing operations and payment management</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicClient">/client</a></strong></td>
<td className="w-fit">Client account management</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicClientUser">/client-user</a></strong></td>
<td className="w-fit">User management within client accounts</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicGithub">/github</a></strong></td>
<td className="w-fit">GitHub repository connections and authorization</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicGitlab">/gitlab</a></strong></td>
<td className="w-fit">GitLab repository connections and authorization</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicProject">/project</a></strong></td>
<td className="w-fit">Project management operations</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicProjectEnv">/project-env</a></strong></td>
<td className="w-fit">Project environment variables management</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicPublicHttpRouting">/public-http-routing</a></strong></td>
<td className="w-fit">HTTP routing configuration</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicPublicPortRouting">/public-port-routing</a></strong></td>
<td className="w-fit">Port routing and firewall rules configuration</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicServiceStack">/service-stack</a></strong></td>
<td className="w-fit">Service stack operations and configuration</td>
</tr>
<tr>
<td className="w-fit"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicSettings">/settings</a></strong></td>
<td className="w-fit">System settings and configurations</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicUser">/user</a></strong></td>
<td className="w-fit">User account management</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicUserData">/user-data</a></strong></td>
<td className="w-fit">Environment variables management</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicUserNotification">/user-notification</a></strong></td>
<td className="w-fit">User notifications management</td>
</tr>
<tr>
<td className="w-fit whitespace-nowrap"><strong><a href="https://api.app-prg1.zerops.io/api/rest/public/swagger/#/PublicUserToken">/user-token</a></strong></td>
<td className="w-fit">Personal access tokens management</td>
</tr>
</tbody>
</table>
9 changes: 9 additions & 0 deletions apps/docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,15 @@ module.exports = {
},
className: 'homepage-sidebar-item',
},
{
type: 'doc',
id: 'references/api',
label: 'API',
customProps: {
sidebar_icon: 'curly-braces',
},
className: 'homepage-sidebar-item',
},
{
type: 'html',
value: 'Help',
Expand Down
27 changes: 27 additions & 0 deletions apps/docs/src/theme/Icon/CurlyBraces/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { IconProps } from '@medusajs/icons/dist/types';
import clsx from 'clsx';
import React from 'react';

const IconCurlyBraces = (props: IconProps) => {
return (
<svg
width={props.width || 20}
height={props.height || 20}
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
className={clsx('text-ui-fg-subtle ${className}', props.className)}
>
<path
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M9.5 5H9a2 2 0 0 0-2 2v2c0 1-.6 3-3 3 1 0 3 .6 3 3v2a2 2 0 0 0 2 2h.5m5-14h.5a2 2 0 0 1 2 2v2c0 1 .6 3 3 3-1 0-3 .6-3 3v2a2 2 0 0 1-2 2h-.5"
/>
</svg>
);
};

export default IconCurlyBraces;
4 changes: 3 additions & 1 deletion apps/docs/src/theme/Icon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
ComputerDesktopSolid,
CreditCardSolid,
CubeSolid,
CurlyBraces,
CurrencyDollar,
CurrencyDollarSolid,
Discord,
Expand Down Expand Up @@ -150,7 +151,7 @@ import IconCloudOk from './CloudOk';
import IconGitlab from './Gitlab';
import IconTypesense from './Typesense';
import IconDocker from './Docker';

import IconCurlyBraces from './CurlyBraces';

export default {
'academic-cap-solid': AcademicCapSolid,
Expand Down Expand Up @@ -306,4 +307,5 @@ export default {
database: IconDatabase,
cloudok: IconCloudOk,
typesense: IconTypesense,
'curly-braces': IconCurlyBraces,
};