Key and Quota Management API Resources

This section provides details on the Key and Quota Management API’s various operations and parameters.

The following list provides a road map of all the conceptual objects you deal with when interacting with the Key and Quota Management API.

  • Collection: A top-level construct that contains API keys. All keys in a collection share the quota and access control list settings specified for the collection. See the Collection object.

  • Endpoint: A set of logically related API resources. See the Endpoint object.

  • Access Control List: A list of endpoints and resources that API consumers who identify with keys from a particular collection can access. See the Collection object and its dirtyACL and grantedACL members.

  • Quota: The maximum number of requests that API consumers who identify with keys from a particular collection can send to an API within a specific time period. See the Quota object for details.

  • Key: A unique identifier that enables Akamai edge servers to authenticate, track, and manage API consumers. See the Key object.

  • Tag: An additional category that you associate with an API key. You can use tags for filtering operations. See the Key object and its tags member.

API Summary

Operation Method Endpoint
Collections   (download RAML)
List Collections GET /apikey-manager-api/v1/collections
Create a Collection POST /apikey-manager-api/v1/collections
Get a Collection GET /apikey-manager-api/v1/collections/{collectionId}
Update a Collection PUT /apikey-manager-api/v1/collections/{collectionId}
Remove a Collection DELETE /apikey-manager-api/v1/collections/{collectionId}
List Endpoints GET /apikey-manager-api/v1/collections/{collectionId}/endpoints
Update an ACL PUT /apikey-manager-api/v1/collections/{collectionId}/acl
Update Quota PUT /apikey-manager-api/v1/collections/{collectionId}/quota
Keys   (download RAML)
List Keys GET /apikey-manager-api/v1/keys{?collectionId,filter,pageNumber,keyType,pageSize,sortDirection,sortColumn}
Create a Key POST /apikey-manager-api/v1/keys
Get a Key GET /apikey-manager-api/v1/keys/{keyId}
Update a Key PUT /apikey-manager-api/v1/keys/{keyId}
Import Keys POST /apikey-manager-api/v1/keys/import
Create Keys POST /apikey-manager-api/v1/keys/generate
Move Keys POST /apikey-manager-api/v1/keys/move
Revoke Keys POST /apikey-manager-api/v1/keys/revoke
Restore Revoked Keys POST /apikey-manager-api/v1/keys/restore
Reset Key Quota POST /apikey-manager-api/v1/keys/quota-reset
Tags   (download RAML)
List Tags GET /apikey-manager-api/v1/tags

List Collections

This operation returns information about all collections available for the current contract and groups.

GET /apikey-manager-api/v1/collections

Status 200 application/json

Response Body:

[
    {
        "description": "fff",
        "quota": {
            "interval": "HOUR_1",
            "enabled": false,
            "value": 100
        },
        "dirtyACL": [],
        "grantedACL": [],
        "dirty": false,
        "keyCount": 0,
        "id": 124034,
        "name": "test"
    },
    {
        "description": "aaaa",
        "quota": {
            "interval": "HOUR_1",
            "enabled": true,
            "value": 100
        },
        "dirtyACL": [],
        "grantedACL": [],
        "dirty": false,
        "keyCount": 0,
        "id": 104011,
        "name": "aaaa"
    },
    {
        "description": "bbbb",
        "quota": {
            "interval": "HOUR_1",
            "enabled": false,
            "value": 100
        },
        "dirtyACL": [],
        "grantedACL": [],
        "dirty": false,
        "keyCount": 0,
        "id": 124037,
        "name": "bb"
    }
]

Create a Collection

This operation creates an empty collection.

POST /apikey-manager-api/v1/collections

Content-Type: application/json

Request Body:

{
    "name": "InternalCollection",
    "description": "Collection for internal customers"
}

Status 201 application/json

Headers:

location: /apikey-manager-api/v1/collections/128000

Response Body:

{
    "description": "Collection for internal customers",
    "name": "InternalCollection",
    "id": 58001,
    "dirtyACL": [],
    "dirty": false,
    "keyCount": 0,
    "groupId": 18387,
    "grantedACL": []
}
  1. Build a Collection object by specifing the unique name value.

  2. Optionally specify the description value.

  3. POST the object to /apikey-manager-api/v1/collections.

The response reflects back the complete Collection object, from which you can store the id value. You can access the newly created collection at the URL specified in the location response header.

Get a Collection

This operation returns information about a collection.

GET /apikey-manager-api/v1/collections/{collectionId}

Sample: /apikey-manager-api/v1/collections/12345

Parameter Type Sample Description
URL Parameters
collectionId Integer 12345 The unique identifier for the collection.

Status 200 application/json

Response Body:

{
    "description": "example",
    "quota": {
        "interval": "HOUR_1",
        "enabled": false,
        "value": 100
    },
    "dirtyACL": [],
    "grantedACL": [
        "ENDPOINT-240184",
        "RESOURCE-10261",
        "RESOURCE-10260",
        "RESOURCE-10601",
        "RESOURCE-10600"
    ],
    "dirty": false,
    "keyCount": 41,
    "id": 55055,
    "name": "jwt"
}
  1. If you don’t already have an id value of the appropriate Collection object, run the List Collections operation.

  2. Pick the appropriate collection from the returned array and store its id.

  3. Make a GET request to /apikey-manager-api/v1/collections/{collectionId}.

The response is a Collection object.

Update a Collection

This operation updates information about a collection.

PUT /apikey-manager-api/v1/collections/{collectionId}

Sample: /apikey-manager-api/v1/collections/12345

Content-Type: application/json

Request Body:

{
    "description": "example",
    "quota": {
        "interval": "HOUR_1",
        "enabled": false,
        "value": 100
    },
    "dirtyACL": [],
    "grantedACL": [
        "ENDPOINT-240184",
        "RESOURCE-10261",
        "RESOURCE-10260",
        "RESOURCE-10601",
        "RESOURCE-10600"
    ],
    "dirty": false,
    "keyCount": 41,
    "id": 55055,
    "name": "jwt"
}
Parameter Type Sample Description
URL Parameters
collectionId Integer 12345 The unique identifier for the collection.

Status 200 application/json

Response Body:

{
    "description": "example",
    "quota": {
        "interval": "HOUR_1",
        "enabled": false,
        "value": 100
    },
    "dirtyACL": [],
    "grantedACL": [
        "ENDPOINT-240184",
        "RESOURCE-10261",
        "RESOURCE-10260",
        "RESOURCE-10601",
        "RESOURCE-10600"
    ],
    "dirty": false,
    "keyCount": 41,
    "id": 55055,
    "name": "jwt"
}
  1. If you don’t have a full representation of the object you want to modify, run the List Collections operation.

  2. Pick the appropriate collection from the returned array and store its id.

  3. Run the Get a Collection operation for the complete representation of the object.

  4. Modify the Collection object.

  5. PUT the object back to the same URL as the GET: /apikey-manager-api/v1/collections/{collectionId}.

A 200 response confirms success, and the response object reflects your modifications.

Remove a Collection

This operation deletes a collection and all keys included in the collection.

DELETE /apikey-manager-api/v1/collections/{collectionId}

Sample: /apikey-manager-api/v1/collections/12345

Parameter Type Sample Description
URL Parameters
collectionId Integer 12345 The unique identifier for the collection.

Status 204

  1. If you don’t already have an id value, run the List Collections operation.

  2. Pick the appropriate collection from the returned array and store its id.

  3. Make a DELETE request to /apikey-manager-api/v1/collections/{collectionId}.

A 204 response confirms the Collection object has been deleted.

List Endpoints

This operation returns information about all endpoints associated with a collection.

GET /apikey-manager-api/v1/collections/{collectionId}/endpoints

Sample: /apikey-manager-api/v1/collections/12345/endpoints

Parameter Type Sample Description
URL Parameters
collectionId Integer 12345 The unique identifier for the collection.

Status 200 application/json

Response Body:

[
    {
        "apiEndPointId": 1234,
        "apiEndPointScheme": "https",
        "description": "Provides information about membership benefits and available services.",
        "apiEndPointName": "Membership Benefits",
        "lockVersion": 179389174,
        "createDate": "2017-09-04T11:49:13.632Z",
        "apiResourceBaseInfo": [
            {
                "description": "resource description",
                "lockVersion": 179389174,
                "apiResourceName": "cloud security",
                "resourcePath": "/resources/{resourceId}",
                "link": "/api-definitions/v1/endpoints/1234/resources/7689",
                "updateDate": "2017-09-04T11:49:13.632Z",
                "createdBy": "rsingama@akamai.com",
                "updatedBy": "yauoid",
                "createDate": "2017-09-04T11:49:13.632Z",
                "apiResourceId": 7689
            }
        ],
        "apiCategoryIds": [
            123,
            125
        ],
        "updateDate": "2017-09-04T11:49:13.632Z",
        "createdBy": "rsahk",
        "updatedBy": "rsahk",
        "apiEndPointHosts": [
            "api-stage.abc.com",
            "api.abc.com"
        ],
        "basePath": "/api/v1"
    },
    {
        "apiEndPointId": 1235,
        "apiEndPointScheme": "https",
        "description": "Provides information about membership benefits and available services.",
        "apiEndPointName": "Membership Benefits",
        "lockVersion": 179389174,
        "createDate": "2017-09-04T11:49:13.632Z",
        "apiResourceBaseInfo": [
            {
                "description": "resource description",
                "lockVersion": 179389174,
                "apiResourceName": "cloud security",
                "resourcePath": "/resources/{resourceId}/hosts",
                "link": "/api-definitions/v1/endpoints/1235/resources/7690",
                "updateDate": "2017-09-04T11:49:13.632Z",
                "createdBy": "rsajj",
                "updatedBy": "yauoid",
                "createDate": "2017-09-04T11:49:13.632Z",
                "apiResourceId": 7690
            }
        ],
        "apiCategoryIds": [
            123,
            125
        ],
        "updateDate": "2017-09-04T11:49:13.632Z",
        "createdBy": "rsahk",
        "updatedBy": "rsahk",
        "apiEndPointHosts": [
            "api-stage.abc.com",
            "api.abc.com"
        ],
        "basePath": "/api/v1"
    }
]
  1. If you don’t already have an id value of the appropriate Collection object run the List Collections operation.

  2. Make a GET request to /apikey-manager-api/v1/collections/{collectionId}/endpoints.

The response is an array of Endpoint objects.

Update an ACL

This operation updates the access control list of a collection by adding or removing endpoint and resource information from the ACL.

PUT /apikey-manager-api/v1/collections/{collectionId}/acl

Sample: /apikey-manager-api/v1/collections/12345/acl

Content-Type: application/json

Request Body:

[
    "ENDPOINT-183165",
    "ENDPOINT-200159",
    "RESOURCE-9218"
]
Parameter Type Sample Description
URL Parameters
collectionId Integer 12345 The unique identifier for the collection.

Status 200 application/json

Response Body:

{
    "description": "example",
    "quota": {
        "interval": "HOUR_1",
        "enabled": false,
        "value": 100
    },
    "dirtyACL": [],
    "grantedACL": [
        "ENDPOINT-240184",
        "RESOURCE-10261",
        "RESOURCE-10260",
        "RESOURCE-10601",
        "RESOURCE-10600"
    ],
    "dirty": false,
    "keyCount": 41,
    "id": 55055,
    "name": "jwt"
}
  1. Run the List Endpoints operation.

  2. If you want to add an endpoint to an ACL, pick the appropriate endpoint from the apiEndPoints array and store its apiEndpointId.

  3. If you want to add a resource to an ACL, pick the appropriate resource from the apiResourceBaseInfo array and store its apiResourceLogicId.

  4. Build an array of the endpoint or resource items that you want to add to an ACL, prefixing their apiEndpointId or apiResourceLogicId values with the ENDPOINT- or RESOURCE- string. For example, ENDPOINT-1234.

  5. If you don’t already have an id value of the appropriate Collection object, run the List Collections operation.

  6. Pick the appropriate collection from the returned array and store its id.

  7. PUT the array to /apikey-manager-api/v1/collections/{collectionId}/acl

A 200 response confirms success, and the response object reflects your modifications.

Update Quota

This operation updates the quota settings in a collection.

PUT /apikey-manager-api/v1/collections/{collectionId}/quota

Sample: /apikey-manager-api/v1/collections/12345/quota

Content-Type: application/json

Request Body:

{
    "interval": "HOUR_1",
    "enabled": true,
    "value": 177
}
Parameter Type Sample Description
URL Parameters
collectionId Integer 12345 The unique identifier for the collection.

Status 200 application/json

Response Body:

{
    "description": "example",
    "quota": {
        "interval": "HOUR_1",
        "enabled": false,
        "value": 100
    },
    "dirtyACL": [],
    "grantedACL": [
        "ENDPOINT-240184",
        "RESOURCE-10261",
        "RESOURCE-10260",
        "RESOURCE-10601",
        "RESOURCE-10600"
    ],
    "dirty": false,
    "keyCount": 41,
    "id": 55055,
    "name": "jwt"
}
  1. If you don’t already have an id value of the appropriate Collection object, run the List Collections operation.

  2. Pick the appropriate collection from the returned array and store its id.

  3. Build the Quota object by specifying its enabled, value, and interval values.

  4. Make a PUT request to /apikey-manager-api/v1/collections/{collectionId}/quota

A 200 response confirms success, and the response object reflects your modifications.

List Keys

This operation returns keys included in a collection based on the specified criteria.

GET /apikey-manager-api/v1/keys{?collectionId,filter,pageNumber,keyType,pageSize,sortDirection,sortColumn}

Sample: /apikey-manager-api/v1/keys?collectionId=12345&filter=test&pageNumber=3&keyType=Active&pageSize=25&sortDirection=asc&sortColumn=id

Parameter Type Sample Description
Optional Query Parameters
collectionId Integer 12345 The unique identifier for the collection that includes the keys.
filter String test The search phrase to filter the keys by. The phrase can be a part of the description, tags, or label.
keyType Enumeration Active The type of keys to return, either All for all keys in the collection, Active for keys that can be used to access resources and endpoints associated with the collection, Revoked for keys that cannot be used to access resources and endpoints associated with the collection, or Pending for keys with changes that are being propagated to the Akamai network.
pageNumber Integer 3 The page number index.
pageSize Integer 25 The number of keys on each page of results.
sortColumn Enumeration id The name of the column to sort the keys by. The keys can be sorted by their unique id, label, or description.
sortDirection Enumeration asc The order to sort the keys in, either asc for ascending or desc for descending.

Status 200 application/json

Response Body:

{
    "sortColumn": "id",
    "pageSize": 10,
    "items": [
        {
            "collectionName": "Sample collection",
            "description": "test",
            "tags": [],
            "revokedAt": null,
            "collectionId": 19816,
            "revoked": false,
            "quotaUpdateState": "NONE",
            "label": "sampleLabel",
            "value": "cca5e829-7064-44cf-9655-0900b5523794",
            "quotaLeft": -1,
            "terminationAt": null,
            "id": 577599,
            "createdAt": "2017-11-02T08:12:23.891Z",
            "dirty": false
        },
        {
            "collectionName": "Sample collection",
            "description": "test",
            "tags": [],
            "revokedAt": null,
            "collectionId": 19816,
            "revoked": false,
            "quotaUpdateState": "NONE",
            "label": "sampleLabel",
            "value": "43b84519-56d0-4789-9fe2-f38c4955714f",
            "quotaLeft": -1,
            "terminationAt": null,
            "id": 577598,
            "createdAt": "2017-11-02T08:12:23.891Z",
            "dirty": false
        },
        {
            "collectionName": "Sample collection",
            "description": "test",
            "tags": [],
            "revokedAt": null,
            "collectionId": 19816,
            "revoked": false,
            "quotaUpdateState": "NONE",
            "label": "sampleLabel",
            "value": "7f6579ff-a99e-46f2-8886-619d9f9434bf",
            "quotaLeft": -1,
            "terminationAt": null,
            "id": 577597,
            "createdAt": "2017-11-02T08:12:23.891Z",
            "dirty": false
        },
        {
            "collectionName": "Sample collection",
            "description": "test",
            "tags": [],
            "revokedAt": null,
            "collectionId": 19816,
            "revoked": false,
            "quotaUpdateState": "NONE",
            "label": "sampleLabel",
            "value": "9a1686b8-5a0f-402f-a505-733fac8d293c",
            "quotaLeft": -1,
            "terminationAt": null,
            "id": 577596,
            "createdAt": "2017-11-02T08:12:23.891Z",
            "dirty": false
        },
        {
            "collectionName": "Sample collection",
            "description": "test",
            "tags": [],
            "revokedAt": null,
            "collectionId": 19816,
            "revoked": false,
            "quotaUpdateState": "NONE",
            "label": "sampleLabel",
            "value": "c2545bcd-acf1-4392-a2df-29021ee2cfad",
            "quotaLeft": -1,
            "terminationAt": null,
            "id": 577595,
            "createdAt": "2017-11-02T08:12:23.891Z",
            "dirty": false
        },
        {
            "collectionName": "Sample collection",
            "description": "test",
            "tags": [],
            "revokedAt": null,
            "collectionId": 19816,
            "revoked": false,
            "quotaUpdateState": "NONE",
            "label": "sampleLabel",
            "value": "d90fdc10-117a-4b17-b719-99db9250286d",
            "quotaLeft": -1,
            "terminationAt": null,
            "id": 577594,
            "createdAt": "2017-11-02T08:12:23.891Z",
            "dirty": false
        },
        {
            "collectionName": "Sample collection",
            "description": "test",
            "tags": [],
            "revokedAt": null,
            "collectionId": 19816,
            "revoked": false,
            "quotaUpdateState": "NONE",
            "label": "sampleLabel",
            "value": "742c5efa-4790-4d5f-bc13-3db1bcd42cdd",
            "quotaLeft": -1,
            "terminationAt": null,
            "id": 577593,
            "createdAt": "2017-11-02T08:12:23.891Z",
            "dirty": false
        },
        {
            "collectionName": "Sample collection",
            "description": "test",
            "tags": [],
            "revokedAt": null,
            "collectionId": 19816,
            "revoked": false,
            "quotaUpdateState": "NONE",
            "label": "sampleLabel",
            "value": "466d5bff-63a7-4d1c-8029-672d831ac15d",
            "quotaLeft": -1,
            "terminationAt": null,
            "id": 577592,
            "createdAt": "2017-11-02T08:12:23.891Z",
            "dirty": false
        },
        {
            "collectionName": "Sample collection",
            "description": "test",
            "tags": [],
            "revokedAt": null,
            "collectionId": 19816,
            "revoked": false,
            "quotaUpdateState": "NONE",
            "label": "sampleLabel",
            "value": "7e673a5d-f108-4f78-9abd-72e4cb9d7cb2",
            "quotaLeft": -1,
            "terminationAt": null,
            "id": 577591,
            "createdAt": "2017-11-02T08:12:23.891Z",
            "dirty": false
        },
        {
            "collectionName": "Sample collection",
            "description": "test",
            "tags": [],
            "revokedAt": null,
            "collectionId": 19816,
            "revoked": false,
            "quotaUpdateState": "NONE",
            "label": "sampleLabel",
            "value": "781692fe-7193-4a7d-a2ca-47b6e1c2f1d6",
            "quotaLeft": -1,
            "terminationAt": null,
            "id": 577590,
            "createdAt": "2017-11-02T08:12:23.891Z",
            "dirty": false
        }
    ],
    "filter": "test",
    "sortDirection": "desc",
    "pageNumber": 1,
    "totalItems": 100
}
  1. Optionally set the collectionId query parameter to list keys included in a specific collection.

  2. Optionally set the filter query parameter to list keys that contain a specific phrase as part of their description, tags, or label.

  3. If you want to modify pagination, set the pageSize query parameter for the number of records per page, and the pageNumber.

  4. If you want to affect how the output is sorted, set the sortDirection query parameter to either asc or desc and the sortColumn query parameter to id, label, or description.

  5. If you want to list keys of a specific type, set the keyType query parameter to All, Active, Revoked, or Pending.

  6. Make a GET request to /apikey-manager-api/v1/keys{?collectionId,filter,pageNumber,keyType,pageSize,sortDirection,sortColumn}.

The response includes an array of Key objects.

Create a Key

This operation creates a single key in a collection. To create multiple keys, see the Create Keys operation.

POST /apikey-manager-api/v1/keys

Content-Type: application/json

Request Body:

{
    "description": "For test purposes only",
    "collectionId": 58002,
    "tags": [
        "single",
        "new"
    ],
    "value": "ef527010-63e8-45ae-91e2-29757180631e",
    "label": "Test key",
    "mode": "CREATE_ONE"
}

Status 201 application/json

Headers:

location: /apikey-manager-api/v1/keys/705050

Response Body:

{
    "collectionName": "InternalCollection",
    "description": "Key with weather label",
    "tags": [
        "internal",
        "single"
    ],
    "revokedAt": null,
    "collectionId": 58002,
    "value": "cf527010-63e8-45ae-91e2-29757180631e",
    "label": "Weather",
    "dirty": true,
    "terminationAt": null,
    "id": 89003,
    "createdAt": "2017-09-04T11:49:13.632Z",
    "revoked": false
}
  1. If you don’t already have an id value of the appropriate Collection object, run the List Collections operation.

  2. Pick the appropriate collection from the returned array and store its id.

  3. Build a CreateKey object by providing its value and collectionId values. Set the mode value to CREATE_ONE.

  4. Optionally you can add new or existing tags to the object. Run the List Tags operation for a list of existing tags.

  5. POST the object to /apikey-manager-api/v1/keys.

The response reflects back the complete Key object. You can access the newly created key at the URL specified in the location response header.

Get a Key

This operation returns information about a key.

GET /apikey-manager-api/v1/keys/{keyId}

Sample: /apikey-manager-api/v1/keys/54321

Parameter Type Sample Description
URL Parameters
keyId Integer 54321 The unique identifier for the key.

Status 200 application/json

Response Body:

{
    "collectionName": "InternalCollection",
    "description": "Key with weather label",
    "tags": [
        "internal",
        "single"
    ],
    "revokedAt": null,
    "collectionId": 58002,
    "value": "cf527010-63e8-45ae-91e2-29757180631e",
    "label": "Weather",
    "dirty": true,
    "terminationAt": null,
    "id": 89003,
    "createdAt": "2017-09-04T11:49:13.632Z",
    "revoked": false
}
  1. If you don’t already have an id value of the appropriate Key object, run the List Keys operation.

  2. Pick the appropriate key from the returned array and store its id.

  3. Make a GET request to /apikey-manager-api/v1/keys/{keyId}.

The response is a Key object.

Update a Key

This operation updates information about a key.

PUT /apikey-manager-api/v1/keys/{keyId}

Sample: /apikey-manager-api/v1/keys/54321

Content-Type: application/json

Request Body:

{
    "collectionName": "InternalCollection",
    "description": "Key with weather label",
    "tags": [
        "internal",
        "single"
    ],
    "revokedAt": null,
    "collectionId": 58002,
    "value": "cf527010-63e8-45ae-91e2-29757180631e",
    "label": "Weather",
    "dirty": true,
    "terminationAt": null,
    "id": 89003,
    "createdAt": "2017-09-04T11:49:13.632Z",
    "revoked": false
}
Parameter Type Sample Description
URL Parameters
keyId Integer 54321 The unique identifier for the key.

Status 200 application/json

Response Body:

{
    "collectionName": "InternalCollection",
    "description": "Key with weather label",
    "tags": [
        "internal",
        "single"
    ],
    "revokedAt": null,
    "collectionId": 58002,
    "value": "cf527010-63e8-45ae-91e2-29757180631e",
    "label": "Weather",
    "dirty": true,
    "terminationAt": null,
    "id": 89003,
    "createdAt": "2017-09-04T11:49:13.632Z",
    "revoked": false
}
  1. If you don’t have a full representation of the object you want to modify, run the List Keys operation.

  2. Pick the appropriate key from the returned array and store its id.

  3. Run the Get a Key operation for the complete representation of the object.

  4. Modify the Key object.

  5. PUT the object back to the same URL as the GET: /apikey-manager-api/v1/keys/{keyId}.

A 200 response confirms success, and the response object reflects your modifications.

Import Keys

This operation imports keys from a CSV, XML, or JSON file to a collection. When making a request to import keys, the data structure that constitutes the contents of the import file must be embedded in a JSON object.

POST /apikey-manager-api/v1/keys/import

Content-Type: application/json

Request Body:

{
    "content": "[\n    {\n        \"value\": \"cf527010-63e8-45ae-91e2-29757180631e\",\n        \"label\": \"Weather \",\n        \"tags\": [\n            \"new\",\n            \"blue\"\n        ]\n    },\n    {\n        \"value\": \"cf557010-63e8-45fg-94e2-29757180631e\",\n        \"label\": \"Weather\",\n        \"tags\": [\n            \"new\",\n            \"red\"\n        ]\n    }\n]",
    "size": 271,
    "name": "import.json",
    "collectionId": 58002
}

Status 204

  1. If you don’t already have an id value of the appropriate Collection object, run the List Collections operation.

  2. Pick the appropriate collection from the returned array and store its id.

  3. Build an ImportKeys object by providing its collectionId, name, content, and size values.

  4. POST the object to /apikey-manager-api/v1/keys/import.

A 204 response confirms that the import operation was successful.

Create Keys

This operation creates more than one key in a collection. To create a single key, see the Create a Key operation.

POST /apikey-manager-api/v1/keys/generate

Content-Type: application/json

Request Body:

{
    "count": 20,
    "description": "Keys for bigger group",
    "collectionId": 58002,
    "incrementLabel": true,
    "tags": [
        "group",
        "generated"
    ],
    "label": "GeneratedKeys",
    "mode": "GENERATE_MULTIPLE"
}

Status 204

  1. If you don’t already have an id value of the appropriate Collection object, run the List Collections operation.

  2. Pick the appropriate collection from the returned array and store its id.

  3. Build a GenerateKeys object by providing its collectionId and count values. Set the mode value to GENERATE_MULTIPLE.

  4. Optionally you can add new or existing tags to the object. Run the List Tags operation for a list of existing tags.

  5. POST the object to /apikey-manager-api/v1/keys/generate.

A 204 response confirms that the import operation was successful.

Move Keys

This operation moves keys from a collection to either an exisiting collection or a new one.

POST /apikey-manager-api/v1/keys/move

Content-Type: application/json

Request Body:

{
    "newCollectionDescription": "New collection of moved keys",
    "keys": [
        89016,
        89015,
        89014
    ],
    "newCollectionName": "NewCollection"
}

Status 204

Gather prerequisites:

  1. If you don’t already have the id values of the appropriate Key objects, run the List Keys operation.

  2. Pick the appropriate keys from the returned array and store their id values.

To move keys to an existing collection:

  1. Run the List Collections operation.

  2. Pick the appropriate collection from the returned array and store its id value.

  3. Build a MoveKeys object by specifying the collectionId value.

  4. POST the object to /apikey-manager-api/v1/keys/move.

To move keys to a new collection:

  1. Build a MoveKeys object by specifying the newCollectionName value and optionally the newCollectionDescription value.

  2. POST the object to /apikey-manager-api/v1/keys/move.

A 204 response confirms that the move operation was successful.

Revoke Keys

This operation revokes keys in a collection and marks them as revoked. The revoked keys can be restored within the next 120 days and after this period they are deleted.

POST /apikey-manager-api/v1/keys/revoke

Content-Type: application/json

Request Body:

{
    "keys": [
        89011,
        89012,
        89013
    ]
}

Status 204

  1. If you don’t already have the id values of the appropriate Key objects, run the List Keys operation.

  2. Pick the appropriate keys from the returned array and store their id values.

  3. Build a RevokeRestoreKeys object by including all id values of the keys that you want to revoke in an array.

  4. POST the object to /apikey-manager-api/v1/keys/revoke.

A 204 response confirms that the import operation was successful.

Restore Revoked Keys

This operation restores previously revoked keys in a collection. This operation is only available in the 120 days following the revocation.

POST /apikey-manager-api/v1/keys/restore

Content-Type: application/json

Request Body:

{
    "keys": [
        89011,
        89012,
        89013
    ]
}

Status 204

  1. If you don’t already have an id value of the appropriate Key object, run the List Keys operation and set the keyType query parameter to Revoked.

  2. Pick the appropriate keys from the returned array and store their id values.

  3. Build a RevokeRestoreKeys object by including all id values of the keys that you want to restore in an array.

  4. POST the object to /apikey-manager-api/v1/keys/restore.

A 204 response confirms that the import operation was successful.

Reset Key Quota

This operation resets the quota limit for selected keys.

POST /apikey-manager-api/v1/keys/quota-reset

Content-Type: application/json

Request Body:

[
    "1324149",
    "1324150",
    "1324151"
]

Status 204

  1. If you don’t already have the id values of the appropriate Key objects, run the List Keys operation.

  2. Pick the appropriate keys from the returned array and store their id values.

  3. Build an array of id values of all keys that you want to reset quota for.

  4. POST the object to /apikey-manager-api/v1/keys/quota-reset.

A 204 response confirms that the import operation was successful.

List Tags

This operation returns all existing tags. You can add new tags during the key creation. See either the Create a Key or Create Keys operation.

GET /apikey-manager-api/v1/tags

Status 200 application/json

Response Body:

[
    "tag1",
    "generated",
    "tag4",
    "tag2",
    "tag3"
]

Last modified: 11/14/2017