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

# Global packages API

> Browse the global package catalog and link packages to your tenant.

# Global packages API

Prefix: `/packages`

## Public catalog

No API key required.

```
GET /packages/global
GET /packages/global/{package_id}
```

Query params for list: `ecosystem`, `query`, `skip`, `limit` (max 100).

## Tenant links (authenticated)

```
POST /packages/add
GET /packages/my-packages
DELETE /packages/my-packages/{link_id}
```

`POST /packages/add` body:

```json theme={null}
{
  "ecosystem": "npm",
  "name": "express",
  "version": "4.18.2"
}
```

Creates or reuses the global package, starts indexing for your tenant, and returns the link record.

<RequestExample>
  ```bash theme={null}
  curl https://api.trygroundai.com/packages/global?ecosystem=npm&limit=20
  ```

  ```bash theme={null}
  curl -X POST https://api.trygroundai.com/packages/add \
    -H "Authorization: Bearer gnd_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{"ecosystem":"npm","name":"express","version":"4.18.2"}'
  ```
</RequestExample>
