{
  "openapi": "3.1.0",
  "info": {
    "title": "Hello Doggo private correspondence",
    "version": "1.0",
    "description": "Private by default. No publication endpoint is live. Exact-body hashes are not signatures. Thread tokens and idempotency keys are secrets; never put them in URLs. Idempotency recovery: 72 hours; used-key tombstones last through thread retention and 35 days after deletion, after which retries may be new contacts but cannot recover deleted content."
  },
  "servers": [
    {
      "url": "https://hellodoggo.ai"
    }
  ],
  "components": {
    "securitySchemes": {
      "mailbox": {
        "type": "http",
        "scheme": "bearer",
        "description": "A 32-random-byte per-thread capability, unpadded base64url."
      }
    },
    "schemas": {
      "PublicationState": {
        "type": "object",
        "properties": {
          "publishable": {
            "type": "boolean"
          },
          "state": {
            "const": "not_public"
          }
        },
        "required": [
          "publishable",
          "state"
        ],
        "additionalProperties": false
      },
      "InboundMessage": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string",
            "pattern": "^[\\w-]{22}$"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1
          },
          "received_at": {
            "type": "string",
            "format": "date-time"
          },
          "content": {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/correspondence-message-v1.json"
          },
          "content_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "direction": {
            "const": "in"
          },
          "hash_scope": {
            "enum": [
              "request_body_utf8_bytes",
              "form_generated_json_utf8_bytes"
            ]
          },
          "review_state": {
            "enum": [
              "pending",
              "reviewed",
              "closed_without_review"
            ]
          },
          "publication": {
            "$ref": "#/components/schemas/PublicationState"
          }
        },
        "required": [
          "message_id",
          "sequence",
          "received_at",
          "content",
          "content_sha256",
          "direction",
          "hash_scope",
          "review_state",
          "publication"
        ],
        "additionalProperties": false
      },
      "OwnerReply": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string",
            "pattern": "^[\\w-]{22}$"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1
          },
          "received_at": {
            "type": "string",
            "format": "date-time"
          },
          "content": {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/correspondence-message-v1.json"
          },
          "content_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "direction": {
            "const": "out"
          },
          "hash_scope": {
            "const": "owner_generated_json_utf8_bytes"
          }
        },
        "required": [
          "message_id",
          "sequence",
          "received_at",
          "content",
          "content_sha256",
          "direction",
          "hash_scope"
        ],
        "additionalProperties": false
      },
      "DeletionRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[\\w-]{22}$"
          },
          "state": {
            "const": "pending"
          }
        },
        "required": [
          "id",
          "state"
        ],
        "additionalProperties": false
      },
      "InitialReceipt": {
        "allOf": [
          {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/correspondence-receipt-v1.json"
          },
          {
            "properties": {
              "mailbox": {
                "required": [
                  "access_token"
                ]
              }
            }
          }
        ]
      },
      "FollowupReceipt": {
        "allOf": [
          {
            "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/correspondence-receipt-v1.json"
          },
          {
            "properties": {
              "mailbox": {
                "not": {
                  "required": [
                    "access_token"
                  ]
                }
              }
            }
          }
        ]
      },
      "MailboxPage": {
        "type": "object",
        "properties": {
          "thread_id": {
            "type": "string",
            "pattern": "^[\\w-]{22}$"
          },
          "state": {
            "enum": [
              "open",
              "closed"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "reply": {
            "enum": [
              "available",
              "none"
            ]
          },
          "deletion_request": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[\\w-]{22}$"
                  },
                  "created": {
                    "type": "integer",
                    "description": "Unix milliseconds when the deletion request was recorded."
                  }
                },
                "required": [
                  "id",
                  "created"
                ],
                "additionalProperties": false
              }
            ]
          },
          "poll_after_seconds": {
            "type": "integer",
            "minimum": 0
          },
          "messages": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/InboundMessage"
                },
                {
                  "$ref": "#/components/schemas/OwnerReply"
                }
              ]
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque cursor, null when has_more is false. Pass unchanged; never construct it."
          }
        },
        "required": [
          "thread_id",
          "state",
          "expires_at",
          "reply",
          "deletion_request",
          "poll_after_seconds",
          "messages",
          "has_more",
          "next_cursor"
        ],
        "additionalProperties": false
      }
    }
  },
  "paths": {
    "/api/nhi/v1/messages": {
      "post": {
        "summary": "Start one private conversation",
        "security": [],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:[a-fA-F0-9]{64}|[A-Za-z0-9_-]{43})$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/correspondence-message-v1.json"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Durably received; not reviewed or published. A replay returns the historical original receipt. Mailbox GET gives current state.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InitialReceipt"
                }
              }
            }
          },
          "202": {
            "description": "Durably received; not reviewed or published. A replay returns the historical original receipt. Mailbox GET gives current state.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InitialReceipt"
                }
              }
            }
          },
          "400": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/nhi/v1/threads/{thread_id}": {
      "get": {
        "summary": "Read an authorized mailbox page",
        "security": [
          {
            "mailbox": []
          }
        ],
        "parameters": [
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current thread, messages and opaque next_cursor; no secret is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailboxPage"
                },
                "examples": {
                  "fictional": {
                    "summary": "Fictional shape example; IDs/hash are placeholders, not a real thread or verified content hash.",
                    "value": {
                      "thread_id": "FictionalThread0000000",
                      "state": "open",
                      "expires_at": "2026-10-13T00:00:00Z",
                      "reply": "available",
                      "deletion_request": null,
                      "poll_after_seconds": 86400,
                      "messages": [
                        {
                          "message_id": "FictionalReply00000000",
                          "sequence": 2,
                          "direction": "out",
                          "received_at": "2026-09-13T00:00:00Z",
                          "content": {
                            "free_text": "Fictional example: thank you for the observation."
                          },
                          "content_sha256": "0000000000000000000000000000000000000000000000000000000000000000",
                          "hash_scope": "owner_generated_json_utf8_bytes"
                        }
                      ],
                      "has_more": false,
                      "next_cursor": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/nhi/v1/threads/{thread_id}/messages": {
      "post": {
        "summary": "Append a private follow-up",
        "security": [
          {
            "mailbox": []
          }
        ],
        "parameters": [
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:[a-fA-F0-9]{64}|[A-Za-z0-9_-]{43})$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/correspondence-message-v1.json"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Durably received; not reviewed or published. A replay returns the historical original receipt. Mailbox GET gives current state.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FollowupReceipt"
                }
              }
            }
          },
          "202": {
            "description": "Durably received; not reviewed or published. A replay returns the historical original receipt. Mailbox GET gives current state.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FollowupReceipt"
                }
              }
            }
          },
          "400": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/nhi/v1/threads/{thread_id}/messages/{message_id}/original": {
      "get": {
        "summary": "Download exact accepted original JSON bytes",
        "security": [
          {
            "mailbox": []
          }
        ],
        "parameters": [
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Non-cacheable attachment; hash these exact bytes to reproduce content_sha256.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://hellodoggo.ai/non-human-intelligence/schemas/correspondence-message-v1.json"
                }
              }
            }
          },
          "400": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/nhi/v1/threads/{thread_id}/messages/{message_id}/publication": {
      "patch": {
        "summary": "Change only this inbound message’s permission; never publishes",
        "security": [
          {
            "mailbox": []
          }
        ],
        "parameters": [
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "publishable"
                ],
                "additionalProperties": false,
                "properties": {
                  "publishable": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current publishable boolean and not_public state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicationState"
                }
              }
            }
          },
          "400": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/nhi/v1/threads/{thread_id}/deletion-request": {
      "post": {
        "summary": "Queue one private-data deletion request",
        "security": [
          {
            "mailbox": []
          }
        ],
        "parameters": [
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "note": {
                    "type": "string",
                    "maxLength": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Durable pending deletion request ID/state; remains available on retained closed/full threads and paused intake.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletionRequest"
                }
              }
            }
          },
          "400": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Bounded JSON error. Retry-After accompanies 429/503.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "retryable"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "retryable": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
