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

# Link Discord and Minecraft Accounts

> Links a Discord user's snowflake ID to a Minecraft UUID. Supports setting a primary account and updates existing links.



## OpenAPI

````yaml https://stash.seraph.si/json post /discord/user/link
openapi: 3.1.0
info:
  contact:
    email: support@seraph.si
    name: API Support
    url: https://discord.gg/seraph
  title: Seraph API
  version: '4.0'
servers: []
security: []
externalDocs:
  description: ''
  url: ''
paths:
  /discord/user/link:
    post:
      tags:
        - Discord
        - User Linking
      summary: Link Discord and Minecraft Accounts
      description: >-
        Links a Discord user's snowflake ID to a Minecraft UUID. Supports
        setting a primary account and updates existing links.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sprint.DiscordMinecraftLink'
        description: Link Discord and Minecraft accounts data
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sprint.DiscordMinecraftLink'
          description: Successfully linked/updated accounts
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/validation.ErrorResponse'
          description: Bad request, e.g., invalid Minecraft UUID or invalid request body
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/validation.ErrorResponse'
          description: Unauthorized, not enough permissions
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/validation.ErrorResponse'
          description: >-
            Internal server error during database operations or external API
            calls
components:
  schemas:
    sprint.DiscordMinecraftLink:
      properties:
        id:
          type: string
        is_primary:
          type: boolean
        snowflake:
          type: string
      type: object
    validation.ErrorResponse:
      properties:
        cause:
          type: string
        code:
          type: integer
        documentation:
          type: string
        extra:
          items:
            $ref: '#/components/schemas/validation.ErrorObject'
          type: array
          uniqueItems: false
        msTime:
          type: integer
        success:
          type: boolean
      type: object
    validation.ErrorObject:
      properties:
        code:
          type: integer
        developer_reason:
          type: string
        name:
          type: string
        reason:
          type: string
      type: object

````