{
  "about": "Test vectors for the ApiData-Signature header. Each has the endpoint secret, the timestamp t of the attempt, the body exactly as sent, the header as received, the time on your clock in Unix seconds (now), and whether verification must pass (valid). The secrets here are examples and open nothing.",
  "header": "ApiData-Signature: t={unix seconds},v1={hex HMAC-SHA256(secret, t + \".\" + body)}",
  "toleranceSeconds": 300,
  "vectors": [
    {
      "name": "a valid signature",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": 1794322802,
      "body": "{\"id\":\"evt_3yQ8mT1xKp7Zc2Nf5Rb9Wd\",\"type\":\"saved_search.matches\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"clientId\":\"visitor-8841\",\"savedSearchId\":\"ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R\",\"listingKeys\":[\"300451207716\"],\"changes\":[{\"listingKey\":\"300451207716\",\"reasons\":[\"new\"]}]}",
      "header": "t=1794322802,v1=159c4abb701aea6f695c139d5b25edfb4ba5018339dc6620604661b79d5cafbe",
      "now": 1794322803,
      "valid": true
    },
    {
      "name": "valid when your clock is exactly five minutes ahead",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": 1794322802,
      "body": "{\"id\":\"evt_3yQ8mT1xKp7Zc2Nf5Rb9Wd\",\"type\":\"saved_search.matches\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"clientId\":\"visitor-8841\",\"savedSearchId\":\"ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R\",\"listingKeys\":[\"300451207716\"],\"changes\":[{\"listingKey\":\"300451207716\",\"reasons\":[\"new\"]}]}",
      "header": "t=1794322802,v1=159c4abb701aea6f695c139d5b25edfb4ba5018339dc6620604661b79d5cafbe",
      "now": 1794323102,
      "valid": true
    },
    {
      "name": "valid when your clock is exactly five minutes behind",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": 1794322802,
      "body": "{\"id\":\"evt_3yQ8mT1xKp7Zc2Nf5Rb9Wd\",\"type\":\"saved_search.matches\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"clientId\":\"visitor-8841\",\"savedSearchId\":\"ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R\",\"listingKeys\":[\"300451207716\"],\"changes\":[{\"listingKey\":\"300451207716\",\"reasons\":[\"new\"]}]}",
      "header": "t=1794322802,v1=159c4abb701aea6f695c139d5b25edfb4ba5018339dc6620604661b79d5cafbe",
      "now": 1794322502,
      "valid": true
    },
    {
      "name": "a tampered body",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": 1794322802,
      "body": "{\"id\":\"evt_3yQ8mT1xKp7Zc2Nf5Rb9Wd\",\"type\":\"saved_search.matches\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"clientId\":\"visitor-8841\",\"savedSearchId\":\"ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R\",\"listingKeys\":[\"300451207717\"],\"changes\":[{\"listingKey\":\"300451207716\",\"reasons\":[\"new\"]}]}",
      "header": "t=1794322802,v1=159c4abb701aea6f695c139d5b25edfb4ba5018339dc6620604661b79d5cafbe",
      "now": 1794322803,
      "valid": false,
      "why": "one character of the body was changed after it was signed"
    },
    {
      "name": "an old timestamp",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": 1794322802,
      "body": "{\"id\":\"evt_3yQ8mT1xKp7Zc2Nf5Rb9Wd\",\"type\":\"saved_search.matches\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"clientId\":\"visitor-8841\",\"savedSearchId\":\"ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R\",\"listingKeys\":[\"300451207716\"],\"changes\":[{\"listingKey\":\"300451207716\",\"reasons\":[\"new\"]}]}",
      "header": "t=1794322802,v1=159c4abb701aea6f695c139d5b25edfb4ba5018339dc6620604661b79d5cafbe",
      "now": 1794323103,
      "valid": false,
      "why": "the signature is right, but it is more than five minutes old: a replay"
    },
    {
      "name": "a timestamp from the future",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": 1794322802,
      "body": "{\"id\":\"evt_3yQ8mT1xKp7Zc2Nf5Rb9Wd\",\"type\":\"saved_search.matches\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"clientId\":\"visitor-8841\",\"savedSearchId\":\"ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R\",\"listingKeys\":[\"300451207716\"],\"changes\":[{\"listingKey\":\"300451207716\",\"reasons\":[\"new\"]}]}",
      "header": "t=1794322802,v1=159c4abb701aea6f695c139d5b25edfb4ba5018339dc6620604661b79d5cafbe",
      "now": 1794322501,
      "valid": false,
      "why": "more than five minutes ahead of your clock"
    },
    {
      "name": "a new timestamp on an old signature",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": 1794323402,
      "body": "{\"id\":\"evt_3yQ8mT1xKp7Zc2Nf5Rb9Wd\",\"type\":\"saved_search.matches\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"clientId\":\"visitor-8841\",\"savedSearchId\":\"ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R\",\"listingKeys\":[\"300451207716\"],\"changes\":[{\"listingKey\":\"300451207716\",\"reasons\":[\"new\"]}]}",
      "header": "t=1794323402,v1=159c4abb701aea6f695c139d5b25edfb4ba5018339dc6620604661b79d5cafbe",
      "now": 1794323402,
      "valid": false,
      "why": "the timestamp is part of what is signed, so it cannot be refreshed"
    },
    {
      "name": "signed with another secret",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": 1794322802,
      "body": "{\"id\":\"evt_3yQ8mT1xKp7Zc2Nf5Rb9Wd\",\"type\":\"saved_search.matches\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"clientId\":\"visitor-8841\",\"savedSearchId\":\"ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R\",\"listingKeys\":[\"300451207716\"],\"changes\":[{\"listingKey\":\"300451207716\",\"reasons\":[\"new\"]}]}",
      "header": "t=1794322802,v1=869c276140d67aae89c33ac7dce85f891a2fd459a369d186b1f49342797fabe4",
      "now": 1794322803,
      "valid": false,
      "why": "the sender did not hold this endpoint's secret"
    },
    {
      "name": "a retry of the same notice",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": 1794322862,
      "body": "{\"id\":\"evt_3yQ8mT1xKp7Zc2Nf5Rb9Wd\",\"type\":\"saved_search.matches\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"clientId\":\"visitor-8841\",\"savedSearchId\":\"ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R\",\"listingKeys\":[\"300451207716\"],\"changes\":[{\"listingKey\":\"300451207716\",\"reasons\":[\"new\"]}]}",
      "header": "t=1794322862,v1=faba8676c99c62162bfe2273b48cfdf1e1efa17928740899a06eeb817749e64c",
      "now": 1794322863,
      "valid": true,
      "why": "every attempt is signed afresh with its own timestamp"
    },
    {
      "name": "a ping",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": 1794322802,
      "body": "{\"id\":\"dlv_7Jc4Xn2Qw8Lm5Vt1Zr9Kb3\",\"type\":\"ping\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"listingKeys\":[],\"changes\":[]}",
      "header": "t=1794322802,v1=b402fd4837676b40121b412bb8b3511be44ee0854d81c974de5f9714c29eafed",
      "now": 1794322803,
      "valid": true
    },
    {
      "name": "a body with bytes beyond ASCII",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": 1794322802,
      "body": "{\"note\":\"café ✓ 住宅\"}",
      "header": "t=1794322802,v1=dfe13c42fb7c11e0970d086bbc328f675ffd9b21ea0314363a2521491507b35f",
      "now": 1794322803,
      "valid": true,
      "why": "the API's own notices are ASCII; this checks that you verify the raw bytes as UTF-8"
    },
    {
      "name": "an unknown part in the header is ignored",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": 1794322802,
      "body": "{\"id\":\"evt_3yQ8mT1xKp7Zc2Nf5Rb9Wd\",\"type\":\"saved_search.matches\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"clientId\":\"visitor-8841\",\"savedSearchId\":\"ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R\",\"listingKeys\":[\"300451207716\"],\"changes\":[{\"listingKey\":\"300451207716\",\"reasons\":[\"new\"]}]}",
      "header": "t=1794322802,v1=159c4abb701aea6f695c139d5b25edfb4ba5018339dc6620604661b79d5cafbe,v2=later",
      "now": 1794322803,
      "valid": true,
      "why": "only t and v1 are read, so a later version can be added beside them"
    },
    {
      "name": "the signature in upper case",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": 1794322802,
      "body": "{\"id\":\"evt_3yQ8mT1xKp7Zc2Nf5Rb9Wd\",\"type\":\"saved_search.matches\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"clientId\":\"visitor-8841\",\"savedSearchId\":\"ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R\",\"listingKeys\":[\"300451207716\"],\"changes\":[{\"listingKey\":\"300451207716\",\"reasons\":[\"new\"]}]}",
      "header": "t=1794322802,v1=159C4ABB701AEA6F695C139D5B25EDFB4BA5018339DC6620604661B79D5CAFBE",
      "now": 1794322803,
      "valid": false,
      "why": "the API always sends lower-case hex; nothing else is accepted"
    },
    {
      "name": "no timestamp",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": null,
      "body": "{\"id\":\"evt_3yQ8mT1xKp7Zc2Nf5Rb9Wd\",\"type\":\"saved_search.matches\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"clientId\":\"visitor-8841\",\"savedSearchId\":\"ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R\",\"listingKeys\":[\"300451207716\"],\"changes\":[{\"listingKey\":\"300451207716\",\"reasons\":[\"new\"]}]}",
      "header": "v1=159c4abb701aea6f695c139d5b25edfb4ba5018339dc6620604661b79d5cafbe",
      "now": 1794322803,
      "valid": false
    },
    {
      "name": "an empty header",
      "secret": "whsec_test_vector_secret_do_not_use_0000000000001",
      "timestamp": null,
      "body": "{\"id\":\"evt_3yQ8mT1xKp7Zc2Nf5Rb9Wd\",\"type\":\"saved_search.matches\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"clientId\":\"visitor-8841\",\"savedSearchId\":\"ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R\",\"listingKeys\":[\"300451207716\"],\"changes\":[{\"listingKey\":\"300451207716\",\"reasons\":[\"new\"]}]}",
      "header": "",
      "now": 1794322803,
      "valid": false
    },
    {
      "name": "an empty secret is never valid",
      "secret": "",
      "timestamp": 1794322802,
      "body": "{\"id\":\"evt_3yQ8mT1xKp7Zc2Nf5Rb9Wd\",\"type\":\"saved_search.matches\",\"createdAt\":\"2026-11-10T15:00:00.000Z\",\"accountId\":\"0b9f6c1e-52a7-4c3e-9d41-7a6f0c2b8e15\",\"clientId\":\"visitor-8841\",\"savedSearchId\":\"ss_Hq2Lw9Xc4Vb7Nm1Kp6Tz3R\",\"listingKeys\":[\"300451207716\"],\"changes\":[{\"listingKey\":\"300451207716\",\"reasons\":[\"new\"]}]}",
      "header": "t=1794322802,v1=463c8d60da7f665e18b4c5f617f87b790fed7fad178e004e5d534843c1b09ecb",
      "now": 1794322803,
      "valid": false,
      "why": "a missing setting on your server must not make every request pass"
    }
  ]
}
