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

# Create content

> Uploads a binary file as a `Content` resource the client can later attach to an expense record (e.g. as a receipt). The created resource is *temporary* — owned by the caller and eligible for cleanup if it is not subsequently attached. When `action=scan` is passed, the OCR result is persisted on the resource so it can be referenced later without re-scanning.



## OpenAPI

````yaml openapi/findity-expense-api.json POST /content
openapi: 3.0.3
info:
  title: Findity Expense API
  description: Findity Expense API
  version: 1.0.0
servers:
  - url: https://stage-api.findity.com/api/v1/expense
  - url: https://api.findity.com/api/v1/expense
security:
  - bearerAuth: []
paths:
  /content:
    post:
      tags:
        - Content
      summary: Create content
      description: >-
        Uploads a binary file as a `Content` resource the client can later
        attach to an expense record (e.g. as a receipt). The created resource is
        *temporary* — owned by the caller and eligible for cleanup if it is not
        subsequently attached. When `action=scan` is passed, the OCR result is
        persisted on the resource so it can be referenced later without
        re-scanning.
      operationId: createContent
      parameters:
        - name: action
          in: query
          required: false
          description: >-
            Optional server-side action to run against the uploaded content.
            `scan` runs synchronous OCR; the result is persisted on the
            resource.
          schema:
            type: string
            enum:
              - scan
          example: scan
        - $ref: '#/components/parameters/organizationIdQuery'
        - in: header
          name: Content-Type
          description: >-
            MIME type of the request body. Must be `image/*` or
            `application/pdf`; the server also verifies the bytes match the
            declared type.
          schema:
            type: string
          examples:
            jpeg:
              value: image/jpeg
            png:
              value: image/png
            pdf:
              value: application/pdf
          required: true
        - in: header
          name: Content-Name
          description: >-
            Optional name for the uploaded content. URL-decoded server-side.
            Auto-generated if omitted.
          schema:
            type: string
          example: receipt-photo.jpg
          required: false
        - in: header
          name: Content-Description
          description: >-
            Optional description for the uploaded content. URL-decoded
            server-side.
          schema:
            type: string
          example: this is the receipt photo
          required: false
        - in: header
          name: qrScan
          description: >
            Optional URL-encoded string extracted from a fiscal QR code on the
            receipt (currently used for Portuguese receipts). URL-decoded
            server-side and persisted on the resource; the decoded value is
            returned in the response and on subsequent reads. Send only when the
            `verification.receiptAttachment` field has `qrCodeSupported: true`
            (see the fields endpoint) and the client successfully scanned a QR —
            otherwise omit the header.
          schema:
            type: string
          example: >-
            A%3A514482621%2AB%3A501878076%2AC%3APT%2AD%3AFR%2AE%3AN%2AF%3A20260508%2AG%3A111%2026A%2F154%2AH%3AJ6Z9V4MR-154%2AI1%3APT-MA%2AI7%3A68.50%2AI8%3A15.76%2AN%3A15.76%2AO%3A84.26%2AQ%3AT4Fn%2AR%3A116
          required: false
      requestBody:
        content:
          image/*:
            schema:
              type: string
              format: binary
          application/pdf:
            schema:
              type: string
              format: binary
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Content'
              example:
                id: 62bfaa54dc9341819cd6f4ff4ae39f44
                personId: 063ee3c7fa4b4728b418097299447f9d
                contentType: application/pdf
                isTemporary: true
                signatureType: null
                signatureUrl: null
                name: receipt-photo.jpg
                description: Receipt photo
                qrScan: >-
                  A:514482621*B:501878076*C:PT*D:FR*E:N*F:20260508*G:111
                  26A/154*H:J6Z9V4MR-154*I1:PT-MA*I7:68.50*I8:15.76*N:15.76*O:84.26*Q:T4Fn*R:116
                scanResult:
                  id: a185160800524ac68cbf0a18ad59649b
                  amount: 135
                  taxAmount: 23
                  currency: SEK
                  purchaseDate: '2023-04-20'
                  categoryIds:
                    - 575ba2572de74f38b947a07df93a2909
                    - 350dadb020694421aebc1d9473fa64a9
                  categoryId: 575ba2572de74f38b947a07df93a2909
        '400':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400Error'
              examples:
                not an image:
                  value:
                    result: error
                    code: NOT_AN_IMAGE
                    description: Not an image or unsupported image
                not a PDF:
                  value:
                    result: error
                    code: NOT_A_PDF
                    description: Not a pdf or unsupported pdf
                content too big:
                  value:
                    result: error
                    code: CONTENT_TOO_BIG
                    description: Content too big, max size is 50MB
                invalid content type:
                  value:
                    result: error
                    code: INVALID_CONTENT_TYPE
                    description: Content type 'application/msword' not allowed
                save failed:
                  value:
                    result: error
                    code: SAVE_FAILED
                    description: An error occurred while saving
                convert failed:
                  value:
                    result: error
                    code: CONVERT_FAILED
                    description: An error occurred while converting the image
                empty request:
                  value:
                    result: error
                    code: EMPTY_REQUEST
                    description: Empty request
components:
  parameters:
    organizationIdQuery:
      in: query
      name: organizationId
      required: false
      description: >-
        Organization scope for the request. Required when the caller has access
        to more than one organization; auto-inferred otherwise.
      schema:
        $ref: '#/components/schemas/Uuid'
      example: 05b8daba9ba14a49846fe77883248cf0
  schemas:
    Content:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/Uuid'
        personId:
          $ref: '#/components/schemas/Uuid'
        contentType:
          type: string
        isTemporary:
          type: boolean
        signatureType:
          type: string
          enum:
            - EU
        signatureUrl:
          type: string
        name:
          type: string
        description:
          type: string
        qrScan:
          type: string
          description: >-
            Decoded fiscal QR string as sent in the `qrScan` request header on
            POST. Omitted when the resource has no QR data attached. Currently
            populated for Portuguese receipts.
        scanResult:
          type: object
          readOnly: true
          properties:
            id:
              $ref: '#/components/schemas/Uuid'
            amount:
              type: number
              format: double
            taxAmount:
              type: number
              format: double
            currency:
              type: string
            purchaseDate:
              type: string
            categoryIds:
              type: array
              items:
                $ref: '#/components/schemas/Uuid'
            categoryId:
              $ref: '#/components/schemas/Uuid'
      example:
        id: 62bfaa54dc9341819cd6f4ff4ae39f44
        personId: 063ee3c7fa4b4728b418097299447f9d
        contentType: application/pdf
        isTemporary: true
        signatureType: null
        signatureUrl: null
        name: receipt-photo.jpg
        description: Receipt photo
        qrScan: >-
          A:514482621*B:501878076*C:PT*D:FR*E:N*F:20260508*G:111
          26A/154*H:J6Z9V4MR-154*I1:PT-MA*I7:68.50*I8:15.76*N:15.76*O:84.26*Q:T4Fn*R:116
        scanResult:
          id: a185160800524ac68cbf0a18ad59649b
          amount: 135
          taxAmount: 23
          currency: SEK
          purchaseDate: '2023-04-20'
          categoryIds:
            - 575ba2572de74f38b947a07df93a2909
            - 350dadb020694421aebc1d9473fa64a9
          categoryId: 575ba2572de74f38b947a07df93a2909
    400Error:
      type: object
      properties:
        result:
          type: string
        code:
          type: string
        description:
          type: string
    Uuid:
      type: string
      pattern: ^[0-9a-fA-F]{32}$
      description: UUID without dashes (32-character hex string)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````