> ## Documentation Index
> Fetch the complete documentation index at: https://formbricks.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a contact attribute key

> Creates a contact attribute key in the database.



## OpenAPI

````yaml /api-v2-reference/openapi.yml post /management/contact-attribute-keys
openapi: 3.1.0
info:
  title: Formbricks API
  description: Manage Formbricks resources programmatically.
  version: 2.0.0
servers:
  - url: https://app.formbricks.com/api/v2
    description: Formbricks Cloud
security:
  - apiKeyAuth: []
tags:
  - name: Health
    description: Operations for checking critical application dependencies health status.
  - name: Roles
    description: Operations for managing roles.
  - name: Me
    description: Operations for managing your API key.
  - name: Management API - Responses
    description: Operations for managing responses.
  - name: Management API - Contacts
    description: Operations for managing contacts.
  - name: Management API - Contact Attributes
    description: Operations for managing contact attributes.
  - name: Management API - Contact Attribute Keys
    description: Operations for managing contact attribute keys.
  - name: Management API - Surveys
    description: Operations for managing surveys.
  - name: Management API - Surveys - Contact Links
    description: Operations for generating personalized survey links for contacts.
  - name: Management API - Webhooks
    description: Operations for managing webhooks.
  - name: Organizations API - Teams
    description: Operations for managing teams.
  - name: Organizations API - Project Teams
    description: Operations for managing project teams.
  - name: Organizations API - Users
    description: Operations for managing users.
paths:
  /management/contact-attribute-keys:
    post:
      tags:
        - Management API - Contact Attribute Keys
      summary: Create a contact attribute key
      description: Creates a contact attribute key in the database.
      operationId: createContactAttributeKey
      requestBody:
        required: true
        description: The contact attribute key to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/contactAttributeKeyInput'
      responses:
        '201':
          description: Contact attribute key created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The ID of the contact attribute key
                  createdAt:
                    type: string
                    description: The date and time the contact attribute key was created
                    example: '2021-01-01T00:00:00.000Z'
                  updatedAt:
                    type: string
                    description: >-
                      The date and time the contact attribute key was last
                      updated
                    example: '2021-01-01T00:00:00.000Z'
                  isUnique:
                    type: boolean
                    description: >-
                      Whether the attribute must have unique values across
                      contacts
                    example: false
                  key:
                    type: string
                    description: The attribute identifier used in the system
                    example: email
                  name:
                    type:
                      - string
                      - 'null'
                    description: Display name for the attribute
                    example: Email Address
                  description:
                    type:
                      - string
                      - 'null'
                    description: Description of the attribute
                    example: The user's email address
                  type:
                    type: string
                    enum:
                      - default
                      - custom
                    description: Whether this is a default or custom attribute
                    example: custom
                  environmentId:
                    type: string
                    description: The ID of the environment this attribute belongs to
components:
  schemas:
    contactAttributeKeyInput:
      type: object
      properties:
        key:
          type: string
          description: The attribute identifier used in the system
          example: email
        name:
          type:
            - string
            - 'null'
          description: Display name for the attribute
          example: Email Address
        description:
          type:
            - string
            - 'null'
          description: Description of the attribute
          example: The user's email address
        environmentId:
          type: string
          description: The ID of the environment this attribute belongs to
      required:
        - key
        - name
        - description
        - environmentId
      description: Input data for creating or updating a contact attribute
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Use your Formbricks x-api-key to authenticate.

````