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

# Submit input with permit

> Submits a signed input to a deployed agreement. The input ID and values must match an input defined by the agreement JSON, and the signer must be allowed by that input.

For the complete documentation index, see [llms.txt](https://docs.shodai.network/llms.txt).

Input submission requires a wallet that can sign for an account allowed by the authored input `issuer`. Use the deployed agreement record's `chainId` and contract address when creating the EIP-712 signature. In SDK integrations, use `submitAgreementInputWithPermit(...)` to sign and submit in one flow. Generated API examples document request and response shape; choose input IDs and values from the deployed agreement JSON.


## OpenAPI

````yaml /openapi.json post /v0/agreements/{id}/input
openapi: 3.1.0
info:
  title: Agreements API
  version: v0
  description: Author, deploy, read, and advance agreements through the Agreements API.
servers:
  - url: https://test-api.shodai.network
    description: Public base URL for the Agreements API testnet environment.
  - url: https://api.shodai.network
    description: Public base URL for the Agreements API production environment.
security: []
tags:
  - name: Agreement Records
    description: List and read agreement records.
  - name: Agreement Documents
    description: Resolve hosted agreement prose documents.
  - name: Authoring
    description: Check authored agreement JSON before deployment.
  - name: Deployment
    description: Preflight and deploy agreements.
  - name: Using Agreements
    description: Read state, inspect input history, and submit signed inputs.
  - name: System
    description: Health and OpenAPI discovery endpoints.
paths:
  /v0/agreements/{id}/input:
    post:
      tags:
        - Using Agreements
      summary: Submit input with permit
      description: >-
        Submits a signed input to a deployed agreement. The input ID and values
        must match an input defined by the agreement JSON, and the signer must
        be allowed by that input.
      operationId: submitAgreementInputWithPermit
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Agreement ID or deployed agreement address.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcessInputRequest'
            examples:
              signedInput:
                summary: Signed agreement input
                value:
                  inputId: submitInitialPaymentProof
                  values:
                    paymentReference: wire-2026-04-27-001
                  signer: '0x2222222222222222222222222222222222222222'
                  deadline: 1776219513
                  signature:
                    v: 27
                    r: >-
                      0x1111111111111111111111111111111111111111111111111111111111111111
                    s: >-
                      0x2222222222222222222222222222222222222222222222222222222222222222
      responses:
        '201':
          description: Created input record.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    $ref: '#/components/schemas/AgreementInputRecord'
                  meta:
                    $ref: '#/components/schemas/ResponseMeta'
              examples:
                createdInput:
                  summary: Created input record
                  value:
                    data:
                      agreementId: agr_123
                      agreementAddress: '0x3333333333333333333333333333333333333333'
                      chainId: 59141
                      inputId: submitInitialPaymentProof
                      txHash: >-
                        0x4444444444444444444444444444444444444444444444444444444444444444
                      payload: 0x...
                      values:
                        paymentReference: wire-2026-04-27-001
                      status: MINED
                      createdAt: '2026-04-27T16:10:00.000Z'
                      updatedAt: '2026-04-27T16:11:00.000Z'
                    meta:
                      apiVersion: v0
                      requestId: req_123
        '400':
          description: Invalid signed input payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: >-
            The authenticated API principal has paid_required entitlement mode
            for the requested scope. Per-call x402 settlement is not
            implemented. Treat this as an entitlement/operator issue.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: The API key is not allowed to access this resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Agreement not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: typescript
          label: SDK
          source: >-
            import { submitAgreementInputWithPermit } from
            '@cns-labs/agreements-api-client';


            const input = await submitAgreementInputWithPermit({
              client,
              agreementId: 'agr_123',
              walletClient,
              publicClient,
              chainId: agreementRecord.chainId,
              agreementContractAddress: '0x3333333333333333333333333333333333333333',
              agreement,
              inputId: 'submitInitialPaymentProof',
              values: { paymentReference: 'wire-2026-04-27-001' },
            });
components:
  schemas:
    ProcessInputRequest:
      type: object
      required:
        - inputId
        - values
        - signer
        - deadline
        - signature
      description: Signed input submission for a deployed agreement.
      properties:
        inputId:
          type: string
          description: Input ID defined in the agreement JSON.
        values:
          type: object
          additionalProperties: true
          description: Business values submitted for this input.
        signer:
          type: string
          description: Wallet address that signed the EIP-712 input permit.
        deadline:
          type: integer
          description: Unix timestamp in seconds when the input permit expires.
        signature:
          $ref: '#/components/schemas/PermitSignature'
      example:
        inputId: submitInitialPaymentProof
        values:
          paymentReference: wire-2026-04-27-001
        signer: '0x2222222222222222222222222222222222222222'
        deadline: 1776219513
        signature:
          v: 27
          r: '0x1111111111111111111111111111111111111111111111111111111111111111'
          s: '0x2222222222222222222222222222222222222222222222222222222222222222'
    AgreementInputRecord:
      type: object
      required:
        - agreementId
        - agreementAddress
        - chainId
        - inputId
        - txHash
        - payload
        - values
        - status
        - createdAt
        - updatedAt
      properties:
        agreementId:
          type: string
          description: Hosted agreement record ID associated with this input.
        agreementAddress:
          type: string
          description: Deployed agreement address associated with this input.
        chainId:
          type: integer
          description: Chain ID for the deployed agreement.
        inputId:
          type: string
          description: Input ID submitted to the agreement.
        userId:
          type: string
          description: Platform user ID associated with the submission, when available.
        blockNumber:
          type: integer
          description: Block number for the mined input transaction, when available.
        payload:
          type: string
          description: Encoded input payload retained by the API.
        values:
          type: object
          additionalProperties: true
          description: Business values submitted with the input.
        txHash:
          type: string
          description: Transaction hash for the input submission.
        error:
          type: string
          description: Error message when the input submission failed.
        createdAt:
          type: string
          format: date-time
          description: Input record creation timestamp.
        updatedAt:
          type: string
          format: date-time
          description: Input record update timestamp.
        status:
          type: string
          enum:
            - PENDING
            - MINED
            - FAILED
          description: Input submission status.
      example:
        agreementId: agr_123
        agreementAddress: '0x3333333333333333333333333333333333333333'
        chainId: 59141
        inputId: submitInitialPaymentProof
        txHash: '0x4444444444444444444444444444444444444444444444444444444444444444'
        payload: 0x...
        values:
          paymentReference: wire-2026-04-27-001
        status: MINED
        createdAt: '2026-04-27T16:10:00.000Z'
        updatedAt: '2026-04-27T16:11:00.000Z'
    ResponseMeta:
      type: object
      required:
        - apiVersion
        - requestId
      properties:
        apiVersion:
          type: string
          example: v0
        requestId:
          type: string
          description: Correlation ID for support and debugging.
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - requestId
          properties:
            code:
              type: string
              example: unauthorized
              description: Stable machine-readable error code.
            message:
              type: string
              example: Missing API key
              description: Safe human-readable error summary.
            details:
              description: Optional field errors or upstream-safe context.
            requestId:
              type: string
              description: Correlation ID for support and debugging.
    PermitSignature:
      type: object
      required:
        - v
        - r
        - s
      description: EIP-712 signature parts.
      properties:
        v:
          type: integer
          description: Recovery identifier.
        r:
          type: string
          description: Signature r value.
        s:
          type: string
          description: Signature s value.
      example:
        v: 27
        r: '0x1111111111111111111111111111111111111111111111111111111111111111'
        s: '0x2222222222222222222222222222222222222222222222222222222222222222'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Canonical API-key credential. Send X-API-Key: cns_pk_..., or
        Authorization: Bearer cns_pk_... only as an API-key compatibility alias.
        OAuth and JWT bearer tokens are not supported.
      x-default: YOUR_API_KEY

````