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

# Run an atomic batch of structured record operations

> Requires host authentication and current database grants. Names and stable UUIDs are accepted as resource references. SQL availability and dialect depend on the provider; the PostgreSQL adapter supports a bounded subset, not arbitrary server SQL.



## OpenAPI

````yaml /agent-openapi.json post /api/v1/data/{resource}/transactions
openapi: 3.1.0
info:
  title: Polpo API
  version: 1.0.0
  description: >-
    REST API for Polpo — an AI agent that manages teams of AI coding agents.
    Manage tasks, missions, agents, playbooks, skills, and approvals. For
    conversational interaction, use the OpenAI-compatible POST
    /v1/chat/completions endpoint.
servers:
  - url: http://localhost:3890
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Databases
    description: >-
      Named application databases, records, scoped SQL, and versioned
      migrations.
paths:
  /api/v1/data/{resource}/transactions:
    post:
      tags:
        - Databases
      summary: Run an atomic batch of structured record operations
      description: >-
        Requires host authentication and current database grants. Names and
        stable UUIDs are accepted as resource references. SQL availability and
        dialect depend on the provider; the PostgreSQL adapter supports a
        bounded subset, not arbitrary server SQL.
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 128
          required: true
          name: resource
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                operations:
                  type: array
                  items:
                    oneOf:
                      - type: object
                        properties:
                          op:
                            type: string
                            enum:
                              - list
                          table:
                            type: string
                            pattern: ^[a-z][a-z0-9_]{0,47}$
                          filter:
                            type: object
                            additionalProperties:
                              type: object
                              properties:
                                eq:
                                  type:
                                    - string
                                    - number
                                    - boolean
                                    - object
                                    - array
                                    - 'null'
                                  description: >-
                                    Any JSON value; arrays and objects may
                                    contain nested JSON values.
                                ne:
                                  type:
                                    - string
                                    - number
                                    - boolean
                                    - object
                                    - array
                                    - 'null'
                                  description: >-
                                    Any JSON value; arrays and objects may
                                    contain nested JSON values.
                                gt:
                                  type:
                                    - string
                                    - number
                                    - boolean
                                    - object
                                    - array
                                    - 'null'
                                  description: >-
                                    Any JSON value; arrays and objects may
                                    contain nested JSON values.
                                gte:
                                  type:
                                    - string
                                    - number
                                    - boolean
                                    - object
                                    - array
                                    - 'null'
                                  description: >-
                                    Any JSON value; arrays and objects may
                                    contain nested JSON values.
                                lt:
                                  type:
                                    - string
                                    - number
                                    - boolean
                                    - object
                                    - array
                                    - 'null'
                                  description: >-
                                    Any JSON value; arrays and objects may
                                    contain nested JSON values.
                                lte:
                                  type:
                                    - string
                                    - number
                                    - boolean
                                    - object
                                    - array
                                    - 'null'
                                  description: >-
                                    Any JSON value; arrays and objects may
                                    contain nested JSON values.
                                in:
                                  type: array
                                  items:
                                    type:
                                      - string
                                      - number
                                      - boolean
                                      - object
                                      - array
                                      - 'null'
                                    description: >-
                                      Any JSON value; arrays and objects may
                                      contain nested JSON values.
                                  minItems: 1
                                  maxItems: 100
                                isNull:
                                  type: boolean
                              additionalProperties: false
                          orderBy:
                            type: array
                            items:
                              type: object
                              properties:
                                column:
                                  type: string
                                direction:
                                  type: string
                                  enum:
                                    - asc
                                    - desc
                              required:
                                - column
                                - direction
                              additionalProperties: false
                            maxItems: 3
                          limit:
                            type: integer
                            minimum: 1
                            maximum: 200
                          offset:
                            type: integer
                            minimum: 0
                            maximum: 10000
                        required:
                          - op
                          - table
                        additionalProperties: false
                      - type: object
                        properties:
                          op:
                            type: string
                            enum:
                              - insert
                          table:
                            type: string
                            pattern: ^[a-z][a-z0-9_]{0,47}$
                          values:
                            type: object
                            additionalProperties:
                              type:
                                - string
                                - number
                                - boolean
                                - object
                                - array
                                - 'null'
                              description: >-
                                Any JSON value; arrays and objects may contain
                                nested JSON values.
                        required:
                          - op
                          - table
                          - values
                        additionalProperties: false
                      - type: object
                        properties:
                          op:
                            type: string
                            enum:
                              - upsert
                          table:
                            type: string
                            pattern: ^[a-z][a-z0-9_]{0,47}$
                          values:
                            type: object
                            additionalProperties:
                              type:
                                - string
                                - number
                                - boolean
                                - object
                                - array
                                - 'null'
                              description: >-
                                Any JSON value; arrays and objects may contain
                                nested JSON values.
                          onConflict:
                            type: array
                            items:
                              type: string
                              pattern: ^[a-z][a-z0-9_]{0,47}$
                            minItems: 1
                            maxItems: 4
                        required:
                          - op
                          - table
                          - values
                          - onConflict
                        additionalProperties: false
                      - type: object
                        properties:
                          op:
                            type: string
                            enum:
                              - update
                          table:
                            type: string
                            pattern: ^[a-z][a-z0-9_]{0,47}$
                          id:
                            type: string
                            format: uuid
                          expectedVersion:
                            type: integer
                            exclusiveMinimum: 0
                          values:
                            type: object
                            additionalProperties:
                              type:
                                - string
                                - number
                                - boolean
                                - object
                                - array
                                - 'null'
                              description: >-
                                Any JSON value; arrays and objects may contain
                                nested JSON values.
                        required:
                          - op
                          - table
                          - id
                          - expectedVersion
                          - values
                        additionalProperties: false
                      - type: object
                        properties:
                          op:
                            type: string
                            enum:
                              - delete
                          table:
                            type: string
                            pattern: ^[a-z][a-z0-9_]{0,47}$
                          id:
                            type: string
                            format: uuid
                          expectedVersion:
                            type: integer
                            exclusiveMinimum: 0
                        required:
                          - op
                          - table
                          - id
                          - expectedVersion
                        additionalProperties: false
                  minItems: 1
                  maxItems: 100
                idempotencyKey:
                  type: string
                  minLength: 1
                  maxLength: 200
                  pattern: ^[\x21-\x7e]+$
              required:
                - operations
              additionalProperties: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        rows:
                          type: array
                          items:
                            type: object
                            additionalProperties: {}
                        total:
                          type: integer
                        nextOffset:
                          type:
                            - integer
                            - 'null'
                      required:
                        - rows
                required:
                  - ok
                  - data
        '400':
          description: Invalid, denied, conflicting, bounded or unavailable request
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  error:
                    type: string
                required:
                  - ok
                  - code
                  - error
        '401':
          description: Invalid, denied, conflicting, bounded or unavailable request
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  error:
                    type: string
                required:
                  - ok
                  - code
                  - error
        '403':
          description: Invalid, denied, conflicting, bounded or unavailable request
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  error:
                    type: string
                required:
                  - ok
                  - code
                  - error
        '404':
          description: Invalid, denied, conflicting, bounded or unavailable request
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  error:
                    type: string
                required:
                  - ok
                  - code
                  - error
        '409':
          description: Invalid, denied, conflicting, bounded or unavailable request
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  error:
                    type: string
                required:
                  - ok
                  - code
                  - error
        '413':
          description: Invalid, denied, conflicting, bounded or unavailable request
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  error:
                    type: string
                required:
                  - ok
                  - code
                  - error
        '422':
          description: Invalid, denied, conflicting, bounded or unavailable request
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  error:
                    type: string
                required:
                  - ok
                  - code
                  - error
        '503':
          description: Invalid, denied, conflicting, bounded or unavailable request
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  error:
                    type: string
                required:
                  - ok
                  - code
                  - error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key passed as a Bearer token. Configure via the apiKeys field in
        project.json or the POLPO_API_KEY environment variable.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.