API Reference
Workspaces
Workspaces API endpoints
GET /workspaces
List workspaces
Authentication: Bearer token required
Responses
200 — List of workspaces
| Field | Type | Required | Description |
|---|---|---|---|
ok | boolean | Yes | |
data | array | Yes |
{
"ok": true,
"data": [
{
"id": "ws_abc123",
"name": "Manila Office",
"slug": "manila-office"
}
]
}Example
curl \
-H "Authorization: Bearer YOUR_TOKEN" \
https://api.nextpay.world/v1/workspacesGET /workspaces/{id}
Get workspace details
Authentication: Bearer token required
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Workspace ID |
Responses
200 — Workspace details
| Field | Type | Required | Description |
|---|---|---|---|
ok | boolean | Yes | |
data | object | Yes |
{
"ok": true,
"data": {
"id": "ws_abc123",
"name": "Manila Office",
"slug": "manila-office"
}
}Example
curl \
-H "Authorization: Bearer YOUR_TOKEN" \
https://api.nextpay.world/v1/workspaces/YOUR_WORKSPACE_IDGET /workspaces/{id}/members
List workspace members
Authentication: Bearer token required
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Workspace ID |
Responses
200 — List of members
| Field | Type | Required | Description |
|---|---|---|---|
ok | boolean | Yes | |
data | array | Yes |
{
"ok": true,
"data": [
{
"id": "usr_abc123",
"name": "Don Masakayan",
"email": "don@nextfinancial.io",
"roles": [
"admin",
"member"
]
}
]
}Example
curl \
-H "Authorization: Bearer YOUR_TOKEN" \
https://api.nextpay.world/v1/workspaces/YOUR_WORKSPACE_ID/membersPOST /workspaces/{id}/members
Add a workspace member
Authentication: Bearer token required
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Workspace ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | |
role | string | Yes |
Example Request
{
"email": "juan@nextfinancial.io",
"role": "member"
}Responses
200 — Member added
| Field | Type | Required | Description |
|---|---|---|---|
ok | boolean | Yes | |
data | object | Yes |
{
"ok": true,
"data": {
"workspace_id": "ws_abc123",
"email": "juan@nextfinancial.io",
"role": "member"
}
}Example
curl -X POST \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"email":"juan@nextfinancial.io","role":"member"}' \
https://api.nextpay.world/v1/workspaces/YOUR_WORKSPACE_ID/membersDELETE /workspaces/{id}/members/{userId}
Remove a workspace member
Authentication: Bearer token required
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Workspace ID |
userId | string | Yes | User ID to remove |
Responses
200 — Member removed
| Field | Type | Required | Description |
|---|---|---|---|
ok | boolean | Yes | |
data | object | Yes |
{
"ok": true,
"data": {
"workspace_id": "ws_abc123",
"user_id": "usr_def456"
}
}Example
curl -X DELETE \
-H "Authorization: Bearer YOUR_TOKEN" \
https://api.nextpay.world/v1/workspaces/YOUR_WORKSPACE_ID/members/YOUR_USER_IDGET /workspaces/{id}/roles
List workspace roles
Authentication: Bearer token required
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Workspace ID |
Responses
200 — List of roles
| Field | Type | Required | Description |
|---|---|---|---|
ok | boolean | Yes | |
data | array | Yes |
{
"ok": true,
"data": [
{
"key": "admin",
"name": "Admin",
"color": "blue",
"permissions": [
"ws.members.read",
"ws.members.write"
]
}
]
}Example
curl \
-H "Authorization: Bearer YOUR_TOKEN" \
https://api.nextpay.world/v1/workspaces/YOUR_WORKSPACE_ID/rolesPOST /workspaces/{id}/roles
Assign a role
Authentication: Bearer token required
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Workspace ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
user_id | string | Yes | |
role | string | Yes |
Example Request
{
"user_id": "usr_def456",
"role": "admin"
}Responses
200 — Role assigned
| Field | Type | Required | Description |
|---|---|---|---|
ok | boolean | Yes | |
data | object | Yes |
{
"ok": true,
"data": {
"workspace_id": "ws_abc123",
"user_id": "usr_def456",
"role": "admin"
}
}Example
curl -X POST \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"user_id":"usr_def456","role":"admin"}' \
https://api.nextpay.world/v1/workspaces/YOUR_WORKSPACE_ID/rolesDELETE /workspaces/{id}/roles/{userId}/{role}
Remove a role
Authentication: Bearer token required
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Workspace ID |
userId | string | Yes | User ID |
role | string | Yes | Role key to remove |
Responses
200 — Role removed
| Field | Type | Required | Description |
|---|---|---|---|
ok | boolean | Yes | |
data | object | Yes |
{
"ok": true,
"data": {
"workspace_id": "ws_abc123",
"user_id": "usr_def456",
"role": "admin"
}
}Example
curl -X DELETE \
-H "Authorization: Bearer YOUR_TOKEN" \
https://api.nextpay.world/v1/workspaces/YOUR_WORKSPACE_ID/roles/YOUR_USER_ID/admin