{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/groundmail-dev/json-schema/groundmail-dev-test-inbox-email-response-schema.json",
  "title": "TestInboxEmailResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/groundmail-dev-test-inbox-api-openapi.yml#/components/schemas/TestInboxEmailResponse",
  "type": "object",
  "required": [
    "email"
  ],
  "properties": {
    "email": {
      "$ref": "#/$defs/TestInboxEmailDetail"
    }
  },
  "$defs": {
    "TestInboxEmail": {
      "type": "object",
      "required": [
        "object",
        "id",
        "source",
        "email_id",
        "from",
        "to",
        "cc",
        "subject",
        "code",
        "links",
        "received_at",
        "expires_at"
      ],
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "test_inbox_email"
          ]
        },
        "id": {
          "type": "string"
        },
        "source": {
          "type": "string",
          "enum": [
            "inbound",
            "test_key"
          ],
          "description": "`inbound`: received at your test domain (from any provider). `test_key`: sent through Groundmail with a `gm_test_` key.\n"
        },
        "email_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "With `test_key`, the sent email's id (see GET /emails/{id})."
        },
        "from": {
          "type": "string"
        },
        "to": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "cc": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "subject": {
          "type": "string"
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The one-time code found in the email (4 to 8 digits), preferring one next to words like \"code\" or \"verification\". Null when there is none.\n"
        },
        "links": {
          "type": "array",
          "description": "http(s) links in the email, in order, without duplicates.",
          "items": {
            "type": "string"
          }
        },
        "received_at": {
          "type": "string",
          "format": "date-time"
        },
        "expires_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the email is deleted (14 days after it arrived)."
        }
      }
    },
    "TestInboxEmailDetail": {
      "allOf": [
        {
          "$ref": "#/$defs/TestInboxEmail"
        },
        {
          "type": "object",
          "required": [
            "text_body",
            "html_body",
            "headers",
            "raw_source"
          ],
          "properties": {
            "text_body": {
              "type": [
                "string",
                "null"
              ]
            },
            "html_body": {
              "type": [
                "string",
                "null"
              ]
            },
            "headers": {
              "type": "array",
              "description": "Message headers in order.",
              "items": {
                "$ref": "#/$defs/TestInboxHeader"
              }
            },
            "raw_source": {
              "type": [
                "string",
                "null"
              ],
              "description": "Raw message source, when available."
            }
          }
        }
      ]
    },
    "TestInboxHeader": {
      "type": "object",
      "required": [
        "name",
        "value"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    }
  }
}