---
title: "Revoke referral"
method: PUT
path: "/v1/applications/{applicationId}/referrals/{referralId}/revoke"
tags: ["Referrals"]
---

# Revoke referral

`PUT /v1/applications/{applicationId}/referrals/{referralId}/revoke`

## Request

- Base URL: `https://api.apply.akahu.nz`
- URL: `https://api.apply.akahu.nz/v1/applications/{applicationId}/referrals/{referralId}/revoke`
- Auth: HTTP bearer

Revoke a referral so that its code can no longer be redeemed. Revocation is permanent.

Organisations that have previously redeemed the referral keep their copies of the application data.

## Path parameters

- `applicationId` string, required
- `referralId` string, required

## Response `200`

Success

- Referral: An application snapshot that can be redeemed by another organisation to create a new application with copied resources.
  - `_id` string, required: The unique ID of the referral.
  - `code` string, required: A referral code using the format `AK_` followed by 10 uppercase alphanumeric characters.
  - `status` 'active' | 'expired' | 'revoked', required: The status of a referral: - `active` The referral code can be redeemed. - `expired` The referral has passed its expiry and can no longer be redeemed. - `revoked` The referral has been revoked and can no longer be redeemed.
  - `reference` string, required: The default reference that applications created from this referral will use.
  - `expires_at` string, date-time, required: The time after which the referral code can no longer be redeemed.
  - `revoked_at` string, date-time: The time at which the referral was revoked. Only present when `status` is `revoked`.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `redeemed_by` ReferralOrgDetails[], required: Organisations that have successfully redeemed this referral.
    - `name` string, required
    - `logo` string: A URL referencing the org's logo in PNG format.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/akahu/apis/akahu-apply-api.md) - [All operations](https://skmtc.dev/akahu/apis/akahu-apply-api/llms.txt) - [OpenAPI document](https://skmtc.dev/akahu/apis/akahu-apply-api/revisions/3f18eb1ead75?raw)
