> ## Documentation Index
> Fetch the complete documentation index at: https://sure-917046f5-mintlify-docs-update-1787365312803.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create valuation



## OpenAPI

````yaml /openapi.yaml post /api/v1/valuations
openapi: 3.0.3
info:
  title: Sure API
  version: v1
  description: OpenAPI documentation generated from executable request specs.
servers:
  - url: https://app.sure.am
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
paths:
  /api/v1/valuations:
    post:
      tags:
        - Valuations
      summary: Create valuation
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                valuation:
                  type: object
                  properties:
                    account_id:
                      type: string
                      format: uuid
                      description: Account ID (required)
                    amount:
                      type: number
                      description: Valuation amount (required)
                    date:
                      type: string
                      format: date
                      description: Valuation date (required)
                    notes:
                      type: string
                      description: Additional notes
                    upsert:
                      type: boolean
                      description: >-
                        Nested alternative to the top-level response-status
                        flag. Top-level upsert takes precedence when both are
                        provided.
                  required:
                    - account_id
                    - amount
                    - date
                upsert:
                  type: boolean
                  description: >-
                    Response-status signal only. When true and a same-account
                    same-date valuation exists before the request, the endpoint
                    returns 200 OK instead of 201 Created. The underlying
                    reconciliation write path is unchanged; this flag does not
                    add duplicate-prevention or safe-retry guarantees beyond
                    existing same-date reconciliation behavior.
              required:
                - valuation
        required: true
      responses:
        '200':
          description: existing valuation upserted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Valuation'
        '201':
          description: valuation created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Valuation'
        '404':
          description: account not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: validation error - missing date
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKeyAuth: []
components:
  schemas:
    Valuation:
      type: object
      required:
        - id
        - date
        - amount
        - currency
        - kind
        - account
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        date:
          type: string
          format: date
        amount:
          type: string
        currency:
          type: string
        notes:
          type: string
          nullable: true
        kind:
          type: string
        account:
          $ref: '#/components/schemas/Account'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        message:
          type: string
          nullable: true
        details:
          oneOf:
            - type: array
              items:
                type: string
            - type: object
          nullable: true
        errors:
          type: array
          items:
            type: string
          nullable: true
          description: >-
            Validation error messages (alternative to details used by trades,
            valuations, etc.)
    Account:
      type: object
      required:
        - id
        - name
        - account_type
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        account_type:
          type: string
          nullable: true
        status:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: X-Api-Key
      in: header
      description: API key for authentication. Generate one from your account settings.

````