> ## 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.

# Start an agent job with a prompt



## OpenAPI

````yaml https://platform.usecontextlayer.com/api/openapi.json post /slates/{target}/agents/{name}/jobs
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 jobs
paths:
  /slates/{target}/agents/{name}/jobs:
    post:
      tags:
        - Agent jobs
      summary: Start an agent job with a prompt
      operationId: startAgentJob
      parameters:
        - schema:
            type: string
            minLength: 1
          required: true
          name: name
          in: path
        - schema:
            anyOf:
              - type: string
                format: uuid
              - type: string
          required: true
          name: target
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  minLength: 1
              required:
                - prompt
              additionalProperties: false
      responses:
        '202':
          description: Native routed job and Pi submission receipt
          headers:
            Location:
              description: The created job resource
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  job:
                    type: object
                    properties:
                      createdAt:
                        type: number
                      id:
                        type: string
                        format: uuid
                      metadata:
                        type:
                          - object
                          - 'null'
                        properties:
                          actor:
                            oneOf:
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - app
                                required:
                                  - type
                              - type: object
                                properties:
                                  id:
                                    type: string
                                    minLength: 1
                                  type:
                                    type: string
                                    enum:
                                      - user
                                required:
                                  - id
                                  - type
                          trigger:
                            oneOf:
                              - type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - api
                                required:
                                  - type
                              - type: object
                                properties:
                                  schedule:
                                    type: string
                                  scheduleId:
                                    type: string
                                  type:
                                    type: string
                                    enum:
                                      - schedule
                                required:
                                  - schedule
                                  - scheduleId
                                  - type
                        required:
                          - actor
                          - trigger
                      updatedAt:
                        type: number
                    required:
                      - createdAt
                      - id
                      - metadata
                      - updatedAt
                  receipt:
                    type: object
                    properties:
                      accepted:
                        type: boolean
                      operationId:
                        type: string
                      session:
                        type: string
                    required:
                      - accepted
                      - operationId
                      - session
                required:
                  - job
                  - receipt
        '400':
          description: Invalid slate target, agent name, or prompt
        '401':
          description: A valid ContextLayer login is required
        '403':
          description: Slate viewing is forbidden or the slate is public
        '404':
          description: Slate or deployed agent 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.