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

# Generate API Key

> Generate user API keys.



## OpenAPI

````yaml post /user/apikey
openapi: 3.0.3
info:
  title: GetPartna Api Documentation
  version: '3.0'
servers:
  - url: https://staging-api.getpartna.com/v4
  - url: https://api.getpartna.com/v4
security:
  - x-api-key: []
    x-api-user: []
  - authorization: []
tags:
  - description: user endpoints
    name: User
  - description: account endpoints
    name: Account
  - description: transfer endpoints
    name: Transfer
  - description: supported assets and networks
    name: Supported
  - description: discount endpoints
    name: Discount
  - description: rate endpoints
    name: Rate
  - description: KYC endpoints
    name: KYC
  - description: Multi-Factor Authentication endpoints
    name: MFA
  - description: ramp endpoints
    name: Ramp
  - description: pricing endpoints
    name: Pricing
  - description: banks
    name: Bank
  - description: mock endpoints for testing
    name: Mock
paths:
  /user/apikey:
    post:
      tags:
        - User
      summary: Generate API Key
      description: Generate user API keys.
      operationId: post-user-apikey
      requestBody:
        content:
          application/json:
            schema:
              example:
                apikey: ''
                expirationInDays: 0
                expirationInMonths: 0
                keyname: ''
                otp: ''
                scope: ''
              properties:
                apikey:
                  description: >-
                    supplied if there's an existing api key that needs to be
                    deleted
                  type: string
                expirationInDays:
                  type: number
                expirationInMonths:
                  type: number
                keyname:
                  description: key identifier of the user's choice
                  type: string
                otp:
                  type: string
                scope:
                  description: >-
                    permission level of the apiKey; get api key scopes to see
                    valid scopes; use M for a master key; G for a get only key;
                    W for a withdrawal permitted key; and N for a no withdrawal
                    key
                  type: string
              required:
                - scope
                - keyname
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                example:
                  data:
                    apikey: >-
                      1--M--4fca371417414423ace78dc730b46e81--1781793658613--3677a356
                  message: success
                properties:
                  data:
                    properties:
                      apikey:
                        type: string
                    type: object
                  message:
                    type: string
                type: object
          description: post user apikey ok
        '400':
          content:
            application/json:
              schema:
                example:
                  message: invalid API scope
                properties:
                  message:
                    type: string
                type: object
          description: post user apikey bad request
      security:
        - x-api-key: []
          x-api-user: []
        - authorization: []
components:
  securitySchemes:
    x-api-key:
      in: header
      name: x-api-key
      type: apiKey
    x-api-user:
      in: header
      name: x-api-user
      type: apiKey
    authorization:
      bearerFormat: JWT
      scheme: bearer
      type: http

````