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

# Import Action

> Land the tool surface `agent-sdk` extracted from an already-built agent as a draft action version: tool names, parameter names, types and requiredness  
Extraction derives shapes and never guesses constraints, so the draft denies until a person authors its policy in the dashboard and publishes it  
A re-import creates a new version rather than editing one, because a published version may already be pinned by live mandates  
Proposed rules are checked against the supported CEL: a rule that would deny every call is refused, one outside the supported CEL is saved and listed in `warnings`



## OpenAPI

````yaml /versions/2026-10-16.yaml post /agents/actions/{did}
openapi: 3.1.0
info:
  title: Humanos API
  description: Humanos API
  version: '1.0'
  contact: {}
servers:
  - url: https://api.humanos.tech
security: []
tags:
  - name: humanosApp
    description: ''
paths:
  /agents/actions/{did}:
    post:
      tags:
        - Agents
      summary: Import Action
      description: >-
        Land the tool surface `agent-sdk` extracted from an already-built agent
        as a draft action version: tool names, parameter names, types and
        requiredness  

        Extraction derives shapes and never guesses constraints, so the draft
        denies until a person authors its policy in the dashboard and publishes
        it  

        A re-import creates a new version rather than editing one, because a
        published version may already be pinned by live mandates  

        Proposed rules are checked against the supported CEL: a rule that would
        deny every call is refused, one outside the supported CEL is saved and
        listed in `warnings`
      operationId: agents_importAction
      parameters:
        - name: did
          required: true
          in: path
          description: The agent's DID, URL-encoded.
          schema:
            example: did:web:humanos.tech:agent:2f8b6c41-9d37-4e5a-8b02-6c1d9e7a4f35
            type: string
        - $ref: '#/components/parameters/ApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportActionBody'
      responses:
        '201':
          description: >-
            Returns the draft action version and the split of who supplies each
            value, with `warnings` when the draft holds something to change
            before publishing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportActionEntity'
        '400':
          description: >-
            The body is malformed, it carries no tools or more rules than
            allowed, or a proposed rule would deny every call (named in the
            message).
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 400
                  message:
                    type: string
                    example: >-
                      Rule "rate_cap" (never passes): no such overload: double +
                      int
                  error:
                    type: string
                    example: Bad Request
        '404':
          description: >-
            The agent is unknown, or another organization operates it: an
            organization only reads and changes its own agents.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    example: 404
                  message:
                    type: string
                    example: actor not found
                  error:
                    type: string
                    example: Not Found
components:
  parameters:
    ApiVersion:
      name: API-Version
      in: header
      required: false
      schema:
        type: string
        pattern: ^\d{4}-\d{2}-\d{2}$
        example: '2026-10-16'
      description: >-
        Pin request, response, and webhook shapes to a specific dated API
        version (YYYY-MM-DD). Omit to use the version pinned to your API key
        (set when the key is created; new keys default to the latest version).
        New integrations should target the latest version.
  schemas:
    ImportActionBody:
      type: object
      properties:
        name:
          type: string
          description: >-
            The action name. A re-import under the same name adds a version to
            that action.
          example: payments-agent
        description:
          type: string
          example: Pays invoices from the company account.
        tools:
          description: >-
            The tools, as `agent-sdk`'s `toWireTools` gives them: `{ name,
            description?, params }`, each parameter `{ type, description?,
            required?, role? }`. Each tool is read by the import, which owns its
            shape.
          example:
            - name: pay_invoice
              params:
                amount:
                  type: number
                  required: true
          type: array
          items:
            type: string
        grantorParams:
          type: object
          description: >-
            The values the person fixes in the mandate, by name: `{ type,
            items?, values?, description?, required?, suggested? }`. `suggested`
            is echoed back for the agent's request and never stored in the
            action.
          example:
            maxAmount:
              type: number
              suggested: 500
        rules:
          description: >-
            CEL rules the agent proposes for the draft. A rule that would deny
            every call is a 400; one outside the supported CEL is saved and
            listed in `warnings`.
          type: array
          items:
            $ref: '#/components/schemas/ImportedRuleBody'
        requiredFromTools:
          type: boolean
          description: >-
            Carry each tool parameter's `required` into the draft, so
            verification enforces it.
      required:
        - name
        - tools
    ImportActionEntity:
      type: object
      properties:
        actionId:
          type: string
          description: MongoDB identifier of the action the surface landed on.
          example: 507f1f77bcf86cd799439011
        versionId:
          type: string
          description: >-
            URN of the action version the import wrote, or of the one it found
            unchanged. Use it with the version endpoints.
          example: urn:via:action:abc-123
        created:
          type: boolean
          description: >-
            True when this import created the action; false when it added a
            version to an existing one.
          example: true
        unchanged:
          type: boolean
          description: >-
            True when the same surface was already the action's latest version:
            nothing was written.
          example: false
        updated:
          type: boolean
          description: >-
            True when the latest version was a draft and its declarations were
            refreshed in place, its rules kept.
          example: false
        published:
          type: boolean
          description: >-
            Whether the version returned is published, so a mandate can be asked
            under it now. An import never publishes.
          example: false
        userParams:
          description: The parameters the person fixes in the mandate.
          example:
            - cap
          type: array
          items:
            type: string
        executionParams:
          description: The parameters the agent supplies at each call.
          example:
            - load_id
            - rate_usd
          type: array
          items:
            type: string
        suggested:
          type: object
          description: >-
            The agent's proposed values for the person's parameters, echoed for
            its later request. Never stored in the action.
          additionalProperties: true
          example:
            cap: 500
        warnings:
          description: >-
            What the draft was saved with although the organization cannot
            publish it as it is, such as a rule outside the supported CEL.
            Present only when there is something to say.
          type: array
          items:
            $ref: '#/components/schemas/ActionContentIssueEntity'
      required:
        - actionId
        - created
        - userParams
        - executionParams
        - suggested
    ImportedRuleBody:
      type: object
      properties:
        name:
          type: string
          example: amount_within_limit
        description:
          type: string
          example: The amount stays within the limit the person set.
        expression:
          type: string
          example: params.amount <= userParams.maxAmount
      required:
        - name
        - expression
    ActionContentIssueEntity:
      type: object
      properties:
        rule:
          type: string
          description: The rule's name, when the issue belongs to one rule.
          example: rate_cap
        ruleIndex:
          type: number
          description: >-
            The rule's position in `rules`, so two rules with one name stay
            apart.
          example: 0
        param:
          type: string
          description: >-
            The parameter, as `userParams.<name>` or `executionParams.<name>`,
            when the issue belongs to one.
          example: executionParams.rate_usd
        kind:
          type: string
          description: >-
            `never_passes`: the rule would deny every call. `unsupported`: it
            runs, but outside the supported CEL.
          enum:
            - never_passes
            - unsupported
          example: unsupported
        code:
          type: string
          description: What is wrong, as a code.
          enum:
            - shape
            - invalid_param_name
            - duplicate_param_name
            - too_many_rules
            - expression_empty
            - expression_too_long
            - parse_error
            - unknown_variable
            - unknown_function
            - type_error
            - non_boolean
            - rank_argument
            - unsupported_function
            - unsupported_literal
            - placeholder_only
            - no_user_params
            - undeclared_param
            - unverified_client_ref
          example: unsupported_function
        message:
          type: string
          description: The issue in words, for the person who will fix the rule.
          example: 'Rule "rate_cap" (unsupported): dyn() is outside the supported CEL'
        publishOnly:
          type: boolean
          description: Checked at publish only, so a draft can be saved half-written.
          example: false
      required:
        - kind
        - code
        - message

````

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