Register an uploaded S3 object as a file (internal)

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://docs.usehearsay.com/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "integrations MCP server": {
    "url": "https://docs.usehearsay.com/mcp"
  }
}

Close
POST /common/file/add

Desktop plumbing: registers an object already in the user-data bucket as a file record (name from the key, content type from type or from S3) and returns it; a key that is already registered returns the existing record. Returns 404 when the key is not in the bucket. Keys in folders the API writes itself (email bodies, certificates, statements, exports, logs, device backups) cannot be registered (403).

application/json

Body Required

  • fileKey string Required

    S3 file key (path in bucket)

  • type string

    Override content type (e.g. "application/pdf"). If not provided, uses the content type from S3.

Responses

  • 201 application/json
    Hide response attributes Show response attributes object
    • data object Required
      Hide data attributes Show data attributes object
      • createdAt string(date-time) Required
      • updatedAt string(date-time) Required
      • id string Required
      • name string Required
      • providerId string Required
      • convertedName string | null Required
      • convertedProviderId string Required
      • provider string Required
      • size number Required

        Size in bytes

      • transferState number | null Required
    • statusCode number Required
    • timestamp string(date-time) Required
POST /common/file/add
curl \
 --request POST 'http://api.example.com/common/file/add' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{
  "fileKey": "string",
  "type": "string"
}'
Request examples
{
  "fileKey": "string",
  "type": "string"
}
Response examples (201)
{
  "data": {
    "createdAt": "2026-01-15T14:30:00.000Z",
    "updatedAt": "2026-01-15T14:30:00.000Z",
    "id": "507f1f77bcf86cd799439011",
    "name": "photo.heic",
    "providerId": "uploads/507f1f77bcf86cd799439011/photo.heic",
    "convertedName": "photo.jpg",
    "convertedProviderId": "uploads/507f1f77bcf86cd799439011/photo.jpg",
    "provider": "s3",
    "size": 204800,
    "transferState": 42.0
  },
  "statusCode": 201,
  "timestamp": "2026-01-15T10:15:00.000Z"
}