---
title: "Get a Key in a workspace"
url: "https://nov18-dev.movespot.fyi/apis/konnect-control-planes-configuration-dev-3/versions/76e259e8-9e78-4c0e-ab4a-3df25bddc4f1/operations/get-key-in-workspace"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/konnect-control-planes-configuration-dev-3/versions/76e259e8-9e78-4c0e-ab4a-3df25bddc4f1.md

# Get a Key in a workspace

`GET` `/control-planes/{controlPlaneId}/core-entities/{workspace}/keys/{KeyId}`

Operation ID: `get-key-in-workspace`

Get a Key using ID or name in a workspace.

## Path parameters

- `KeyId` (string, required) - ID of the Key to lookup
- `controlPlaneId` (string, uuid, required) - The UUID of your control plane. This variable is available in the Konnect manager.
- `workspace` (string, string, required) - The name of the workspace

## Responses

- `200` - Successfully fetched Key
- `401` - Unauthorized
- `404` - Resource does not exist

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Konnect Control Planes Configuration
  version: 3.14.0
servers:
  - url: https://us.api.konghq.com/v2
    description: United-States Production region
  - url: https://eu.api.konghq.com/v2
    description: Europe Production region
  - url: https://au.api.konghq.com/v2
    description: Australia Production region
  - url: https://me.api.konghq.com/v2
    description: Middle-East Production region
  - url: https://in.api.konghq.com/v2
    description: India Production region
  - url: https://sg.api.konghq.com/v2
    description: Singapore Production region
paths:
  /control-planes/{controlPlaneId}/core-entities/{workspace}/keys/{KeyId}:
    parameters:
      - $ref: "#/components/parameters/KeyId"
      - $ref: "#/components/parameters/controlPlaneId"
    get:
      operationId: get-key-in-workspace
      summary: Get a Key in a workspace
      description: Get a Key using ID or name in a workspace.
      parameters:
        - $ref: "#/components/parameters/Workspace"
      responses:
        "200":
          description: Successfully fetched Key
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Key"
        "401":
          $ref: "#/components/responses/HTTP401Error"
        "404":
          description: Resource does not exist
      tags:
        - Keys
security:
  - konnectAccessToken: []
  - personalAccessToken: []
components:
  parameters:
    KeyId:
      description: ID of the Key to lookup
      example: bba22c06-a632-42be-a018-1b9ff357b5b9
      in: path
      name: KeyId
      required: true
      schema:
        type: string
    controlPlaneId:
      name: controlPlaneId
      in: path
      required: true
      schema:
        type: string
        format: uuid
        example: 9524ec7d-36d9-465d-a8c5-83a3c9390458
      description: The UUID of your control plane. This variable is available in the
        Konnect manager.
    Workspace:
      description: The name of the workspace
      in: path
      name: workspace
      required: true
      schema:
        type: string
        format: string
        example: team-payments
  schemas:
    Key:
      description: A Key object holds a representation of asymmetric keys in various
        formats. When Kong or a Kong plugin requires a specific public or
        private key to perform certain operations, it can use this entity.
      type: object
      properties:
        created_at:
          description: Unix epoch when the resource was created.
          type: integer
          nullable: true
        description:
          description: User-defined entity description. Konnect only field, not synced to
            the Gateway.
          type: string
          nullable: true
        id:
          description: A string representing a UUID (universally unique identifier).
          type: string
          nullable: true
        jwk:
          description: A JSON Web Key represented as a string.
          type: string
          nullable: true
          x-encrypted: true
          x-referenceable: true
        kid:
          description: A unique identifier for a key.
          type: string
        managed_by:
          description: Arbitrary JSON data for client responsible for managing the entity.
            Konnect only field, not synced to the Gateway.
          type: object
          additionalProperties: true
          nullable: true
        name:
          description: The name to associate with the given keys.
          type: string
          nullable: true
        pem:
          description: A keypair in PEM format.
          type: object
          nullable: true
          properties:
            private_key:
              type: string
              x-encrypted: true
              x-referenceable: true
            public_key:
              type: string
              x-referenceable: true
        set:
          description: The id (an UUID) of the key-set with which to associate the key.
          type: object
          nullable: true
          properties:
            id:
              type: string
          x-foreign: true
        tags:
          description: An optional set of strings associated with the Key for grouping and
            filtering.
          type: array
          items:
            description: A string representing a tag.
            type: string
          nullable: true
        updated_at:
          description: Unix epoch when the resource was last updated.
          type: integer
          nullable: true
        x5t:
          description: X.509 certificate SHA-1 thumbprint.
          type: string
          nullable: true
      example:
        id: d958f66b-8e99-44d2-b0b4-edd5bbf24658
        jwk: '{"alg":"RSA",  "kid": "42",  ...}'
        kid: "42"
        name: a-key
        pem:
          private_key: -----BEGIN
          public_key: -----BEGIN
        set:
          id: b86b331c-dcd0-4b3e-97ce-47c5a9543031
      additionalProperties: false
      required:
        - kid
    GatewayUnauthorizedError:
      type: object
      properties:
        message:
          type: string
        status:
          type: integer
      required:
        - message
        - status
  responses:
    HTTP401Error:
      description: Unauthorized
      content:
        application/json:
          examples:
            DuplicateApiKey:
              summary: Duplicate API key found
              value:
                message: Duplicate API key found
                status: 401
            InvalidAuthCred:
              summary: Invalid authentication credentials
              value:
                message: Unauthorized
                status: 401
            NoAPIKey:
              summary: No API key found
              value:
                message: No API key found in request
                status: 401
          schema:
            $ref: "#/components/schemas/GatewayUnauthorizedError"
  securitySchemes:
    konnectAccessToken:
      type: http
      scheme: bearer
      description: The Konnect access token is meant to be used by the Konnect
        dashboard and the decK CLI to authenticate with.
    personalAccessToken:
      type: http
      scheme: bearer
      description: The personal access token is meant to be used as an alternative to
        basic-auth when accessing Konnect via APIs. You can generate a Personal
        Access Token (PAT) from the personal access token page in the Konnect
        dashboard.
```
