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

# Set up auto-fill on a property

> Create an AI auto-fill agent on a property. One auto-fill is allowed per property. **Requires scope:** `property_agents:write`.



## OpenAPI

````yaml /openapi-v1.json post /v1/property-agents
openapi: 3.1.0
info:
  title: Custral API
  version: v1
  description: >-
    The curated, versioned, API-key-authenticated public REST surface (`/v1`).
    Every endpoint here is what the official SDKs (`@custral/sdk`) and the MCP
    server are built on. Authenticate with a secret API key (`sk_…`) created in
    **Settings → Applications**.
  contact:
    name: Custral Support
    email: hello@custral.com
    url: https://custral.com
  license:
    name: Proprietary
    url: https://custral.com
servers:
  - url: https://api.custral.com
    description: Production
security:
  - ApiKey: []
tags:
  - name: Identity
    description: Introspect the calling API key.
  - name: Records
    description: Create, list, retrieve, and update records on any object.
  - name: Objects
    description: Read the object (table) schema of your workspace.
  - name: Conversations
    description: View, manage, and ingest conversations and their messages.
  - name: MCP
    description: Introspect the Model Context Protocol tool surface for a key.
  - name: Documents
    description: Read record notes / page documents as markdown.
paths:
  /v1/property-agents:
    post:
      tags:
        - Property agents
      summary: Set up auto-fill on a property
      description: >-
        Create an AI auto-fill agent on a property. One auto-fill is allowed per
        property. **Requires scope:** `property_agents:write`.
      operationId: createPropertyAgent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePropertyAgentBody'
      responses:
        '200':
          description: The created auto-fill agent.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/PropertyAgent'
                  reqId:
                    $ref: '#/components/schemas/RequestId'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    CreatePropertyAgentBody:
      type: object
      description: >-
        Set up AI auto-fill on a property. One auto-fill is allowed per
        property.
      properties:
        objectId:
          type: string
          description: The object (`obj_…`) the property belongs to.
          example: obj_123
        propertyId:
          type: string
          description: The property (`prop_…`) to auto-fill.
          example: prop_123
        kind:
          type: string
          enum:
            - summarize
            - research
            - classify
            - prompt
          example: research
        instructions:
          type: string
          description: What the AI should output for the property.
        model:
          type: string
          description: Model id, or `auto` (default).
        sources:
          $ref: '#/components/schemas/PropertyAgentSourcesInput'
        triggerTypes:
          type: array
          items:
            type: string
            enum:
              - onCreate
              - onUpdate
              - recurring
          description: Automatic triggers; omit for manual-only.
        onlyIfEmpty:
          type: boolean
          description: Only write when the property is empty. Defaults to false.
        isEnabled:
          type: boolean
          description: Whether the auto-fill is enabled. Defaults to true.
      required:
        - objectId
        - propertyId
        - kind
        - instructions
    PropertyAgent:
      type: object
      description: >-
        An AI auto-fill agent — the config attached to a single property that
        fills its value with AI.
      properties:
        id:
          type: string
          example: pagent_123
        objectId:
          type:
            - string
            - 'null'
          example: obj_123
        propertyId:
          type:
            - string
            - 'null'
          example: prop_123
        kind:
          type:
            - string
            - 'null'
          enum:
            - summarize
            - research
            - classify
            - prompt
            - null
          example: research
        instructions:
          type:
            - string
            - 'null'
          example: Using the record's Website, output the company's industry.
        model:
          type:
            - string
            - 'null'
          example: auto
        sources:
          type: object
          description: Context toggles the agent reads from.
          additionalProperties: true
        triggerTypes:
          type: array
          items:
            type: string
            enum:
              - onCreate
              - onUpdate
              - recurring
        recurringCron:
          type:
            - string
            - 'null'
        scopeFilterJson:
          description: >-
            An optional record filter restricting which records the agent fires
            on, or null.
        dependsOn:
          type: array
          items:
            type: string
          description: propertyIds that must run before this agent.
        requiresProperties:
          type: array
          items:
            type: string
          description: propertyIds that must be non-empty before this agent runs.
        onlyIfEmpty:
          type: boolean
        isEnabled:
          type: boolean
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
    RequestId:
      type: string
      description: >-
        A per-request id (`req_…`). Quote it to support when reporting a
        problem.
      example: req_2a1f9c8e7b6d5
    PropertyAgentSourcesInput:
      type: object
      description: >-
        Context toggles. Omitted toggles default sensibly for the kind (research
        enables the web).
      properties:
        recordContext:
          type: boolean
          description: Include the record's own fields in the prompt.
        web:
          type: boolean
          description: Allow web research.
    Error:
      type: object
      description: >-
        The failure envelope. Every error carries a machine-readable `code` and
        the `reqId` of the failing request.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: insufficient_scope
          required:
            - code
        reqId:
          $ref: '#/components/schemas/RequestId'
      required:
        - error
  responses:
    Unauthorized:
      description: >-
        The API key is missing, unknown, inactive, or expired (`code:
        invalid_api_key`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_api_key
            reqId: req_2a1f9c8e7b6d5
    Forbidden:
      description: >-
        The key lacks the scope this endpoint requires (`code:
        insufficient_scope`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: insufficient_scope
            reqId: req_2a1f9c8e7b6d5
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: sk_...
      description: >-
        A Custral **secret** API key (`sk_…`), created in Settings →
        Applications. Sent as `Authorization: Bearer sk_…`. The `X-Api-Key:
        sk_…` header is also accepted and takes precedence. Never expose a
        secret key in a browser.

````

## Related topics

- [Property Auto-Fill Agents](/ai/property-agents/overview.md)
- [The Property Agent object](/dev/api-reference/property-agents.md)
- [Triggers](/ai/property-agents/triggers.md)
- [Troubleshooting](/ai/property-agents/troubleshooting.md)
- [Delete an auto-fill agent](/api-reference/property-agents/delete-an-auto-fill-agent.md)
