Command
User-defined slash command management API
| Method | Path | Description |
|---|
| GET | /api/v1/commands/{workspace}/{id} | Get command |
| PUT | /api/v1/commands/{workspace}/{id} | Update command |
| DELETE | /api/v1/commands/{workspace}/{id} | Delete command |
| GET | /api/v1/commands/{workspace} | List commands |
| POST | /api/v1/commands/{workspace} | Create command |
GET /api/v1/commands/{workspace}/{id}
Get a command by ID
| Name | Required | Description |
|---|
workspace | Yes | Workspace slug |
id | Yes | Command ID |
| Status | Description |
|---|
200 | Command retrieved successfully |
404 | Command not found |
| Field | Type | Description |
|---|
id | string (uuid) | Command ID |
alias | string | Command alias (e.g., 'overdue-tasks', 'proj:list') |
description | string | Human-readable description of what the command does |
interpretation | string | Guidance for how the agent should interpret and present results |
scriptType | string | Script type: CONSTRUCT or DESCRIBE |
scriptContent | string | SPARQL script content |
workspaceId | string (uuid) | Workspace ID |
owner | UserResponse | User who owns the command |
createdAt | string (date-time) | When the command was created |
updatedAt | string (date-time) | When the command was last updated |
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"alias": "string",
"description": "string",
"interpretation": "string",
"scriptType": "string",
"scriptContent": "string",
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"owner": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"username": "string",
"email": "string",
"firstName": "string",
"lastName": "string",
"website": "string",
"emailVerified": true,
"createdAt": "2025-03-28T14:22:03Z",
"updatedAt": "2025-03-28T14:22:03Z"
},
"createdAt": "2025-03-28T14:22:03Z",
"updatedAt": "2025-03-28T14:22:03Z"
}
}
curl -X GET "https://poliglot.io/api/v1/commands/my-workspace/<id>" \
-H "Authorization: Bearer <your-token>"
PUT /api/v1/commands/{workspace}/{id}
Update an existing command
| Name | Required | Description |
|---|
workspace | Yes | Workspace slug |
id | Yes | Command ID |
Content-Type: application/json
| Field | Type | Description |
|---|
alias | string | New alias for the command (optional) |
description | string | Human-readable description of what the command does |
interpretation | string | Guidance for how the agent should interpret and present results |
scriptType | string | Script type: CONSTRUCT or DESCRIBE |
scriptContent | string | SPARQL script content |
| Status | Description |
|---|
200 | Command updated successfully |
400 | Invalid command data |
404 | Command not found |
409 | Command with alias already exists |
| Field | Type | Description |
|---|
id | string (uuid) | Command ID |
alias | string | Command alias (e.g., 'overdue-tasks', 'proj:list') |
description | string | Human-readable description of what the command does |
interpretation | string | Guidance for how the agent should interpret and present results |
scriptType | string | Script type: CONSTRUCT or DESCRIBE |
scriptContent | string | SPARQL script content |
workspaceId | string (uuid) | Workspace ID |
owner | UserResponse | User who owns the command |
createdAt | string (date-time) | When the command was created |
updatedAt | string (date-time) | When the command was last updated |
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"alias": "string",
"description": "string",
"interpretation": "string",
"scriptType": "string",
"scriptContent": "string",
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"owner": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"username": "string",
"email": "string",
"firstName": "string",
"lastName": "string",
"website": "string",
"emailVerified": true,
"createdAt": "2025-03-28T14:22:03Z",
"updatedAt": "2025-03-28T14:22:03Z"
},
"createdAt": "2025-03-28T14:22:03Z",
"updatedAt": "2025-03-28T14:22:03Z"
}
}
curl -X PUT "https://poliglot.io/api/v1/commands/my-workspace/<id>" \
-H "Authorization: Bearer <your-token>"
-H "Content-Type: application/json" \
-d '{}'
DELETE /api/v1/commands/{workspace}/{id}
Delete an existing command
| Name | Required | Description |
|---|
workspace | Yes | Workspace slug |
id | Yes | Command ID |
| Status | Description |
|---|
200 | Command deleted successfully |
404 | Command not found |
{
"success": true,
"data": "string"
}
curl -X DELETE "https://poliglot.io/api/v1/commands/my-workspace/<id>" \
-H "Authorization: Bearer <your-token>"
GET /api/v1/commands/{workspace}
List all commands owned by the current user in a workspace
| Name | Required | Description |
|---|
workspace | Yes | Workspace slug |
| Status | Description |
|---|
200 | Commands retrieved successfully |
{
"success": true,
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"alias": "string",
"description": "string",
"interpretation": "string",
"scriptType": "string",
"scriptContent": "string",
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"owner": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"username": "string",
"email": "string",
"firstName": "string",
"lastName": "string",
"website": "string",
"emailVerified": true,
"createdAt": "2025-03-28T14:22:03Z",
"updatedAt": "2025-03-28T14:22:03Z"
},
"createdAt": "2025-03-28T14:22:03Z",
"updatedAt": "2025-03-28T14:22:03Z"
}
]
}
curl -X GET "https://poliglot.io/api/v1/commands/my-workspace" \
-H "Authorization: Bearer <your-token>"
POST /api/v1/commands/{workspace}
Create a new slash command
| Name | Required | Description |
|---|
workspace | Yes | Workspace slug |
Content-Type: application/json
| Field | Type | Description |
|---|
alias | string | Command alias without leading slash |
description | string | Human-readable description of what the command does |
interpretation | string | Guidance for how the agent should interpret and present results |
scriptType | string | Script type: CONSTRUCT or DESCRIBE |
scriptContent | string | SPARQL script content |
| Status | Description |
|---|
200 | Command created successfully |
400 | Invalid command data |
409 | Command with alias already exists |
| Field | Type | Description |
|---|
id | string (uuid) | Command ID |
alias | string | Command alias (e.g., 'overdue-tasks', 'proj:list') |
description | string | Human-readable description of what the command does |
interpretation | string | Guidance for how the agent should interpret and present results |
scriptType | string | Script type: CONSTRUCT or DESCRIBE |
scriptContent | string | SPARQL script content |
workspaceId | string (uuid) | Workspace ID |
owner | UserResponse | User who owns the command |
createdAt | string (date-time) | When the command was created |
updatedAt | string (date-time) | When the command was last updated |
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"alias": "string",
"description": "string",
"interpretation": "string",
"scriptType": "string",
"scriptContent": "string",
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"owner": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"username": "string",
"email": "string",
"firstName": "string",
"lastName": "string",
"website": "string",
"emailVerified": true,
"createdAt": "2025-03-28T14:22:03Z",
"updatedAt": "2025-03-28T14:22:03Z"
},
"createdAt": "2025-03-28T14:22:03Z",
"updatedAt": "2025-03-28T14:22:03Z"
}
}
curl -X POST "https://poliglot.io/api/v1/commands/my-workspace" \
-H "Authorization: Bearer <your-token>"
-H "Content-Type: application/json" \
-d '{}'