> ## 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 start function

> Get the start function code. Runs synchronously before every conversation greeting.



## OpenAPI

````yaml api-reference/agents/openapi.json GET /v1/agents/{agentId}/branches/{branchId}/functions/start
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/start:
    parameters:
      - name: agentId
        in: path
        required: true
        schema:
          type: string
      - name: branchId
        in: path
        required: true
        schema:
          type: string
    get:
      tags:
        - Functions
      summary: Get the start function code
      description: >-
        Get the start function code. Runs synchronously before every
        conversation greeting.
      responses:
        '200':
          description: >-
            Get the start function code. Runs synchronously before every
            conversation greeting.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpecialFunctionPublicResponse'
components:
  schemas:
    SpecialFunctionPublicResponse:
      title: SpecialFunctionPublicResponse
      description: >-
        The code, syntax errors, and parameters for a branch's start or end
        special function.
      type: object
      properties:
        code:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              lineno:
                type: number
              message:
                type: string
              text:
                type: string
            required:
              - lineno
              - message
            additionalProperties: false
        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
      required:
        - code
        - errors
        - parameters
      additionalProperties: false
  securitySchemes:
    polyApiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````