Upsert an API key

Create or update (upsert) API key with specified identifier string.

SecuritySecretApiKey or JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

Resource identifier string.

Request Body schema: application/json

ApiKey resource.

description
required
string

API key description.

type
string
Default: "secret"

Type of API key.

Enum: "secret" "publishable"
Array of objects

Specify access control list here if creating a restricted API key. Send all matching permission with an empty scope to allow all permissions.

Array
required
object

Scope of the API key.

permissions
required
Array of strings <operationId>

If you are creating a restricted API key, use this field to specify individual permissions. Use the wildcard character * to provide full access.

allowedIps
Array of strings or null <ip> (AllowedIps)

List of IP addresses that are permitted access. Private subnets are prohibited. To remove restrictions, set this value to null.

Responses
200

API key updated.

Response Schema: application/json
description
required
string

API key description.

id
string <= 50 characters

Unique resource ID. Defaults to UUID v4.

type
string
Default: "secret"

Type of API key.

Enum: "secret" "publishable"
Array of objects

Specify access control list here if creating a restricted API key. Send all matching permission with an empty scope to allow all permissions.

Array
required
object

Scope of the API key.

permissions
required
Array of strings <operationId>

If you are creating a restricted API key, use this field to specify individual permissions. Use the wildcard character * to provide full access.

allowedIps
Array of strings or null <ip> (AllowedIps)

List of IP addresses that are permitted access. Private subnets are prohibited. To remove restrictions, set this value to null.

apiUser
string

API user name.

secretKey
string

API secret key's value.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

Array of objects (Self) non-empty

Related resource links.

Array (non-empty)
href
required
string

Link URL.

rel
required
string

Type of link.

Value: "self"
201

API key created.

Response Headers
Location
string <uri>

Location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
description
required
string

API key description.

id
string <= 50 characters

Unique resource ID. Defaults to UUID v4.

type
string
Default: "secret"

Type of API key.

Enum: "secret" "publishable"
Array of objects

Specify access control list here if creating a restricted API key. Send all matching permission with an empty scope to allow all permissions.

Array
required
object

Scope of the API key.

permissions
required
Array of strings <operationId>

If you are creating a restricted API key, use this field to specify individual permissions. Use the wildcard character * to provide full access.

allowedIps
Array of strings or null <ip> (AllowedIps)

List of IP addresses that are permitted access. Private subnets are prohibited. To remove restrictions, set this value to null.

apiUser
string

API user name.

secretKey
string

API secret key's value.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

Array of objects (Self) non-empty

Related resource links.

Array (non-empty)
href
required
string

Link URL.

rel
required
string

Type of link.

Value: "self"
401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

404

Resource not found.

422

Invalid data sent.

put/api-keys/{id}
Request samples
application/json
{
  • "description": "string",
  • "type": "secret",
  • "acl": [
    ],
  • "allowedIps": [
    ]
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "description": "string",
  • "type": "secret",
  • "acl": [
    ],
  • "allowedIps": [
    ],
  • "apiUser": "string",
  • "secretKey": "string",
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}