---
updatedAt: 2026-06-11T04:37:04.000Z
agentTools:
  projectIndex: https://developers.akahu.nz/llms.txt
---

# List referrals

List the referrals that have been created from an application.

# OpenAPI definition

```json
{
  "info": {
    "title": "Akahu Apply API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.apply.akahu.nz",
      "description": "Akahu Apply API"
    }
  ],
  "x-readme": {
    "apply-endpoint-order": true
  },
  "openapi": "3.1.0",
  "components": {
    "securitySchemes": {
      "APIKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer auth using an Akahu Apply API Key. These can be generated by an Akahu Apply administrator in the web portal."
      }
    },
    "schemas": {
      "WebhookEventId": {
        "type": "string",
        "pattern": "^evt_[a-z0-9]{24,27}$",
        "example": "evt_tz4a98xxat96iws9zmbrgj3a"
      },
      "OrgId": {
        "type": "string",
        "pattern": "^org_[a-z0-9]{24,27}$",
        "example": "org_tz4a98xxat96iws9zmbrgj3a"
      },
      "WebhookEndpointId": {
        "type": "string",
        "pattern": "^webhook_[a-z0-9]{24,27}$",
        "example": "webhook_tz4a98xxat96iws9zmbrgj3a"
      },
      "TestWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "test"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_endpoint": {
            "$ref": "#/components/schemas/WebhookEndpointId"
          }
        },
        "required": [
          "type",
          "_org",
          "_endpoint"
        ]
      },
      "TestWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/TestWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "ApplicationId": {
        "type": "string",
        "pattern": "^application_[a-z0-9]{24,27}$",
        "example": "application_tz4a98xxat96iws9zmbrgj3a"
      },
      "ApplicationCreatedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "application:created"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_application": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        },
        "required": [
          "type",
          "_org",
          "_application"
        ]
      },
      "ApplicationCreatedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/ApplicationCreatedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "ApplicationArchivedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "application:archived"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_application": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        },
        "required": [
          "type",
          "_org",
          "_application"
        ]
      },
      "ApplicationArchivedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/ApplicationArchivedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "ApplicationUnarchivedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "application:unarchived"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_application": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        },
        "required": [
          "type",
          "_org",
          "_application"
        ]
      },
      "ApplicationUnarchivedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/ApplicationUnarchivedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "SharingRequestId": {
        "type": "string",
        "pattern": "^sharing_request_[a-z0-9]{24,27}$",
        "example": "sharing_request_tz4a98xxat96iws9zmbrgj3a"
      },
      "SharingRequestViewedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "sharing_request:viewed"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_application": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "_sharing_request": {
            "$ref": "#/components/schemas/SharingRequestId"
          }
        },
        "required": [
          "type",
          "_org",
          "_application",
          "_sharing_request"
        ]
      },
      "SharingRequestViewedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/SharingRequestViewedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "SharingRequestSubmittedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "sharing_request:submitted"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_application": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "_sharing_request": {
            "$ref": "#/components/schemas/SharingRequestId"
          }
        },
        "required": [
          "type",
          "_org",
          "_application",
          "_sharing_request"
        ]
      },
      "SharingRequestSubmittedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/SharingRequestSubmittedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "DocumentId": {
        "type": "string",
        "pattern": "^doc_[a-z0-9]{24,27}$",
        "example": "doc_tz4a98xxat96iws9zmbrgj3a"
      },
      "DocumentUploadedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "document:uploaded"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_application": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "_document": {
            "$ref": "#/components/schemas/DocumentId"
          }
        },
        "required": [
          "type",
          "_org",
          "_application",
          "_document"
        ]
      },
      "DocumentUploadedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/DocumentUploadedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "DocumentCompletedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "document:completed"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_application": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "_document": {
            "$ref": "#/components/schemas/DocumentId"
          }
        },
        "required": [
          "type",
          "_org",
          "_application",
          "_document"
        ]
      },
      "DocumentCompletedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/DocumentCompletedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "DocumentFailedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "document:failed"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_application": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "_document": {
            "$ref": "#/components/schemas/DocumentId"
          }
        },
        "required": [
          "type",
          "_org",
          "_application",
          "_document"
        ]
      },
      "DocumentFailedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/DocumentFailedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "ReportId": {
        "type": "string",
        "pattern": "^report_[a-z0-9]{24,27}$",
        "example": "report_tz4a98xxat96iws9zmbrgj3a"
      },
      "ReportCompletedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "report:completed"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_application": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "_report": {
            "$ref": "#/components/schemas/ReportId"
          }
        },
        "required": [
          "type",
          "_org",
          "_application",
          "_report"
        ]
      },
      "ReportCompletedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/ReportCompletedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "ReportFailedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "report:failed"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_application": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "_report": {
            "$ref": "#/components/schemas/ReportId"
          }
        },
        "required": [
          "type",
          "_org",
          "_application",
          "_report"
        ]
      },
      "ReportFailedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/ReportFailedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "ReferralId": {
        "type": "string",
        "pattern": "^referral_[a-z0-9]{24,27}$",
        "example": "referral_tz4a98xxat96iws9zmbrgj3a"
      },
      "ReferralCreatedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "referral:created"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_application": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "_referral": {
            "$ref": "#/components/schemas/ReferralId"
          }
        },
        "required": [
          "type",
          "_org",
          "_application",
          "_referral"
        ]
      },
      "ReferralCreatedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/ReferralCreatedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "ReferralRevokedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "referral:revoked"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_application": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "_referral": {
            "$ref": "#/components/schemas/ReferralId"
          }
        },
        "required": [
          "type",
          "_org",
          "_application",
          "_referral"
        ]
      },
      "ReferralRevokedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/ReferralRevokedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "ReferralRedeemedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "referral:redeemed"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_application": {
            "$ref": "#/components/schemas/ApplicationId"
          },
          "_referral": {
            "$ref": "#/components/schemas/ReferralId"
          }
        },
        "required": [
          "type",
          "_org",
          "_application",
          "_referral"
        ]
      },
      "ReferralRedeemedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/ReferralRedeemedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "ReferralRedemptionId": {
        "type": "string",
        "pattern": "^referral_redemption_[a-z0-9]{24,27}$",
        "example": "referral_redemption_tz4a98xxat96iws9zmbrgj3a"
      },
      "ReferralRedemptionCreatedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "referral_redemption:created"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_referral_redemption": {
            "$ref": "#/components/schemas/ReferralRedemptionId"
          }
        },
        "required": [
          "type",
          "_org",
          "_referral_redemption"
        ]
      },
      "ReferralRedemptionCreatedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/ReferralRedemptionCreatedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "ReferralRedemptionCompletedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "referral_redemption:completed"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_referral_redemption": {
            "$ref": "#/components/schemas/ReferralRedemptionId"
          },
          "_application": {
            "$ref": "#/components/schemas/ApplicationId"
          }
        },
        "required": [
          "type",
          "_org",
          "_referral_redemption",
          "_application"
        ]
      },
      "ReferralRedemptionCompletedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/ReferralRedemptionCompletedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "ReferralRedemptionFailedWebhookPayload": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "referral_redemption:failed"
            ]
          },
          "_org": {
            "$ref": "#/components/schemas/OrgId"
          },
          "_referral_redemption": {
            "$ref": "#/components/schemas/ReferralRedemptionId"
          }
        },
        "required": [
          "type",
          "_org",
          "_referral_redemption"
        ]
      },
      "ReferralRedemptionFailedWebhookEvent": {
        "type": "object",
        "properties": {
          "_id": {
            "$ref": "#/components/schemas/WebhookEventId"
          },
          "emitted_at": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "$ref": "#/components/schemas/ReferralRedemptionFailedWebhookPayload"
          }
        },
        "required": [
          "_id",
          "emitted_at",
          "payload"
        ]
      },
      "X-Akahu-Apply-Signature": {
        "type": "string",
        "description": "Detached JWS over the request body, signed with `ES256`. The signing key is published at https://api.apply.akahu.nz/.well-known/jwks.json",
        "example": "eyJhbGciOiJFUzI1NiIsImtpZCI6IjAwMDAwMDAwLTAwMDAtNDAwMC04MDAwLTAwMDAwMDAwMDAwMCJ9..c2lnbmF0dXJl"
      },
      "X-Akahu-Apply-Request-Id": {
        "type": "string",
        "description": "Unique per delivery attempt, including retries. Quote it when asking us about a delivery. Not an idempotency key - use the event `_id` for that.",
        "example": "00000000-0000-4000-8000-000000000000"
      },
      "Generic400ErrorResponseCode": {
        "type": "string",
        "enum": [
          "invalid_type",
          "too_big",
          "too_small",
          "invalid_format",
          "not_multiple_of",
          "unrecognized_keys",
          "invalid_union",
          "invalid_key",
          "invalid_element",
          "invalid_value",
          "invalid",
          "invalid_id"
        ]
      },
      "IssuePath": {
        "type": "array",
        "items": {
          "title": "IssuePathSegment",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "integer"
            }
          ]
        }
      },
      "Generic401ErrorResponseCode": {
        "type": "string",
        "enum": [
          "unauthorized"
        ]
      },
      "Generic401ErrorResponse": {
        "type": "object",
        "properties": {
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "$ref": "#/components/schemas/Generic401ErrorResponseCode"
                },
                "message": {
                  "type": "string"
                },
                "path": {
                  "$ref": "#/components/schemas/IssuePath"
                }
              },
              "required": [
                "code",
                "message",
                "path"
              ]
            }
          }
        },
        "required": [
          "issues"
        ]
      },
      "Generic403ErrorResponseCode": {
        "type": "string",
        "enum": [
          "forbidden"
        ]
      },
      "Generic403ErrorResponse": {
        "type": "object",
        "properties": {
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "$ref": "#/components/schemas/Generic403ErrorResponseCode"
                },
                "message": {
                  "type": "string"
                },
                "path": {
                  "$ref": "#/components/schemas/IssuePath"
                }
              },
              "required": [
                "code",
                "message",
                "path"
              ]
            }
          }
        },
        "required": [
          "issues"
        ]
      },
      "Generic404ErrorResponseCode": {
        "type": "string",
        "enum": [
          "not_found"
        ]
      },
      "Generic404ErrorResponse": {
        "type": "object",
        "properties": {
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "$ref": "#/components/schemas/Generic404ErrorResponseCode"
                },
                "message": {
                  "type": "string"
                },
                "path": {
                  "$ref": "#/components/schemas/IssuePath"
                }
              },
              "required": [
                "code",
                "message",
                "path"
              ]
            }
          }
        },
        "required": [
          "issues"
        ]
      },
      "Generic429ErrorResponseCode": {
        "type": "string",
        "enum": [
          "too_many_requests"
        ]
      },
      "Generic429ErrorResponse": {
        "type": "object",
        "properties": {
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "$ref": "#/components/schemas/Generic429ErrorResponseCode"
                },
                "message": {
                  "type": "string"
                },
                "path": {
                  "$ref": "#/components/schemas/IssuePath"
                }
              },
              "required": [
                "code",
                "message",
                "path"
              ]
            }
          }
        },
        "required": [
          "issues"
        ]
      },
      "Generic500ErrorResponseCode": {
        "type": "string",
        "enum": [
          "internal_error"
        ]
      },
      "Generic500ErrorResponse": {
        "type": "object",
        "properties": {
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "$ref": "#/components/schemas/Generic500ErrorResponseCode"
                },
                "message": {
                  "type": "string"
                },
                "path": {
                  "$ref": "#/components/schemas/IssuePath"
                }
              },
              "required": [
                "code",
                "message",
                "path"
              ]
            }
          }
        },
        "required": [
          "issues"
        ]
      },
      "ReferralCode": {
        "type": "string",
        "pattern": "^AK_[A-Z0-9]{10}$",
        "example": "AK_23456789BC",
        "description": "A referral code using the format `AK_` followed by 10 uppercase alphanumeric characters."
      },
      "ReferralStatus": {
        "type": "string",
        "enum": [
          "active",
          "expired",
          "revoked"
        ],
        "description": "The status of a referral:\n\n - `active` The referral code can be redeemed.\n\n - `expired` The referral has passed its expiry and can no longer be redeemed.\n\n - `revoked` The referral has been revoked and can no longer be redeemed."
      },
      "ReferralOrgDetails": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "logo": {
            "type": "string",
            "description": "A URL referencing the org's logo in PNG format."
          }
        },
        "required": [
          "name"
        ],
        "description": "Details for an organisation involved in a referral."
      },
      "Referral": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "pattern": "^referral_[a-z0-9]{24,27}$",
            "example": "referral_tz4a98xxat96iws9zmbrgj3a",
            "description": "The unique ID of the referral."
          },
          "code": {
            "$ref": "#/components/schemas/ReferralCode"
          },
          "status": {
            "$ref": "#/components/schemas/ReferralStatus"
          },
          "reference": {
            "type": "string",
            "description": "The default reference that applications created from this referral will use."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time after which the referral code can no longer be redeemed."
          },
          "revoked_at": {
            "type": "string",
            "format": "date-time",
            "description": "The time at which the referral was revoked. Only present when `status` is `revoked`."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "redeemed_by": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReferralOrgDetails"
            },
            "description": "Organisations that have successfully redeemed this referral."
          }
        },
        "required": [
          "_id",
          "code",
          "status",
          "reference",
          "expires_at",
          "created_at",
          "updated_at",
          "redeemed_by"
        ],
        "description": "An application snapshot that can be redeemed by another organisation to create a new application with copied resources."
      },
      "ListReferrals400ErrorResponseCode": {
        "type": "string",
        "enum": [
          "feature_disabled"
        ]
      },
      "ListReferrals400ErrorResponse": {
        "type": "object",
        "properties": {
          "issues": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Generic400ErrorResponseCode"
                    },
                    {
                      "$ref": "#/components/schemas/ListReferrals400ErrorResponseCode"
                    }
                  ]
                },
                "message": {
                  "type": "string"
                },
                "path": {
                  "$ref": "#/components/schemas/IssuePath"
                }
              },
              "required": [
                "code",
                "message",
                "path"
              ]
            }
          }
        },
        "required": [
          "issues"
        ]
      }
    },
    "parameters": {
      "X-Akahu-Apply-Signature": {
        "schema": {
          "$ref": "#/components/schemas/X-Akahu-Apply-Signature"
        },
        "required": true,
        "description": "Detached JWS over the request body, signed with `ES256`. The signing key is published at https://api.apply.akahu.nz/.well-known/jwks.json",
        "name": "X-Akahu-Apply-Signature",
        "in": "header"
      },
      "X-Akahu-Apply-Request-Id": {
        "schema": {
          "$ref": "#/components/schemas/X-Akahu-Apply-Request-Id"
        },
        "required": true,
        "description": "Unique per delivery attempt, including retries. Quote it when asking us about a delivery. Not an idempotency key - use the event `_id` for that.",
        "name": "X-Akahu-Apply-Request-Id",
        "in": "header"
      }
    }
  },
  "paths": {
    "/v1/applications/{applicationId}/referrals": {
      "get": {
        "operationId": "ListReferrals",
        "tags": [
          "Referrals"
        ],
        "summary": "List referrals",
        "description": "List the referrals that have been created from an application.",
        "deprecated": false,
        "security": [
          {
            "APIKey": []
          }
        ],
        "parameters": [
          {
            "schema": {
              "$ref": "#/components/schemas/ApplicationId"
            },
            "required": true,
            "name": "applicationId",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Referral"
                      }
                    }
                  },
                  "required": [
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListReferrals400ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generic401ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generic403ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generic404ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generic429ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Generic500ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "Test": {
      "post": {
        "operationId": "Test",
        "summary": "test",
        "description": "A manually triggered test event for a specific endpoint.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "ApplicationCreated": {
      "post": {
        "operationId": "ApplicationCreated",
        "summary": "application:created",
        "description": "An application was created.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationCreatedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "ApplicationArchived": {
      "post": {
        "operationId": "ApplicationArchived",
        "summary": "application:archived",
        "description": "An application was archived.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationArchivedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "ApplicationUnarchived": {
      "post": {
        "operationId": "ApplicationUnarchived",
        "summary": "application:unarchived",
        "description": "An archived application was restored to active.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationUnarchivedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "SharingRequestViewed": {
      "post": {
        "operationId": "SharingRequestViewed",
        "summary": "sharing_request:viewed",
        "description": "An applicant opened a sharing request link.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SharingRequestViewedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "SharingRequestSubmitted": {
      "post": {
        "operationId": "SharingRequestSubmitted",
        "summary": "sharing_request:submitted",
        "description": "An applicant submitted data against a sharing request.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SharingRequestSubmittedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "DocumentUploaded": {
      "post": {
        "operationId": "DocumentUploaded",
        "summary": "document:uploaded",
        "description": "A document was uploaded to an application.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentUploadedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "DocumentCompleted": {
      "post": {
        "operationId": "DocumentCompleted",
        "summary": "document:completed",
        "description": "A document finished processing successfully.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentCompletedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "DocumentFailed": {
      "post": {
        "operationId": "DocumentFailed",
        "summary": "document:failed",
        "description": "A document failed to process.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentFailedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "ReportCompleted": {
      "post": {
        "operationId": "ReportCompleted",
        "summary": "report:completed",
        "description": "A report finished generating successfully.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportCompletedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "ReportFailed": {
      "post": {
        "operationId": "ReportFailed",
        "summary": "report:failed",
        "description": "A report failed to generate.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportFailedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "ReferralCreated": {
      "post": {
        "operationId": "ReferralCreated",
        "summary": "referral:created",
        "description": "A referral was created from an application.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralCreatedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "ReferralRevoked": {
      "post": {
        "operationId": "ReferralRevoked",
        "summary": "referral:revoked",
        "description": "A referral was revoked. Not sent when a referral expires.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralRevokedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "ReferralRedeemed": {
      "post": {
        "operationId": "ReferralRedeemed",
        "summary": "referral:redeemed",
        "description": "Another organisation redeemed a referral.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralRedeemedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "ReferralRedemptionCreated": {
      "post": {
        "operationId": "ReferralRedemptionCreated",
        "summary": "referral_redemption:created",
        "description": "A referral redemption was started.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralRedemptionCreatedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "ReferralRedemptionCompleted": {
      "post": {
        "operationId": "ReferralRedemptionCompleted",
        "summary": "referral_redemption:completed",
        "description": "A referral redemption finished and the new application is available.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralRedemptionCompletedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    },
    "ReferralRedemptionFailed": {
      "post": {
        "operationId": "ReferralRedemptionFailed",
        "summary": "referral_redemption:failed",
        "description": "A referral redemption failed.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Signature"
          },
          {
            "$ref": "#/components/parameters/X-Akahu-Apply-Request-Id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReferralRedemptionFailedWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged."
          }
        }
      }
    }
  }
}
```