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

# Create an agent conversation

> Create a conversation for the authenticated user in this named agent's shared runtime. New conversations use the current model and creation defaults. Returns the native Pi conversation record.



## OpenAPI

````yaml https://platform.usecontextlayer.com/api/openapi.json post /slates/{target}/agents/{name}/{actor}/conversations
openapi: 3.1.0
info:
  title: ContextLayer Platform
  version: 0.1.0
servers:
  - url: https://platform.usecontextlayer.com/api
security: []
tags:
  - name: Slates
  - name: Slate routing
  - name: Slate resources
  - name: Accounts
  - name: Shared secrets
  - name: Agents
  - name: Agent conversations
paths:
  /slates/{target}/agents/{name}/{actor}/conversations:
    post:
      tags:
        - Agent conversations
      summary: Create an agent conversation
      description: >-
        Create a conversation for the authenticated user in this named agent's
        shared runtime. New conversations use the current model and creation
        defaults. Returns the native Pi conversation record.
      operationId: createAgentConversation
      parameters:
        - schema:
            type: string
            minLength: 1
            description: Agent directory name under agents/ in the pushed source.
          required: true
          description: Agent directory name under agents/ in the pushed source.
          name: name
          in: path
        - schema:
            anyOf:
              - type: string
                format: uuid
              - type: string
          required: true
          name: target
          in: path
        - schema:
            type: string
            enum:
              - user
            description: >-
              Manual input is supported only in the authenticated caller's
              SlateAgent.
          required: true
          description: >-
            Manual input is supported only in the authenticated caller's
            SlateAgent.
          name: actor
          in: path
      responses:
        '201':
          description: The created native Pi conversation
          headers:
            Location:
              description: The created conversation resource
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    exclusiveMinimum: 0
                  owner:
                    type: object
                    properties:
                      conversationId:
                        type: integer
                        exclusiveMinimum: 0
                      taskId:
                        type: integer
                        exclusiveMinimum: 0
                    required:
                      - conversationId
                      - taskId
                    additionalProperties: {}
                  parent:
                    type: object
                    properties:
                      at:
                        type: integer
                        exclusiveMinimum: 0
                      conversationId:
                        type: integer
                        exclusiveMinimum: 0
                    required:
                      - at
                      - conversationId
                    additionalProperties: {}
                required:
                  - id
                additionalProperties: {}
        '400':
          description: Invalid slate target, agent name, or actor
        '401':
          description: A valid ContextLayer login is required
        '403':
          description: Slate viewing is forbidden or the slate is public
        '404':
          description: Slate or agent definition not found
        '409':
          description: A required connection assignment or personal secret is missing
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      reason:
                        type: string
                        enum:
                          - connection-required
                      slug:
                        type: string
                        minLength: 1
                    required:
                      - reason
                      - slug
                  - type: object
                    properties:
                      name:
                        type: string
                        minLength: 1
                      reason:
                        type: string
                        enum:
                          - secret-required
                    required:
                      - name
                      - reason
      security:
        - bearerAuth: []
        - webCookie: []
        - localWebCookie: []
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    webCookie:
      in: cookie
      name: __Secure-better-auth.session_token
      type: apiKey
    localWebCookie:
      in: cookie
      name: better-auth.session_token
      type: apiKey

````

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