# Create Referral Code

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/referral/create:
    post:
      summary: Create Referral Code
      deprecated: false
      description: Creates a referral code for the authenticated user.
      tags:
        - 🔐 Authenticated
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: true
          example: Bearer {{apiKey}}
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties: {}
              x-apidog-orders: []
            example: {}
      responses:
        '200':
          description: ''
          content:
            '*/*':
              schema:
                type: object
                properties:
                  code:
                    type: string
                  usage_count:
                    type: integer
                required:
                  - code
                  - usage_count
                x-apidog-orders:
                  - code
                  - usage_count
              example: |-
                {
                  "code": "TUNNELSATS2026",
                  "usage_count": 0
                }
          headers: {}
          x-apidog-name: ''
      security: []
      x-apidog-folder: 🔐 Authenticated
      x-apidog-status: released
      x-run-in-apidog: https://app.eu.apidog.com/web/project/361232/apis/api-4063138-run
components:
  schemas: {}
  securitySchemes:
    ApiKeyAuth:
      type: bearer
      scheme: bearer
      description: Authenticate using your TunnelSats API Key (sk_live_...).
    NostrAuth:
      type: bearer
      scheme: bearer
      description: >-
        NIP-98 Nostr Authentication. The 'token' should be the base64-encoded
        NIP-98 event JSON.
servers:
  - url: https://tunnelsats.com
    description: Prod Env
security: []

```