---
agentTools:
  projectIndex: https://hermae.readme.io/llms.txt
---

# Get Exchanges

Get a history of exchanges between a user and the assistants.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.2.1",
    "title": "Hermae API",
    "description": "API for managing the Hermae application."
  },
  "servers": [
    {
      "url": "https://api.hermae.com"
    }
  ],
  "security": [
    {
      "HermaeKeyAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "HermaeKeyAuth": {
        "type": "apiKey",
        "name": "x-hermae-key",
        "in": "header",
        "description": "Your API key for authentication."
      }
    },
    "schemas": {
      "OrganizationID": {
        "type": "string",
        "example": "A1B2C3D4E6"
      },
      "SpaceID": {
        "type": "string",
        "example": "A1B2C3D4E6"
      }
    },
    "parameters": {
      "OrganizationID": {
        "schema": {
          "$ref": "#/components/schemas/OrganizationID"
        },
        "required": true,
        "name": "organizationId",
        "in": "path"
      },
      "SpaceID": {
        "schema": {
          "$ref": "#/components/schemas/SpaceID"
        },
        "required": true,
        "name": "spaceId",
        "in": "path"
      }
    }
  },
  "paths": {
    "/organizations/{organizationId}/spaces/{spaceId}/exchanges": {
      "get": {
        "summary": "Get Exchanges",
        "description": "Get a history of exchanges between a user and the assistants.",
        "tags": [
          "Exchanges"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OrganizationID"
          },
          {
            "$ref": "#/components/parameters/SpaceID"
          }
        ],
        "responses": {
          "200": {
            "description": "Array of exchanges.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "number"
                    },
                    "returns": {
                      "type": "object",
                      "properties": {
                        "exchanges": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "space_id": {
                                "type": "string"
                              },
                              "organization_id": {
                                "type": "string"
                              },
                              "conversation_id": {
                                "type": "string"
                              },
                              "formatted_prompt": {
                                "type": "string"
                              },
                              "formatted_prompt_iv": {
                                "type": "string"
                              },
                              "formatted_prompt_auth_tag": {
                                "type": "string"
                              },
                              "user_prompt": {
                                "type": "string"
                              },
                              "user_prompt_iv": {
                                "type": "string"
                              },
                              "user_prompt_auth_tag": {
                                "type": "string"
                              },
                              "completion": {
                                "type": "string"
                              },
                              "completion_iv": {
                                "type": "string"
                              },
                              "completion_auth_tag": {
                                "type": "string"
                              },
                              "origin": {
                                "type": "string",
                                "maxLength": 16,
                                "description": "A string representing where this exchange originates from."
                              },
                              "tokens": {
                                "type": "number"
                              },
                              "created_at": {
                                "type": "string"
                              },
                              "metadata": {
                                "type": "object",
                                "additionalProperties": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "maxLength": 128
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ]
                                }
                              },
                              "object": {
                                "type": "string",
                                "enum": [
                                  "exchange"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "space_id",
                              "organization_id",
                              "conversation_id",
                              "formatted_prompt",
                              "formatted_prompt_iv",
                              "formatted_prompt_auth_tag",
                              "user_prompt",
                              "user_prompt_iv",
                              "user_prompt_auth_tag",
                              "completion",
                              "completion_iv",
                              "completion_auth_tag",
                              "origin",
                              "tokens",
                              "created_at",
                              "object"
                            ]
                          }
                        }
                      },
                      "required": [
                        "exchanges"
                      ]
                    }
                  },
                  "required": [
                    "status",
                    "returns"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Resource not found.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "number"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 102,
      "1": 66,
      "2": 111,
      "3": 18,
      "4": 218,
      "5": 98,
      "6": 116,
      "7": 0,
      "8": 18,
      "9": 82,
      "10": 77,
      "11": 93
    }
  }
}
```