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

# Process CSV Upload

> Parses raw CSV text and runs the registered pipeline for the upload type, creating grants.

Not available to API keys yet. It will need `grants:write`.

## OpenAPI

````yaml api-reference/openapi.json POST /tga/process-csv-upload
openapi: 3.1.0
info:
  title: Toku API
  version: 1.0.0
servers:
  - url: https://api.toku.com
security:
  - bearerAuth: []
paths:
  /tga/process-csv-upload:
    post:
      operationId: processCSVUpload
      summary: Process CSV Upload
      description: >-
        Parses raw CSV text and runs the registered pipeline for the upload
        type, creating grants.


        Not available to API keys yet. It will need `grants:write`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcessCSVUploadRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessCSVUploadResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '409':
          description: Conflict
        '429':
          description: Response 429
components:
  schemas:
    ProcessCSVUploadRequest:
      type: object
      properties:
        uploadType:
          type: string
          enum:
            - grants
            - recorded-payment-corrections
            - wallets
        csvData:
          type: string
          minLength: 1
      required:
        - uploadType
        - csvData
    ProcessCSVUploadResponse:
      type: object
      properties:
        success:
          type: boolean
        summary:
          type: object
          properties:
            totalRows:
              type: integer
              minimum: 0
            validRows:
              type: integer
              minimum: 0
            invalidRows:
              type: integer
              minimum: 0
            reviewRows:
              type: integer
              minimum: 0
            durationMs:
              type: integer
              minimum: 0
            stagesExecuted:
              type: array
              items:
                type: string
          required:
            - totalRows
            - validRows
            - invalidRows
            - reviewRows
            - durationMs
            - stagesExecuted
        data:
          type: array
          items:
            type: object
            additionalProperties: {}
        created:
          type: object
          additionalProperties:
            type: array
            items: {}
        needsReview:
          type: array
          items:
            type: object
            properties:
              row:
                type: integer
              field:
                type: string
              value:
                type: string
              matchedTo:
                type: string
              confidence:
                type: number
            required:
              - row
              - field
              - value
              - matchedTo
              - confidence
        errors:
          type: array
          items:
            type: object
            additionalProperties: {}
        warnings:
          type: array
          items:
            type: object
            additionalProperties: {}
        columnMappings:
          type: array
          items:
            type: object
            additionalProperties: {}
        unmappedColumns:
          type: array
          items:
            type: object
            additionalProperties: {}
      required:
        - success
        - summary
        - data
        - created
        - needsReview
        - errors
        - warnings
        - columnMappings
        - unmappedColumns
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
````
