{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/clearpolicy-app/json-schema/clearpolicy-app-attestation-request-schema.json",
  "title": "AttestationRequest",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/clearpolicy-app-api-openapi.json#/components/schemas/AttestationRequest",
  "type": "object",
  "required": [
    "id",
    "organization_id",
    "document_id",
    "document_revision_id",
    "person_id",
    "recipient_name",
    "recipient_email",
    "requested_attestation_type",
    "source",
    "status",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "The ULID of the attestation request."
    },
    "organization_id": {
      "type": "string",
      "description": "The ULID of the organization."
    },
    "document_id": {
      "type": "string",
      "description": "The ULID of the document being attested."
    },
    "document_revision_id": {
      "type": "string",
      "description": "The ULID of the published revision that was sent."
    },
    "person_id": {
      "type": "string",
      "description": "The ULID of the person the request was sent to."
    },
    "recipient_name": {
      "type": "string",
      "description": "The name of the recipient when the request was created."
    },
    "recipient_email": {
      "type": "string",
      "format": "email",
      "description": "The email of the recipient when the request was created."
    },
    "requested_attestation_type": {
      "type": "string",
      "enum": [
        "acknowledgment",
        "signature"
      ],
      "description": "Attestation type frozen on this request. New requests are always signature. acknowledgment is historical (read-only)."
    },
    "recipient_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "The message included with the request that appears in emails and on the attestation page, or null if none was provided."
    },
    "sent_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the request was sent, or null."
    },
    "last_reminded_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the most recent reminder was sent, or null."
    },
    "viewed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the recipient first viewed the request, or null."
    },
    "attested_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the recipient completed the attestation, or null."
    },
    "canceled_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the request was canceled, or null."
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the request is scheduled to expire, or null."
    },
    "expired_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the request expired, or null."
    },
    "requested_by_user_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The ULID of the user whose API token issued this request."
    },
    "source": {
      "type": "string",
      "enum": [
        "oauth",
        "web",
        "system",
        "planning_center"
      ],
      "description": "How the request was created."
    },
    "status": {
      "type": "string",
      "enum": [
        "created",
        "sent",
        "viewed",
        "attested",
        "canceled",
        "expired",
        "bounced",
        "failed",
        "complained"
      ],
      "description": "The current status of the request. Delivery problem statuses (bounced, failed, complained) apply to pending requests whose latest email could not be delivered."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the request was created."
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the request was last updated."
    }
  }
}