Praemunio PHP SDK#
Official PHP client for the Praemunio API.Installation#
Or add to your composer.json:{
"require": {
"praemunio/sdk": "^1.0"
}
}
Quick Start#
1. Get Your API Keys#
Public Key: pk_test_... (sandbox) or pk_live_... (production)
Secret Key: sk_test_... (sandbox) or sk_live_... (production)
2. Initialize the Client#
3. Authenticate#
4. First API Call#
5. Complete Example#
API Reference#
Workspaces API#
Access via $client->workspaces()list(?string $team_id = null)#
List all workspaces, optionally filtered by team.| Parameter | Type | Required | Description |
|---|
team_id | ?string | No | Filter by team ID |
drive()#
Get the drive (root folders) for the authenticated user.teams(?string $team_id = null)#
Get teams associated with workspaces.details(?string $workspace_id = null)#
create($request)#
| Parameter | Type | Required | Description |
|---|
name | string | Yes | Workspace name |
description | string | Yes | Workspace description |
team_id | string | Yes | Team ID to associate |
update($request)#
delete($request)#
Teams API#
Access via $client->teams()list()#
dashboard()#
Get teams dashboard data.info($body = null, ?array $team_id = null)#
workspaces(?string $team_id = null)#
Get workspaces associated with teams.logs(?array $team_id = null, ?string $page = null, ?string $limit = null)#
create($request)#
| Parameter | Type | Required | Description |
|---|
name | string | Yes | Team name |
description | ?string | No | Team description |
type | string | Yes | individual or legal_entity |
update($request)#
delete($request)#
Teams Members API#
Access via $client->teamsMembers()list(?string $team_id = null, ?float $page = null, ?float $limit = null)#
List team members with pagination.| Parameter | Type | Required | Description |
|---|
team_id | ?string | No | Team ID |
page | ?float | No | Page number (default: 1) |
limit | ?float | No | Items per page (default: 10) |
add($request)#
| Parameter | Type | Required | Description |
|---|
team_id | string | Yes | Team ID |
email | string | Yes | Member email |
Folders API#
Access via $client->folders()list(string $workspace_id)#
List folders in a workspace.| Parameter | Type | Required | Description |
|---|
workspace_id | string | Yes | Workspace ID |
content(?array $folder_id = null)#
details(?string $folder_id = null)#
create($request)#
| Parameter | Type | Required | Description |
|---|
workspace_id | string | Yes | Workspace ID |
name | string | Yes | Folder name |
description | ?string | No | Folder description |
parent_folder_id | ?string | No | Parent folder ID |
update($request)#
move($request)#
delete($request)#
Documents API#
Access via $client->documents()list(?string $workspace_id = null)#
List documents in a workspace.details(?string $document_id = null)#
upload(?string $workspace_id = null, ?string $folder_id = null, $file1 = null, $file2 = null)#
| Parameter | Type | Required | Description |
|---|
workspace_id | ?string | No | Workspace ID |
folder_id | ?string | No | Folder ID |
file1 | mixed | No | File (primary) |
file2 | mixed | No | File (secondary) |
stream($body = null, ?string $document_id = null)#
archive($request)#
| Parameter | Type | Required | Description |
|---|
document_id | string | Yes | Document ID |
reason | ?string | No | Archive reason |
restore($request)#
Restore an archived document.move($request)#
update($request)#
delete($request)#
Authentication#
Initial Authentication#
Automatic Token Refresh#
The SDK automatically handles token refresh. You can also force it manually:Manual Token Management#
Environments#
| Environment | URL | Usage |
|---|
| Sandbox | https://sandbox-api.praemunio.org/api/v1 | Testing and development |
| Live | https://api.praemunio.org/api/v1 | Production |
Error Handling#
PHP 8.1+#
The SDK supports PHP 8.1 and later versions.Documentation#
Support#
Modified at 2026-11-24 13:53:27