Extend API Key

Title

Extend expiration date for an API key

URL Path

vault_rest/token

Method

PUT

CORS support

Yes

Http return

200, 400, 401, 403, 500

Table of Contents

Last Updated

08 Oct 2019

Summary

This API allows a user to extend an API key.

Use Cases (used by)

Used by clients that want to prevent an API to expire due to inactivity or change the expiration of an existing generated API key.

HTTP header parameters

Name

Value

Required

Description

Example

Authorization

The API key of the caller

REQUIRED

This header should have the following format:
Bearer [API key obtained from the authenticate API]
Example: Bearer Cp01BwnXAIOLZXxn7yogjKqIZnZpQD

PUT /vault_rest/token HTTP/1.1
Host: localhost:8010
Authorization: Bearer rWx0PkJHv2G8C5FvvYCEqpj89SDct0
Token: RHjO1SH9GqjBAbGxFOh2jqI9HjNAJD
ExtendBy: 01:00:00

Token

The API key to be extended

REQUIRED*

The API key that you wish to extend.
*Note: If this header is not present the API key from Authorization header will be used instead

ExtendBy

An interval to extend the API key

OPTIONAL

Parameter value must be a time span (hh:mm:ss) value how long to extend the API key.
If this parameter is not specified a default server value is used.
Max value is 24h: 23:59:59

ExtendUntil

A date to extend the API key

OPTIONAL

Used to adjust 3rd party API key expiration date.
Date should be specified in UTC, for example: 2016-01-02T12:00:00.0000000Z

Request Error

400

Bad Request

Invalid HTTP request

401

Invalid parameter

One or more parameters are invalid

403

Forbidden

API key is incorrect

500

Internal Server Error

Server is temporarily unavailable

Response

Example of a successful request:

{
"expires": "2017-05-09T13:31:44.7587334Z",
"token": "f3I8Vss3cWAuh3EscB06QRDcQfMzHY",
"user_id": 1
}

Descriptions of response:

token

API key

The API key that was extended

expires

Date and time of the API key

The API key is guaranteed to be valid until this date and time, even if no subsequent calls are made (except when API key is canceled by Cancel API Key)

user_id

The ID of the user associated with the API key

Database ID of the user associated with the API key