---
title: "Create a new HMAC-auth credential associated with a Consumer in a workspace"
url: "https://nov18-dev.movespot.fyi/apis/konnect-control-planes-configuration-dev-3/versions/76e259e8-9e78-4c0e-ab4a-3df25bddc4f1/operations/create-hmac-auth-with-consumer-in-workspace"
---

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

# Create a new HMAC-auth credential associated with a Consumer in a workspace

`POST` `/control-planes/{controlPlaneId}/core-entities/{workspace}/consumers/{ConsumerIdForNestedEntities}/hmac-auth`

Operation ID: `create-hmac-auth-with-consumer-in-workspace`

Create a new HMAC-auth credential associated with a Consumer in a workspace

## Path parameters

- `controlPlaneId` (string, uuid, required) - The UUID of your control plane. This variable is available in the Konnect manager.
- `ConsumerIdForNestedEntities` (string, required) - Consumer ID for nested entities
- `workspace` (string, string, required) - The name of the workspace

## Request body (required)

Content types: `application/json`

## Responses

- `201` - Successfully created HMAC-auth credential

## 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}/consumers/{ConsumerIdForNestedEntities}/hmac-auth:
    parameters:
      - $ref: "#/components/parameters/controlPlaneId"
    post:
      operationId: create-hmac-auth-with-consumer-in-workspace
      summary: Create a new HMAC-auth credential associated with a Consumer in a
        workspace
      description: Create a new HMAC-auth credential associated with a Consumer in a
        workspace
      parameters:
        - $ref: "#/components/parameters/ConsumerIdForNestedEntities"
        - $ref: "#/components/parameters/Workspace"
      requestBody:
        description: Description of new HMAC-auth credential for creation
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/HMACAuthWithoutParents"
      responses:
        "201":
          description: Successfully created HMAC-auth credential
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HMACAuth"
      tags:
        - HMAC-auth credentials
security:
  - konnectAccessToken: []
  - personalAccessToken: []
components:
  parameters:
    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.
    ConsumerIdForNestedEntities:
      description: Consumer ID for nested entities
      example: ""
      in: path
      name: ConsumerIdForNestedEntities
      required: true
      schema:
        type: string
    Workspace:
      description: The name of the workspace
      in: path
      name: workspace
      required: true
      schema:
        type: string
        format: string
        example: team-payments
  schemas:
    HMACAuthWithoutParents:
      type: object
      properties:
        consumer:
          type: object
          nullable: true
          properties:
            id:
              type: string
          x-foreign: true
        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
        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
        secret:
          type: string
          nullable: true
          x-encrypted: true
        tags:
          description: A set of strings representing tags.
          type: array
          items:
            description: A string representing a tag.
            type: string
          nullable: true
        username:
          type: string
      example:
        id: 75695322-e8a0-4109-aed4-5416b0308d85
        secret: wQazJ304DW5huJklHgUfjfiSyCyTAEDZ
        username: xerxes
      additionalProperties: false
      required:
        - username
    HMACAuth:
      type: object
      properties:
        consumer:
          type: object
          nullable: true
          properties:
            id:
              type: string
          x-foreign: true
        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
        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
        secret:
          type: string
          nullable: true
          x-encrypted: true
        tags:
          description: A set of strings representing tags.
          type: array
          items:
            description: A string representing a tag.
            type: string
          nullable: true
        username:
          type: string
      example:
        consumer:
          id: 84a73fb8-50fc-44a7-a4d5-aa17728ee83f
        id: 75695322-e8a0-4109-aed4-5416b0308d85
        secret: wQazJ304DW5huJklHgUfjfiSyCyTAEDZ
        username: xerxes
      additionalProperties: false
      required:
        - username
  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.
```
