{"type":"api","title":"Create API Key","meta":{"id":"/apps/pubhub/media/cloud-security-apis-in-eft/d2a1854d5c0ed9069a7f0bc54a9b813f3075ddc9/58f2e698-d5ac-386a-a48e-d2b53c21bcd9","info":{"version":"2.0.0","title":"Cisco Secure Access Key Admin API","description":"Manage your Secure Access API keys.","contact":{"name":"Cloud Security Developer Community"}},"security":[{"oauthFlow":[]}],"tags":[{"name":"API Keys"},{"name":"Secure Access"}],"x-parser-conf":{"overview":{"markdownPath":"secure-access/reference/admin/key-admin-overview.md","uri":"secure-access-api-reference-keyadmin-overview"}},"openapi":"3.0.2","servers":[{"url":"https://api.sse.cisco.com/{basePath}","variables":{"basePath":{"default":"admin/v2"}}}],"securitySchemes":{"oauthFlow":{"type":"oauth2","description":"client credential flow","flows":{"clientCredentials":{"tokenUrl":"https://api.sse.cisco.com/auth/v2/token","scopes":{"admin.apikeys:create":"Create admin API keys","admin.apikeys:read":"Read admin API keys","admin.apikeys:delete":"Delete admin API keys","admin.apikeys:update":"Update admin API keys","admin.apikeys:refresh":"Refresh admin API keys"}}}}}},"spec":{"summary":"Create API Key","description":"Create an API key with certain scopes, name, description, allowed IP addresses and CIDR blocks, and expiration.\nThe `description` and `allowedIPs` fields are optional.","tags":["API Keys","Secure Access"],"operationId":"createAPIKeys","security":[{"oauthFlow":["admin.apikeys:create"]}],"requestBody":{"description":"Request body for creating an API key.","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"The unique descriptive label for the API key.","type":"string","pattern":"^[a-zA-Z0-9:.-_+=\\s]+$","maxLength":256,"example":"Network deployments","$$ref":"#/components/schemas/name"},"description":{"type":"string","maxLength":256,"description":"The text that describes the purpose of the API key.","example":"An API key to create and modify network deployments.","$$ref":"#/components/schemas/description"},"scopes":{"type":"array","description":"A list of scopes and permissions attached to the API key.","items":{"type":"string"},"example":["deployments.networks:read","deployments.networks:write"],"$$ref":"#/components/schemas/scopes"},"expireAt":{"type":"string","description":"The date and time when the key is set to expire. Specify an ISO 8601-formatted timestamp or\nan empty string (`''`). Use an empty string to set the API key to never expire.\n"},"allowedIPs":{"type":"array","description":"The list of public IP addresses and CIDR blocks that can make API requests with the API key.","items":{"type":"string","description":"An IP address that can make API requests with the API key.","example":"2001:420:c0c4:1006::427"},"example":["2001:420:c0c4:1006::427"],"$$ref":"#/components/schemas/allowedIPs"}},"required":["name","scopes"]},"example":{"name":"Network RW","scopes":["deployments.networks:write"],"description":"An API key to create and modify network deployments."}}},"$$ref":"#/components/requestBodies/KeysRequest"},"responses":{"201":{"description":"Created","headers":{"Content-Type":{"schema":{"type":"string"},"description":"The MIME content type of the response body.","example":"application/json","$$ref":"#/components/headers/Content-Type"},"Date":{"schema":{"type":"string","pattern":"^[0-90-90-90-9-0-90-9-0-90-9T0-90-9:0-90-9:0-90-9Z]+$"},"description":"The timestamp of the response.","example":"2023-03-14T18:34:25Z","$$ref":"#/components/headers/Date"}},"content":{"application/json":{"schema":{"type":"object","description":"Successfully created an API key.","properties":{"message":{"type":"string","description":"The status message that describes the response.","enum":["success","error"],"example":"success"},"key":{"type":"object","description":"The API key information including the client id and secret.","properties":{"name":{"description":"The unique descriptive label for the API key.","type":"string","pattern":"^[a-zA-Z0-9:.-_+=\\s]+$","maxLength":256,"example":"Network deployments","$$ref":"#/components/schemas/name"},"id":{"type":"string","description":"A unique identifier for the key.","example":"39b18499-4cf3-470d-997b-960e55ee0085","$$ref":"#/components/schemas/id"},"clientId":{"type":"string","description":"The client ID associated with the API key. The client ID is used with the client secret to attain a token for making API calls.\n","example":"1023845394834890324032948234","$$ref":"#/components/schemas/clientId"},"clientSecret":{"type":"string","description":"The client secret. The client secret is used with the client ID to attain a token for making API calls.\n","example":"1023845394834890324032948233","$$ref":"#/components/schemas/clientSecret"},"creatorKeyId":{"type":"string","description":"The ID of the KeyAdmin key that generated the key.","example":"130eec4c3825463e8d06f1dd9c0b2c19","$$ref":"#/components/schemas/creatorKeyId"},"creatorName":{"type":"string","description":"The name of the user who created the key.","example":"The name of API key creator.","$$ref":"#/components/schemas/creatorName"},"creatorEmail":{"type":"string","description":"The email address of the user who created the key.","example":"yourname@cisco.com","$$ref":"#/components/schemas/creatorEmail"},"createdAt":{"type":"string","format":"date-time","description":"The date and time when the key was created, specified in the ISO 8601 format.","example":"2021-10-02T20:00:00Z","$$ref":"#/components/schemas/createdAt"},"description":{"type":"string","maxLength":256,"description":"The text that describes the purpose of the API key.","example":"An API key to create and modify network deployments.","$$ref":"#/components/schemas/description"},"expireAt":{"type":"string","description":"The date and time when the key is set to expire. The timestamp is specified as an ISO 8601 formatted string,\nor an empty string (`''`). An empty string indicates that the key never expires.\n","example":"2022-10-02T20:00:00Z","$$ref":"#/components/schemas/expireAt"},"modifiedAt":{"type":"string","format":"date-time","description":"The date and time when the key was updated, specified in the ISO 8601 format.","example":"2021-11-02T20:00:00Z","$$ref":"#/components/schemas/modifiedAt"},"lastUsedAt":{"type":"string","format":"date-time","description":"The date and time when the key was last used, specified in the ISO 8601 format.","example":"2021-10-02T20:00:00","$$ref":"#/components/schemas/lastUsedAt"},"lastRefreshedAt":{"type":"string","format":"date-time","description":"The date and time when the key was last refreshed, specified in the ISO 8601 format.","example":"2021-12-02T20:00:00Z","$$ref":"#/components/schemas/lastRefreshedAt"},"scopes":{"type":"array","description":"A list of scopes and permissions attached to the API key.","items":{"type":"string"},"example":["deployments.networks:read","deployments.networks:write"],"$$ref":"#/components/schemas/scopes"},"allowedIPs":{"type":"array","description":"The list of public IP addresses and CIDR blocks that can make API requests with the API key.","items":{"type":"string","description":"An IP address that can make API requests with the API key.","example":"2001:420:c0c4:1006::427"},"example":["2001:420:c0c4:1006::427"],"$$ref":"#/components/schemas/allowedIPs"}},"required":["id","clientId","clientSecret","creatorName","creatorEmail","createdAt","expireAt","modifiedAt","lastUsedAt","lastRefreshedAt","scopes"],"example":{"name":"Networks RW","id":"39b18499-4cf3-470d-997b-960e55ee0085","clientId":"1023845394834890324032948234","clientSecret":"1023845394834890324032948233","creatorKeyId":"130eec4c3825463e8d06f1dd9c0b2c19","creatorName":"Name of API key creator","creatorEmail":"","createdAt":"2021-10-02T20:00:00Z","description":"An API key to create and modify network deployments.","expireAt":"2022-01-12T20:00:00Z","lastUsedAt":"2021-10-05T19:34:00Z","modifiedAt":"2021-10-02T20:00:00Z","lastRefreshedAt":"2021-10-02T20:00:00Z","scopes":["deployments.networks:read","deployments.networks:write"],"allowedIPs":["2001:420:c0c4:1006::427"]},"$$ref":"#/components/schemas/KeyWithSecret"}}},"example":{"message":"success","key":{"name":"Networks RW","id":"39b18499-4cf3-470d-997b-960e55ee0085","clientId":"1023845394834890324032948234","clientSecret":"1023845394834890324032948233","creatorKeyId":"130eec4c3825463e8d06f1dd9c0b2c19","creatorName":"","creatorEmail":"","createdAt":"2022-10-02T20:00:00Z","description":"An API key to create and modify network deployments.","expireAt":"","lastUsedAt":"2022-10-05T19:34:00Z","modifiedAt":"2022-10-02T20:00:00Z","lastRefreshedAt":"2022-10-05T20:00:00Z","scopes":["deployments.networks:read","deployments.networks:write"]}}}},"$$ref":"#/components/responses/KeyResponseWithSecret"},"401":{"description":"Unauthorized","headers":{"Content-Type":{"schema":{"type":"string"},"description":"The MIME content type of the response body.","example":"application/json","$$ref":"#/components/headers/Content-Type"},"Date":{"schema":{"type":"string","pattern":"^[0-90-90-90-9-0-90-9-0-90-9T0-90-9:0-90-9:0-90-9Z]+$"},"description":"The timestamp of the response.","example":"2023-03-14T18:34:25Z","$$ref":"#/components/headers/Date"},"WWW-Authenticate":{"schema":{"type":"string"},"description":"A challenge response for the intended resource."}},"content":{"application/json":{"schema":{"type":"object","description":"The request is not authorized.","properties":{"message":{"type":"string","example":"success","enum":["success","error"]},"description":{"type":"string"}},"example":{"message":"error","description":"Unauthorized request"}}}},"$$ref":"#/components/responses/unauthorizedError"},"403":{"description":"Forbidden","headers":{"Content-Type":{"schema":{"type":"string"},"description":"The MIME content type of the response body.","example":"application/json","$$ref":"#/components/headers/Content-Type"},"Date":{"schema":{"type":"string","pattern":"^[0-90-90-90-9-0-90-9-0-90-9T0-90-9:0-90-9:0-90-9Z]+$"},"description":"The timestamp of the response.","example":"2023-03-14T18:34:25Z","$$ref":"#/components/headers/Date"}},"content":{"application/json":{"schema":{"type":"object","description":"The request is forbidden.","properties":{"message":{"type":"string","example":"success","enum":["success","error"]},"description":{"type":"string"}},"example":{"message":"error","description":"Forbidden"}}}},"$$ref":"#/components/responses/forbiddenError"},"409":{"description":"Already Exists","headers":{"Content-Type":{"schema":{"type":"string"},"description":"The MIME content type of the response body.","example":"application/json","$$ref":"#/components/headers/Content-Type"},"Date":{"schema":{"type":"string","pattern":"^[0-90-90-90-9-0-90-9-0-90-9T0-90-9:0-90-9:0-90-9Z]+$"},"description":"The timestamp of the response.","example":"2023-03-14T18:34:25Z","$$ref":"#/components/headers/Date"}},"content":{"application/json":{"schema":{"type":"object","description":"The request failed because the `APIKey` with that `name` already exists.","properties":{"message":{"type":"string","example":"error","enum":["success","error"]},"description":{"type":"string"}},"example":{"message":"error","description":"Already Exists"}}}},"$$ref":"#/components/responses/alreadyExistsError"},"415":{"description":"Unsupported Media Type","headers":{"Content-Type":{"schema":{"type":"string"},"description":"The MIME content type of the response body.","example":"application/json","$$ref":"#/components/headers/Content-Type"},"Date":{"schema":{"type":"string","pattern":"^[0-90-90-90-9-0-90-9-0-90-9T0-90-9:0-90-9:0-90-9Z]+$"},"description":"The timestamp of the response.","example":"2023-03-14T18:34:25Z","$$ref":"#/components/headers/Date"}},"content":{"application/json":{"schema":{"type":"object","description":"The request failed because the Content-Type was not an allowed media type.","properties":{"message":{"type":"string","example":"error","enum":["success","error"]},"description":{"type":"string"}},"example":{"message":"error","description":"Unsupported Media Type"}}}},"$$ref":"#/components/responses/unsupportedMediaError"},"503":{"description":"Service Unavailable","headers":{"Content-Type":{"schema":{"type":"string"},"description":"The MIME content type of the response body.","example":"application/json","$$ref":"#/components/headers/Content-Type"},"Date":{"schema":{"type":"string","pattern":"^[0-90-90-90-9-0-90-9-0-90-9T0-90-9:0-90-9:0-90-9Z]+$"},"description":"The timestamp of the response.","example":"2023-03-14T18:34:25Z","$$ref":"#/components/headers/Date"}},"content":{"application/json":{"schema":{"type":"object","description":"The request failed because a dependent service is temporarily unavailable.","properties":{"message":{"type":"string","example":"error","enum":["success","error"]},"description":{"type":"string"}},"example":{"message":"error","description":"Service Unavailable"}}}},"$$ref":"#/components/responses/serviceUnavailableError"},"default":{"description":"Bad Request","headers":{"Content-Type":{"schema":{"type":"string"},"description":"The MIME content type of the response body.","example":"application/json","$$ref":"#/components/headers/Content-Type"},"Date":{"schema":{"type":"string","pattern":"^[0-90-90-90-9-0-90-9-0-90-9T0-90-9:0-90-9:0-90-9Z]+$"},"description":"The timestamp of the response.","example":"2023-03-14T18:34:25Z","$$ref":"#/components/headers/Date"}},"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"description":{"type":"string"}},"example":{"message":"error","description":"Bad Request"}}}},"$$ref":"#/components/responses/invalidRequestError"}},"__originalOperationId":"createAPIKeys","method":"post","path":"/apiKeys"}}