---
title: "Change when a plan grant ends: days more, a new end, or no end (an ended grant applies again)"
method: POST
path: "/operator/plan-grants/{grantId}/extend"
tags: ["Operator"]
---

# Change when a plan grant ends: days more, a new end, or no end (an ended grant applies again)

`POST /operator/plan-grants/{grantId}/extend`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/operator/plan-grants/{grantId}/extend`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `grantId` string, uuid, required

## Request body

- object
  - `requestId` string, uuid, required
  - `addDays` integer: days more, from its end (or from now when it has ended)
  - `endsAt` string: a new end
  - `noEnd` true: no end: until revoked
  - `reason` string, required

## Response `200`

Extended

- object
  - `replay` boolean, required
  - `grant` object, required
    - `id` string, uuid, required
    - `planId` 'pro' | 'business', required
    - `state` 'active' | 'pending' | 'unclaimed' | 'ended' | 'revoked', required: active: applies now; pending: waits for its address to sign up; unclaimed: nobody signed up in time; ended: its end passed; revoked: an operator took it back
    - `targetKind` 'organization' | 'user' | 'email', required: what the operator named: a team, a user (their own team) or an address
    - `organizationId` string, uuid, nullable, required: the team it applies to; null while it waits for a sign-up
    - `organizationName` string, nullable, required
    - `email` string, nullable, required: the invitee's address while the grant waits; removed once claimed or revoked, or when an account with it is deleted (the grant keeps no other copy)
    - `durationDays` integer, nullable, required: its length from the start (a waiting grant starts at sign-up)
    - `startsAt` string, nullable, required: ISO-8601 timestamp
    - `endsAt` string, nullable, required: null: no end (until revoked)
    - `claimUntil` string, nullable, required: a waiting grant can be claimed until then (its sign-up link expires with it)
    - `lang` string, required
    - `note` string, nullable, required
    - `reason` string, required
    - `createdAt` string, required: ISO-8601 timestamp
    - `createdBy` object, required
      - `id` string, uuid, required
      - `email` string, nullable, required
    - `claimedAt` string, nullable, required: ISO-8601 timestamp
    - `claimedBy` object, nullable, required
      - `id` string, uuid, required
      - `email` string, nullable, required
    - `revokedAt` string, nullable, required: ISO-8601 timestamp
    - `revokedBy` object, nullable, required
      - `id` string, uuid, required
      - `email` string, nullable, required
    - `revokeReason` string, nullable, required
    - `mailedAt` string, nullable, required: ISO-8601 timestamp
    - `mailCount` integer, required
    - `endingNoticeAt` string, nullable, required: ISO-8601 timestamp
    - `endedNoticeAt` string, nullable, required: ISO-8601 timestamp
  - `mailed` integer

## Other responses

- `400`: Invalid request (code invalid_request)
- `403`: A session older than 5 minutes (details.reauthenticate) or without two-factor authentication (details.mfaRequired) (code forbidden)
- `404`: Not found, or no operator-console session (code not_found)
- `409`: Something changed since the review: review again (code conflict)
- `501`: Mail is not set up on this server: create with notify false (code not_configured)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
