{
  "opencollection": "1.0.0",
  "info": {
    "name": "Gradient Labs API",
    "version": "1.0"
  },
  "request": {
    "auth": {
      "type": "bearer",
      "token": "{{apiKey}}"
    }
  },
  "items": [
    {
      "info": {
        "name": "Conversations",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Start a conversation",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.gradient-labs.ai/conversations",
            "body": {
              "type": "json",
              "data": "{\n  \"id\": \"conversation-1234\",\n  \"customer_id\": \"customer-5678\",\n  \"channel\": \"chat\",\n  \"assignee_type\": \"ai-agent\"\n}"
            }
          },
          "docs": "Creates a new conversation and optionally assigns it to the Gradient Labs AI agent."
        },
        {
          "info": {
            "name": "Read a conversation",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.gradient-labs.ai/conversations/:conversationID/read",
            "params": [
              {
                "name": "conversationID",
                "value": "",
                "type": "path",
                "description": "Your unique identifier for the conversation."
              }
            ]
          },
          "docs": "Returns the current state of a conversation."
        },
        {
          "info": {
            "name": "Finish a conversation",
            "type": "http"
          },
          "http": {
            "method": "PUT",
            "url": "https://api.gradient-labs.ai/conversations/:conversationID/finish",
            "params": [
              {
                "name": "conversationID",
                "value": "",
                "type": "path"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Marks a conversation as finished."
        },
        {
          "info": {
            "name": "Cancel a conversation",
            "type": "http"
          },
          "http": {
            "method": "PUT",
            "url": "https://api.gradient-labs.ai/conversations/:conversationID/cancel",
            "params": [
              {
                "name": "conversationID",
                "value": "",
                "type": "path"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Cancels a conversation, stopping the AI agent from working it."
        },
        {
          "info": {
            "name": "Resume a conversation",
            "type": "http"
          },
          "http": {
            "method": "PUT",
            "url": "https://api.gradient-labs.ai/conversations/:conversationID/resume",
            "params": [
              {
                "name": "conversationID",
                "value": "",
                "type": "path"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Resumes a previously finished or cancelled conversation."
        },
        {
          "info": {
            "name": "Rate a conversation",
            "type": "http"
          },
          "http": {
            "method": "PUT",
            "url": "https://api.gradient-labs.ai/conversations/:conversationID/rate",
            "params": [
              {
                "name": "conversationID",
                "value": "",
                "type": "path"
              }
            ],
            "body": {
              "type": "json",
              "data": "{\n  \"type\": \"csat\",\n  \"value\": 5,\n  \"min_value\": 1,\n  \"max_value\": 5\n}"
            }
          },
          "docs": "Records a customer satisfaction rating for a conversation."
        }
      ]
    },
    {
      "info": {
        "name": "Messages",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Add a message to a conversation",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.gradient-labs.ai/conversations/:conversationID/messages",
            "params": [
              {
                "name": "conversationID",
                "value": "",
                "type": "path"
              }
            ],
            "body": {
              "type": "json",
              "data": "{\n  \"id\": \"message-1\",\n  \"body\": \"Hi, I need help with a payment dispute.\",\n  \"participant_id\": \"customer-5678\",\n  \"participant_type\": \"customer\"\n}"
            }
          },
          "docs": "Adds an inbound customer or human-agent message for the AI agent to process."
        }
      ]
    },
    {
      "info": {
        "name": "Hand-off",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Assign a conversation",
            "type": "http"
          },
          "http": {
            "method": "PUT",
            "url": "https://api.gradient-labs.ai/conversations/:conversationID/assignee",
            "params": [
              {
                "name": "conversationID",
                "value": "",
                "type": "path"
              }
            ],
            "body": {
              "type": "json",
              "data": "{\n  \"assignee_type\": \"ai-agent\",\n  \"reason\": \"Routing to the AI agent\"\n}"
            }
          },
          "docs": "Assigns or reassigns a conversation between the AI agent and human participants."
        }
      ]
    },
    {
      "info": {
        "name": "Actions & Tools",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Create a tool",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.gradient-labs.ai/tools",
            "body": {
              "type": "json",
              "data": "{\n  \"id\": \"lookup-account\",\n  \"name\": \"Lookup Account\",\n  \"description\": \"Fetch an account by customer id.\"\n}"
            }
          },
          "docs": "Defines a business tool the AI agent can call. Requires a Management API key."
        },
        {
          "info": {
            "name": "Execute a tool",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.gradient-labs.ai/tools/:id/execute",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "The tool identifier."
              }
            ],
            "body": {
              "type": "json",
              "data": "{\n  \"id\": \"lookup-account\",\n  \"arguments\": [\n    { \"name\": \"customer_id\", \"value\": \"customer-5678\" }\n  ]\n}"
            }
          },
          "docs": "Executes a defined tool and returns its JSON-encoded result. Requires a Management API key."
        }
      ]
    },
    {
      "info": {
        "name": "Knowledge",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Upsert a knowledge article",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.gradient-labs.ai/articles",
            "body": {
              "type": "json",
              "data": "{\n  \"id\": \"refunds-policy\",\n  \"title\": \"Refunds Policy\",\n  \"description\": \"How refunds are handled.\",\n  \"body\": \"...\",\n  \"visibility\": \"public\",\n  \"status\": \"published\"\n}"
            }
          },
          "docs": "Creates or updates a knowledge-base article that grounds the AI agent."
        }
      ]
    }
  ],
  "bundled": true
}
