---
title: "Renew the subscription API Keys."
method: POST
path: "/environments/{envId}/apis/{apiId}/subscriptions/{subscriptionId}/api-keys/_renew"
tags: ["API Subscriptions"]
---

# Renew the subscription API Keys.

`POST /environments/{envId}/apis/{apiId}/subscriptions/{subscriptionId}/api-keys/_renew`

Renew the subscription API Keys.

Renew the subscription API Key by setting an expiration date on the existing active API Keys and creating a new API Key.<br> The newly created API Key is returned in response.

## Request body

- RenewApiKey
  - `customApiKey` string — Optional custom API Key that can be given when custom API Key support is enabled.

## Response `200`

API's subscription API Key successfully renewed

- ApiKey
  - `id` string — The internal UUID of the API Key.
  - `key` string — The API Key value to use to call the protected api.
  - `application` BaseApplication
    - `id` string — Application's uuid.
    - `name` string — Application's name. Duplicate names can exist.
    - `description` string — Application's description. A short description of your App.
    - `domain` string — Application's domain. Domain used by application, if relevant.
    - `type` string — Application's type.
    - `primaryOwner` PrimaryOwner
      - `id` string — Owner's uuid.
      - `email` string — Owner's email. Can be null if owner is a group.
      - `displayName` string — Owner's name.
      - `type` 'USER' | 'GROUP' — The type of membership
    - `apiKeyMode` 'SHARED' | 'EXCLUSIVE' | 'UNSPECIFIED' — The mode of an application regarding ApiKey plans. * UNSPECIFIED: no selected mode yet * EXCLUSIVE: an API Key is generated for each new subscription * SHARED: reuse always the same API Key for all subscriptions
  - `subscriptions` BaseSubscription[] — The list of subscriptions using this API Key. Multiple subscription is possible with shared API Key.
    - `id` string — Subscription's uuid.
  - `revoked` boolean — Flag indicating that the API Key has been revoked.
  - `paused` boolean — Flag indicating that the API Key has been paused.
  - `expired` boolean — Flag indicating that the API Key has expired.
  - `daysToExpirationOnLastNotification` integer — Number of days before the expiration of this subscription when the last pre-expiration notification was sent.
  - `expireAt` string, date-time — The datetime when the API Key expires. No date means no expiration.
  - `createdAt` string, date-time — The datetime when the API Key has been created.
  - `updatedAt` string, date-time — The datetime when the API Key has been updated.
  - `revokedAt` string, date-time — The datetime when the API Key has been revoke. No date means not revoked.

## Other responses

- `default` — Generic error response

---

[API](https://skmtc.net/gravitee-io/apis/gravitee-io-apim-management-api-apis.md) · [All operations](https://skmtc.net/gravitee-io/apis/gravitee-io-apim-management-api-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gravitee-io/gravitee-io-apim-management-api-apis/versions/aef12fc964d5/schema)
