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

# Create an API key.

> Creates an API key for the authenticated current user after the required interactive confirmation supplied
by the request. A user can have at most two listed keys. Creation completes before the response and does not
establish a public expiry, renewal, or propagation-time contract.



## OpenAPI

````yaml /risk-and-pricing/atoti-risk-services/apis-endpoints/openapi/openapi.mintlify.json post /api/User/me/ApiKeys
openapi: 3.0.4
info:
  title: Derivitec Api 1.0
  version: '1.0'
servers:
  - url: https://api.riskportal.activeviam.com
security:
  - oauth2: []
  - apikey: []
tags:
  - name: AdminUser
  - name: AtotiReport
  - name: AtotiSession
  - name: BloombergOAuth
  - name: Bond
  - name: BondYieldCurvePage
  - name: BookAccess
  - name: Books
  - name: Commodity
  - name: Counterparties
  - name: Currencies
  - name: Equity
  - name: EquityDividend
  - name: EquityPage
  - name: FeatureFlag
  - name: Fx
  - name: FxPage
  - name: GroupAccess
  - name: Home
  - name: LegacyPosition
  - name: MarketData
  - name: MarketDataProvider
  - name: MarketDataProviderAccess
  - name: Meta
  - name: Notification
  - name: Organisation
  - name: PnLReport
  - name: PortfolioAccess
  - name: Portfolios
  - name: Position
  - name: PositionFilter
  - name: PricingEnvironment
  - name: PricingEnvironmentAccess
  - name: RateAsset
  - name: RateAssetPage
  - name: Report
  - name: ReportDefinition
  - name: ReportHistoryLauncherQuery
  - name: ReportLauncher
  - name: ReportQuery
  - name: ReportQueryViewUser
  - name: ReportRestriction
  - name: ReportView
  - name: RiskReport
  - name: Tradable
  - name: TradeBooking
  - name: User
  - name: VarReport
  - name: VarReportQuery
  - name: YieldCurvePage
paths:
  /api/User/me/ApiKeys:
    post:
      tags:
        - User
      summary: Create an API key.
      description: >-
        Creates an API key for the authenticated current user after the required
        interactive confirmation supplied

        by the request. A user can have at most two listed keys. Creation
        completes before the response and does not

        establish a public expiry, renewal, or propagation-time contract.
      operationId: CreateApiKey
      requestBody:
        description: >-
          JSON request for the current user's API key. The request includes the
          required interactive confirmation.
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/CreateApiKeyModel'
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApiKeyModel'
          text/json:
            schema:
              $ref: '#/components/schemas/CreateApiKeyModel'
          application/*+json:
            schema:
              $ref: '#/components/schemas/CreateApiKeyModel'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DerivitecExposedApiKey'
        '400':
          description: >-
            Returns error text when the user already has two listed keys or when
            key creation fails.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - oauth2: []
        - apikey: []
components:
  schemas:
    CreateApiKeyModel:
      required:
        - $type
      type: object
      properties:
        name:
          type: string
          description: >-
            Name to assign to the new API key. The value must not be null or
            empty.
          nullable: true
          example: Reporting integration
        description:
          type: string
          description: >-
            Description to assign to the new API key. The value must not be null
            or empty.
          nullable: true
          example: Synthetic key for a reporting workflow.
        password:
          type: string
          description: Password confirmation supplied for the API-key creation request.
          nullable: true
        mfa_token:
          type: string
          description: >-
            Multi-factor authentication confirmation supplied for the API-key
            creation request.
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.RiskPortal.Api.Models.CreateApiKeyModel,
              Derivitec.RiskPortal.Api
      additionalProperties: false
      description: Request to create an API key for the authenticated current user.
    DerivitecExposedApiKey:
      required:
        - $type
      type: object
      properties:
        id:
          type: string
          description: Opaque identifier used to select this API-key record.
          nullable: true
        name:
          type: string
          description: Client-provided name assigned to the API key.
          nullable: true
          example: Reporting integration
        exposed_value:
          type: string
          description: API-key value returned with the client-facing record.
          nullable: true
        $type:
          type: string
          enum:
            - >-
              Derivitec.Aws.ApiGateway.Models.DerivitecExposedApiKey,
              Derivitec.Aws.ApiGateway
      additionalProperties: false
      description: Client-facing API-key record returned by list and create operations.
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: false
  securitySchemes:
    oauth2:
      type: oauth2
      description: >-
        OAuth2 access-token requested from AWS Cognito and provided as a Auth
        Bearer header
      flows:
        implicit:
          authorizationUrl: https://auth.riskportal.derivitec.com/oauth2/authorize
          scopes: {}
    apikey:
      type: apiKey
      description: API-Key requested via the site and provided as a header
      name: x-api-key
      in: header

````