{
  "openapi": "3.1.0",
  "info": {
    "title": "US Notary Journal API",
    "version": "1.0.0",
    "description": "Read-only access to a notary's locked journal entries. $0.20 per new entry synced; the first 25 each month are free.",
    "contact": {
      "email": "support@usnotaryjournal.com",
      "url": "https://usnotaryjournal.com/developers/"
    }
  },
  "servers": [
    {
      "url": "https://usnotaryjournal.com/api/v1"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/entries": {
      "get": {
        "summary": "List locked entries in sequence order",
        "parameters": [
          {
            "name": "after_seq",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Entry"
                      }
                    },
                    "nextAfterSeq": {
                      "type": "integer"
                    },
                    "hasMore": {
                      "type": "boolean"
                    },
                    "stoppedAt": {
                      "type": "string",
                      "enum": [
                        "free_entries_used"
                      ]
                    },
                    "billingUrl": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Free entries used and billing is off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "License ended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/entries/{seq}": {
      "get": {
        "summary": "One locked entry",
        "parameters": [
          {
            "name": "seq",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Entry"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Free entries used and billing is off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "License ended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/verify": {
      "get": {
        "summary": "Verify the hash chain",
        "responses": {
          "200": {
            "description": "Verification report"
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "License ended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me": {
      "get": {
        "summary": "The notary, journal size and usage",
        "responses": {
          "200": {
            "description": "Account summary"
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "License ended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/usage": {
      "get": {
        "summary": "This month's usage",
        "responses": {
          "200": {
            "description": "Usage"
          },
          "401": {
            "description": "Invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "License ended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "nj_live_ key from Settings > API access"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "billingUrl": {
                "type": "string"
              }
            }
          }
        }
      },
      "Entry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "seq": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "act",
              "addendum",
              "refusal"
            ]
          },
          "state": {
            "type": "string",
            "description": "Two-letter commission state"
          },
          "actMode": {
            "type": "string"
          },
          "requiredByLaw": {
            "type": "boolean"
          },
          "actAt": {
            "type": "string",
            "format": "date-time"
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          },
          "lockedAt": {
            "type": "string",
            "format": "date-time"
          },
          "timezone": {
            "type": "string"
          },
          "location": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "lat": {
                "type": "number"
              },
              "lng": {
                "type": "number"
              }
            }
          },
          "signer": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "address": {
                "type": "object"
              },
              "phone": {
                "type": "string"
              }
            }
          },
          "identification": {
            "type": "object",
            "properties": {
              "method": {
                "type": "string"
              },
              "personalKnowledge": {
                "type": "boolean"
              },
              "document": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "issuer": {
                    "type": "string"
                  },
                  "numberLast4": {
                    "type": "string"
                  },
                  "issued": {
                    "type": "string"
                  },
                  "expiration": {
                    "type": "string"
                  },
                  "photosOnFile": {
                    "type": "integer"
                  }
                }
              }
            }
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "pages": {
                  "type": "integer"
                },
                "actType": {
                  "type": "string"
                },
                "date": {
                  "type": "string"
                }
              }
            }
          },
          "signed": {
            "type": "boolean"
          },
          "signedByMark": {
            "type": "boolean"
          },
          "witnesses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "address": {
                  "type": "string"
                },
                "idType": {
                  "type": "string"
                },
                "idNumberLast4": {
                  "type": "string"
                }
              }
            }
          },
          "thumbprintTaken": {
            "type": "boolean"
          },
          "grantee": {
            "type": "object"
          },
          "interpreter": {
            "type": "string"
          },
          "fees": {
            "type": "object",
            "properties": {
              "fee": {
                "type": "number"
              },
              "travelFee": {
                "type": "number"
              },
              "discount": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "amount",
                      "percent"
                    ]
                  },
                  "value": {
                    "type": "number"
                  },
                  "amount": {
                    "type": "number",
                    "description": "Dollars taken off fee + travel fee"
                  }
                }
              },
              "mileage": {
                "type": "number"
              },
              "stampCount": {
                "type": "integer"
              },
              "paymentMethod": {
                "type": "string"
              },
              "paid": {
                "type": "boolean"
              }
            }
          },
          "requester": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "fileNumber": {
                "type": "string"
              }
            }
          },
          "addendum": {
            "type": "object",
            "properties": {
              "targetEntryId": {
                "type": "string"
              },
              "targetSeq": {
                "type": "integer"
              },
              "action": {
                "type": "string",
                "enum": [
                  "correction",
                  "void",
                  "annotation"
                ]
              },
              "reason": {
                "type": "string"
              },
              "text": {
                "type": "string"
              }
            }
          },
          "refusal": {
            "type": "object",
            "properties": {
              "reason": {
                "type": "string"
              },
              "details": {
                "type": "string"
              }
            }
          },
          "integrity": {
            "type": "object",
            "properties": {
              "contentHash": {
                "type": "string"
              },
              "prevHash": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entryHash": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}