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

# Create an agent from dashboard

> Creates a new agent directly from the dashboard. The agent is automatically claimed by the authenticated user. Returns a runtime key.



## OpenAPI

````yaml /openapi.json post /api/agents/create
openapi: 3.1.0
info:
  title: Mandate API
  version: 1.2.0
  description: >-
    Non-custodial agent wallet policy layer. Enforces spend limits, allowlists,
    and approval workflows for AI agent transactions without ever receiving
    private keys.
  contact:
    name: Mandate
    url: https://mandate.md
    email: support@mandate.md
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://app.mandate.md
    description: Production
security: []
tags:
  - name: Registration
    description: >-
      Agent registration and claiming. No auth required for register; Sanctum
      auth for claim.
  - name: Agent API
    description: >-
      Endpoints authenticated with a runtime key (Bearer mndt_live_... or
      mndt_test_...). Used by agents to validate transactions, post events, and
      poll status.
  - name: Intent Lifecycle
    description: >-
      Post transaction hashes after broadcast and poll intent status until
      confirmed.
  - name: Dashboard
    description: >-
      Dashboard endpoints for human operators. Authenticated via Sanctum
      (cookie-based session).
  - name: Policies
    description: >-
      Policy management for agents. List, create, and view policy
      configurations.
  - name: Approvals
    description: Approval queue for transactions that require human review.
paths:
  /api/agents/create:
    post:
      tags:
        - Dashboard
      summary: Create an agent from dashboard
      description: >-
        Creates a new agent directly from the dashboard. The agent is
        automatically claimed by the authenticated user. Returns a runtime key.
      operationId: createAgent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAgentRequest'
            example:
              name: Treasury Bot
      responses:
        '201':
          description: Agent created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAgentResponse'
              example:
                agentId: 9e5f1a2b-3c4d-5e6f-7a8b-9c0d1e2f3a4b
                runtimeKey: mndt_test_abc123def456ghi789jkl012mno345
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
      security:
        - SanctumAuth: []
components:
  schemas:
    CreateAgentRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          maxLength: 100
          description: Display name for the agent.
    CreateAgentResponse:
      type: object
      required:
        - agentId
        - runtimeKey
      properties:
        agentId:
          type: string
          format: uuid
        runtimeKey:
          type: string
          description: Runtime key. Store securely.
    ValidationError:
      type: object
      required:
        - message
        - errors
      properties:
        message:
          type: string
          description: Summary error message.
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Per-field validation errors.
  securitySchemes:
    SanctumAuth:
      type: apiKey
      in: cookie
      name: laravel_session
      description: >-
        Laravel Sanctum cookie-based session authentication. Obtained via GitHub
        OAuth login on the dashboard.

````