API keys

API keys can be used by developers to gain programmatic access to the Qlik platform, acting as their own user.

Request Body

application/json

No description

Responses

201
application/json

Created the API key successfully.

400
application/json

Invalid request was made.

403
application/json

Requestor not allowed to create an API key

429
application/json

Request has been rate limited.

default
application/json

Unexpected error.

POST
/api-keys
curl "https://your-tenant.us.qlikcloud.com/api/v1/api-keys" \
 -X POST \
 -H "Authorization: Bearer <API-key>" \
 -H "Content-type: application/json" \
 -d '{"description":"string","sub":"string","subType":"string","expiry":"string"}'

Request

{
  "description": "string",
  "sub": "string",
  "subType": "string",
  "expiry": "string"
}

Response

{
  "id": "string",
  "tenantId": "string",
  "description": "string",
  "sub": "string",
  "subType": "user",
  "status": "active",
  "token": "string",
  "expiry": "2020-12-18T13:59:23.399Z",
  "createdByUser": "string",
  "created": "2020-12-18T13:59:23.399Z",
  "lastUpdated": "2020-12-18T13:59:23.399Z"
}

Query Parameters

sub
optional
string<uid>

The id of the subject.

createdByUser
string<uid>

The user id that created the API key.

status
optional
string<uid>

The status of the API key.

Enum:

active

expired

revoked

limit
optional, default=20, minimum=1, maximum=100
number

Max number of API keys to retrieve.

sort
optional, default='-created'
string

The field to sort by, with +/- prefix indicating sort order

Enum:

createdByUser

+createdByUser

-createdByUser

sub

+sub

-sub

status

+status

-status

description

+description

-description

created

+created

-created

startingAfter
optional
string<uid v4>

The target resource id to start looking after for resources. Cannot be used in conjunction with endingBefore.

endingBefore
optional
string<uid v4>

The target resource id to start looking before for resources. Cannot be used in conjunction with startingAfter.

Responses

200
application/json

An array of API keys.

400
application/json

Invalid request was made.

403
application/json

Requestor not allowed to list API keys.

429
application/json

Request has been rate limited.

GET
/api-keys
curl "https://your-tenant.us.qlikcloud.com/api/v1/api-keys" \
 -H "Authorization: Bearer <API-key>"

Response

{
  "data": [
    {
      "id": "string",
      "tenantId": "string",
      "description": "string",
      "sub": "string",
      "subType": "user",
      "status": "active",
      "expiry": "2020-12-18T13:59:23.400Z",
      "createdByUser": "string",
      "created": "2020-12-18T13:59:23.400Z",
      "lastUpdated": "2020-12-18T13:59:23.400Z"
    }
  ]
}

Path Parameters

id
string<uid>

The id of the API key resource to be retrieved.

Responses

200
application/json

Returns an API key resource.

403
application/json

Requestor not allowed to query this API key.

404
application/json

API key was not found.

429
application/json

Request has been rate limited.

default
application/json

Unexpected error.

GET
/api-keys/{id}
curl "https://your-tenant.us.qlikcloud.com/api/v1/api-keys/{id}" \
 -H "Authorization: Bearer <API-key>"

Response

{
  "id": "string",
  "tenantId": "string",
  "description": "string",
  "sub": "string",
  "subType": "user",
  "status": "active",
  "expiry": "2020-12-18T13:59:23.400Z",
  "createdByUser": "string",
  "created": "2020-12-18T13:59:23.400Z",
  "lastUpdated": "2020-12-18T13:59:23.400Z"
}

When the owner of the API key sends the request, the key will be removed. When a TenantAdmin sends the request, the key will be revoked.

Path Parameters

id
string<uid>

The id of the API key resource to be retrieved.

Responses

204
application/json
object

Deleted or revoked an API key resource.

403
application/json

Requestor not allowed to delete or revoke this API key.

404
application/json

API key was not found.

429
application/json

Request has been rate limited.

DELETE
/api-keys/{id}
curl "https://your-tenant.us.qlikcloud.com/api/v1/api-keys/{id}" \
 -X DELETE \
 -H "Authorization: Bearer <API-key>"

Path Parameters

id
string<JWT ID (jti)>

The id of the API key resource to be updated.

Request Body

application/json

No description

Responses

204
application/json
object

API key updated successfully.

400
application/json

Invalid request was made.

403
application/json

Requestor not allowed to update this API key.

404
application/json

API key was not found.

429
application/json

Request has been rate limited.

PATCH
/api-keys/{id}
curl "https://your-tenant.us.qlikcloud.com/api/v1/api-keys/{id}" \
 -X PATCH \
 -H "Authorization: Bearer <API-key>" \
 -H "Content-type: application/json" \
 -d '[{"op":"replace","path":"/description","value":"my new description"}]'

Request

[
  {
    "op": "replace",
    "path": "/description",
    "value": "my new description"
  }
]

Path Parameters

tenantId
string<uid>

The tenant id of the API keys configuration to be retrieved.

Responses

200
application/json

API keys configuration.

429
application/json

Request has been rate limited.

default
application/json

Unexpected error.

GET
/api-keys/configs/{tenantId}
curl "https://your-tenant.us.qlikcloud.com/api/v1/api-keys/configs/{tenantId}" \
 -H "Authorization: Bearer <API-key>"

Response

{
  "api_keys_enabled": true,
  "max_api_key_expiry": "PT24H",
  "max_keys_per_user": 5
}

Path Parameters

tenantId
string<uid>

The tenant id of the API keys configuration to be retrieved.

Request Body

application/json

No description

Responses

204
application/json
object

API keys configuration updated successfully.

400
application/json

Invalid request was made.

403
application/json

Requestor not allowed to update the API keys configuration.

404
application/json

Failed to update the API keys configuration.

429
application/json

Request has been rate limited.

PATCH
/api-keys/configs/{tenantId}
curl "https://your-tenant.us.qlikcloud.com/api/v1/api-keys/configs/{tenantId}" \
 -X PATCH \
 -H "Authorization: Bearer <API-key>" \
 -H "Content-type: application/json" \
 -d '[{"op":"replace","path":"/api_keys_enabled","value":true}]'

Request

[
  {
    "op": "replace",
    "path": "/api_keys_enabled",
    "value": true
  }
]

Unexpected error.

Properties

description
string

Text that describes the API key.

sub
optional
string

The id of the subject for the API key.

subType
optional
string

Type of the subject.

expiry
optional
string

The expiry of the API key, in ISO8601 duration format.

ApiKeys

object

Properties

data

No description

ApiKey

object

Properties

id
string<uid>

The unique id for the resource.

tenantId
string<uid>

The tenant id.

description
string

A description for the API key.

sub
string<uid>

The id of the subject for the API key.

subType
string

Type of the subject.

Enum:

user

status
string

No description

Enum:

active

expired

revoked

expiry
string<date-time>

When the API key will expire and no longer be a valid authentication token.

createdByUser
string<uid>

The id of the user who created the key.

created
optional
string<date-time>

When the API key was created.

lastUpdated
optional
string<date-time>

When the API key was last updated.

Properties

id
string<uid>

The unique id for the resource.

tenantId
string<uid>

The tenant id.

description
string

A description for the API key.

sub
string<uid>

The id of the subject for the API key.

subType
string

Type of the subject.

Enum:

user

status
string

No description

Enum:

active

expired

revoked

token
string

The generated signed JWT.

expiry
string<date-time>

When the API key will expire and no longer be a valid authentication token.

createdByUser
string<uid>

The id of the user who created the key.

created
optional
string<date-time>

When the API key was created.

lastUpdated
optional
string<date-time>

When the API key was last updated.

Properties

api_keys_enabled
default=false
boolean

Enables or disables API key functionality for the specified tenant.

max_api_key_expiry
default='PT24H'
string

The maximum lifetime, in ISO8601 duration format, for which an API key can be issued for the specified tenant.

max_keys_per_user
default=5, minimum=0, maximum=1000
number

The maximum number of active API keys that any user can create for the specified tenant.

Properties

op
string

The operation to be performed.

Enum:

replace

path
string

The path for the given resource field to patch.

Enum:

/description

value
string

The value to be used for this operation.

A JSON Patch document as defined in http://tools.ietf.org/html/rfc6902.

Properties

op
string

The operation to be performed.

Enum:

replace

path
string

The path for the given resource field to patch.

Enum:

/description

value
string

The value to be used for this operation.

Properties

op
string

The operation to be performed.

Enum:

replace

path
string

The path for the given resource field to patch.

Enum:

/api_keys_enabled

/max_api_key_expiry

/max_keys_per_user

value

The value to be used for this operation.

A JSON Patch document as defined in http://tools.ietf.org/html/rfc6902.

Properties

op
string

The operation to be performed.

Enum:

replace

path
string

The path for the given resource field to patch.

Enum:

/api_keys_enabled

/max_api_key_expiry

/max_keys_per_user

value

The value to be used for this operation.

Errors

object

Properties

errors

No description

Error

object

An error object.

Properties

code
string

The error code.

title
string

Summary of the problem.

status
optional
integer

The HTTP status code.

detail
optional
string

A human-readable explanation specific to this occurrence of the problem.

meta
optional
object

Additional properties relating to the error.

source
optional

References to the source of the error.

v1.3.0