API ReferenceEndpoints

Command

User-defined slash command management API

MethodPathDescription
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 command

GET /api/v1/commands/{workspace}/{id}

Get a command by ID

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
idYesCommand ID

Responses

StatusDescription
200Command retrieved successfully
404Command not found

Response Shape

FieldTypeDescription
idstring (uuid)Command ID
aliasstringCommand alias (e.g., 'overdue-tasks', 'proj:list')
descriptionstringHuman-readable description of what the command does
interpretationstringGuidance for how the agent should interpret and present results
scriptTypestringScript type: CONSTRUCT or DESCRIBE
scriptContentstringSPARQL script content
workspaceIdstring (uuid)Workspace ID
ownerUserResponseUser who owns the command
createdAtstring (date-time)When the command was created
updatedAtstring (date-time)When the command was last updated

Example Response

{
  "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"
  }
}

Example

curl -X GET "https://poliglot.io/api/v1/commands/my-workspace/<id>" \
  -H "Authorization: Bearer <your-token>"

Update command

PUT /api/v1/commands/{workspace}/{id}

Update an existing command

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
idYesCommand ID

Request Body

Content-Type: application/json

FieldTypeDescription
aliasstringNew alias for the command (optional)
descriptionstringHuman-readable description of what the command does
interpretationstringGuidance for how the agent should interpret and present results
scriptTypestringScript type: CONSTRUCT or DESCRIBE
scriptContentstringSPARQL script content

Responses

StatusDescription
200Command updated successfully
400Invalid command data
404Command not found
409Command with alias already exists

Response Shape

FieldTypeDescription
idstring (uuid)Command ID
aliasstringCommand alias (e.g., 'overdue-tasks', 'proj:list')
descriptionstringHuman-readable description of what the command does
interpretationstringGuidance for how the agent should interpret and present results
scriptTypestringScript type: CONSTRUCT or DESCRIBE
scriptContentstringSPARQL script content
workspaceIdstring (uuid)Workspace ID
ownerUserResponseUser who owns the command
createdAtstring (date-time)When the command was created
updatedAtstring (date-time)When the command was last updated

Example Response

{
  "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"
  }
}

Example

curl -X PUT "https://poliglot.io/api/v1/commands/my-workspace/<id>" \
  -H "Authorization: Bearer <your-token>"
  -H "Content-Type: application/json" \
  -d '{}'

Delete command

DELETE /api/v1/commands/{workspace}/{id}

Delete an existing command

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug
idYesCommand ID

Responses

StatusDescription
200Command deleted successfully
404Command not found

Example Response

{
  "success": true,
  "data": "string"
}

Example

curl -X DELETE "https://poliglot.io/api/v1/commands/my-workspace/<id>" \
  -H "Authorization: Bearer <your-token>"

List commands

GET /api/v1/commands/{workspace}

List all commands owned by the current user in a workspace

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug

Responses

StatusDescription
200Commands retrieved successfully

Example Response

{
  "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"
    }
  ]
}

Example

curl -X GET "https://poliglot.io/api/v1/commands/my-workspace" \
  -H "Authorization: Bearer <your-token>"

Create command

POST /api/v1/commands/{workspace}

Create a new slash command

Path Parameters

NameRequiredDescription
workspaceYesWorkspace slug

Request Body

Content-Type: application/json

FieldTypeDescription
aliasstringCommand alias without leading slash
descriptionstringHuman-readable description of what the command does
interpretationstringGuidance for how the agent should interpret and present results
scriptTypestringScript type: CONSTRUCT or DESCRIBE
scriptContentstringSPARQL script content

Responses

StatusDescription
200Command created successfully
400Invalid command data
409Command with alias already exists

Response Shape

FieldTypeDescription
idstring (uuid)Command ID
aliasstringCommand alias (e.g., 'overdue-tasks', 'proj:list')
descriptionstringHuman-readable description of what the command does
interpretationstringGuidance for how the agent should interpret and present results
scriptTypestringScript type: CONSTRUCT or DESCRIBE
scriptContentstringSPARQL script content
workspaceIdstring (uuid)Workspace ID
ownerUserResponseUser who owns the command
createdAtstring (date-time)When the command was created
updatedAtstring (date-time)When the command was last updated

Example Response

{
  "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"
  }
}

Example

curl -X POST "https://poliglot.io/api/v1/commands/my-workspace" \
  -H "Authorization: Bearer <your-token>"
  -H "Content-Type: application/json" \
  -d '{}'

On this page