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

# Resolve or create a Machines user

> Maps your user id to a Machines user (and wallet).



## OpenAPI

````yaml openapi.yaml post /partner/v1/users/resolve
openapi: 3.1.0
info:
  title: Machines Cash API
  version: 0.3.0
  description: >
    API for KYC, cards, encryption, balances, deposits, transactions, and
    withdrawals.

    All responses use a consistent envelope by default: { ok, data, summary,
    errors[], next }.

    Set X-Open-Responses: 1 to receive Open Responses-style response objects.
servers:
  - url: https://api.machines.cash
    description: production
  - url: https://dev-api.machines.cash
    description: sandbox
security: []
tags:
  - name: users
  - name: sessions
  - name: kyc
  - name: kycValues
  - name: agreements
  - name: cards
  - name: encryption
  - name: balances
  - name: deposits
  - name: transactions
  - name: withdrawals
paths:
  /partner/v1/users/resolve:
    parameters:
      - $ref: '#/components/parameters/OpenResponses'
      - $ref: '#/components/parameters/OpenResponsesCallId'
    post:
      tags:
        - users
      summary: Resolve or create a Machines user
      description: Maps your user id to a Machines user (and wallet).
      operationId: api.users.resolve
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserResolveRequest'
      responses:
        '200':
          description: User resolved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResolveResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
        - ApiKey: []
components:
  parameters:
    OpenResponses:
      name: X-Open-Responses
      in: header
      required: false
      schema:
        type: string
        enum:
          - '1'
          - 'true'
      description: >-
        Return Open Responses-compatible output when set (replaces the default
        response envelope).
    OpenResponsesCallId:
      name: X-Open-Responses-Call-Id
      in: header
      required: false
      schema:
        type: string
        minLength: 1
      description: >-
        Tool call id used for function_call_output items when Open Responses
        mode is enabled.
  schemas:
    UserResolveRequest:
      type: object
      additionalProperties: false
      required:
        - userId
      properties:
        userId:
          type: string
          minLength: 1
          maxLength: 120
          description: Your unique id for this user.
          example: user-123
        walletAddress:
          $ref: '#/components/schemas/WalletAddress'
        walletLabel:
          type: string
          maxLength: 120
          description: Optional label for display.
          example: Main Wallet
    UserResolveResponse:
      type: object
      additionalProperties: false
      required:
        - ok
        - data
        - summary
        - errors
      properties:
        ok:
          type: boolean
          const: true
        data:
          $ref: '#/components/schemas/User'
        summary:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
        next:
          $ref: '#/components/schemas/NextHint'
    WalletAddress:
      type: string
      pattern: ^0x[a-fA-F0-9]{40}$
      example: '0x2b0f7f2f7c8e4c3d2d3b3f6a8f9b0c1d2e3f4a5b'
    User:
      type: object
      additionalProperties: false
      required:
        - userId
        - walletAddress
        - kycStatus
        - createdAt
      properties:
        userId:
          type: string
          description: Your user id.
        walletAddress:
          type:
            - string
            - 'null'
        kycStatus:
          $ref: '#/components/schemas/KycStatus'
        createdAt:
          type: string
          format: date-time
    ErrorDetail:
      type: object
      additionalProperties: false
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalid_request
        message:
          type: string
          example: missing required field
        field:
          type: string
          description: Optional field name that caused the error.
    NextHint:
      type: object
      additionalProperties: false
      properties:
        pollAfterMs:
          type: integer
          minimum: 0
        suggestedTool:
          type: string
        suggestedArgs:
          type: object
          additionalProperties: true
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - ok
        - summary
        - errors
      properties:
        ok:
          type: boolean
          const: false
        summary:
          type: string
          example: invalid request
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
        next:
          $ref: '#/components/schemas/NextHint'
    KycStatus:
      type: string
      enum:
        - not_submitted
        - pending
        - approved
        - denied
        - locked
        - canceled
        - needs_information
        - needs_verification
        - manual_review
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-Partner-Key

````