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

# Get function



## OpenAPI

````yaml api-reference/agents/openapi.json GET /v1/agents/{agentId}/branches/{branchId}/functions/{functionId}
openapi: 3.1.0
info:
  title: PolyAI Agents API
  version: 1.0.11
  description: Manage PolyAI agents, telephony, deployments, and real-time configs.
servers:
  - url: https://api.us.poly.ai
    description: US region
  - url: https://api.eu.poly.ai
    description: EU region
  - url: https://api.uk.poly.ai
    description: UK region
  - url: https://api.studio.poly.ai
    description: Studio region
security:
  - polyApiKey: []
paths:
  /v1/agents/{agentId}/branches/{branchId}/functions/{functionId}:
    parameters:
      - name: agentId
        in: path
        required: true
        schema:
          type: string
      - name: branchId
        in: path
        required: true
        schema:
          type: string
      - name: functionId
        in: path
        required: true
        schema:
          type: string
    get:
      tags:
        - Functions
      summary: Get a single function by ID
      responses:
        '200':
          description: Function details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FunctionPublicResponse'
        '404':
          description: Function not found
components:
  schemas:
    FunctionPublicResponse:
      title: FunctionPublicResponse
      description: >-
        A custom function on a branch, including its code, parameters, and any
        simulated-latency configuration.
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        code:
          type: string
        parameters:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              description:
                type: string
              type:
                type: string
            required:
              - id
              - name
              - description
              - type
            additionalProperties: false
        errors:
          type: array
          items:
            type: object
            properties:
              lineno:
                type: number
              message:
                type: string
              text:
                type: string
            required:
              - lineno
              - message
            additionalProperties: false
        latencyControl:
          type: object
          properties:
            enabled:
              type: boolean
            randomize:
              type: boolean
              default: false
            initialDelay:
              type: number
            interval:
              type: number
            delayResponses:
              type: array
              items:
                type: object
                properties:
                  message:
                    type: string
                  duration:
                    type: number
                required:
                  - message
                  - duration
                additionalProperties: false
          required:
            - enabled
            - initialDelay
            - interval
            - delayResponses
          additionalProperties: false
        archived:
          type: boolean
      required:
        - id
        - name
        - description
        - code
        - parameters
        - errors
        - archived
      additionalProperties: false
  securitySchemes:
    polyApiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````