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

# Retrieve Agent

> Retrieve a JSON object of a single agent from agentId and the resourceSlug



## OpenAPI

````yaml get /{resourceSlug}/agent/{agentId}.json
openapi: 3.0.0
info:
  title: Agentcloud Webapp API Docs
  description: The API docs for Agentcloud's webapp.
  version: 0.2.1
servers:
  - url: https://app.agentcloud.dev
    description: Use our public api endpoints!
  - url: '{custom_url}'
    description: Test the endpoints on your own instance of Agent Cloud!
    variables:
      custom_url:
        default: https://app.agentcloud.dev
security: []
tags: []
paths:
  /{resourceSlug}/agent/{agentId}.json:
    get:
      tags:
        - Agents
      summary: Retrieve Agent
      description: >-
        Retrieve a JSON object of a single agent from agentId and the
        resourceSlug
      operationId: agentJson
      parameters:
        - name: resourceSlug
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ObjectId'
          description: >-
            The resourceSlug is a url parameter of the teamId associated with
            the user
        - name: agentId
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ObjectId'
          description: The url parameter with the Id of the agent to get
      responses:
        '200':
          description: JSON object containing found agent using the agentId and the teamId
          content:
            agent.json:
              schema:
                $ref: '#/components/schemas/Agent'
        '400':
          description: >-
            Invalid toolIds, modelIds or function calling modelIds. The content
            will contain an error message which will detail which field is
            incorrect.
          content:
            dynamicResponse:
              schema:
                $ref: '#/components/schemas/dynamicResponse'
        '403':
          description: >-
            Invalid Permissions on the resourceSlug, attempting to access an
            agent outside the permissions of the team
          content:
            dynamicResponse:
              schema:
                $ref: '#/components/schemas/dynamicResponse'
        '500':
          description: Internal error
          content:
            dynamicResponse:
              schema:
                $ref: '#/components/schemas/dynamicResponse'
components:
  schemas:
    ObjectId:
      description: >-
        Mongodb Object id, unique identifier, length of 24 characters fitting
        the following regex; [a-f0-9]{24}
      type: string
    Agent:
      description: An agent object used for tasks or apps
      required:
        - _id
        - name
        - role
        - goal
        - backstory
        - modelId
        - verbose
        - allowDelegation
      properties:
        _id:
          type: string
          description: Unique Mongodb identifier for the object
          additionalProperties:
            $ref: '#/components/schemas/ObjectId'
        orgId:
          description: >-
            Organisation the agent is linked to (generally the org of the user
            that created the agent)
          type: string
          additionalProperties:
            $ref: '#/components/schemas/ObjectId'
        teamId:
          description: >-
            Team the agent is linked to (generally the team of the user that
            created the agent)
          type: string
          additionalProperties:
            $ref: '#/components/schemas/ObjectId'
        name:
          type: string
          description: Name of the agent
        role:
          description: >-
            Fed into the LLM to help it provide a more detailed and correct
            response
          type: string
        goal:
          description: >-
            The goal of the agent is fed into the LLM, this allows the LLM to
            know it's role in the RAG pipeline
          type: string
        backstory:
          description: A detailed description of what the LLM will be doing
          type: string
        modelId:
          description: >-
            The linked ObjectId of the model being used by this agent (this
            links to a Model object)
          type: string
          additionalProperties:
            $ref: '#/components/schemas/ObjectId'
        functionModelId:
          description: >-
            A secondary model used to execute function calls (this links to a
            Model object), set to null if unused automatically by the API
          type: string
          additionalProperties:
            $ref: '#/components/schemas/ObjectId'
        verbose:
          description: >-
            True or false check to determine if custom verbosity is used in
            agent, higher verbosity requires agent to include more of the
            retrieved documents at the expense of longer answers, lower
            verbosity can result in shorter answers but can also ommit crucial
            details
          type: boolean
        allowDelegation:
          description: >-
            True or false check to determine if the agent is allowed to delegate
            tasks to other agents in the context of an app
          type: boolean
        toolIds:
          description: >-
            Array of the tools the agent can access to improve performance and
            abstract tool functionality from agent usage
          type: array
          items:
            type: string
            additionalProperties:
              $ref: '#/components/schemas/ObjectId'
        icon:
          description: >-
            IconAttachment object used to hold the attached icon used for the
            agent (this links to an IconAttachment object);
          additionalProperties:
            $ref: '#/components/schemas/ObjectId'
    dynamicResponse:
      description: Server response
      properties:
        message:
          type: string
          description: Error message to provide more detail
        code:
          type: integer
          description: the error code

````