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

# Get Agent Generation Status

> Check the status of a prompt-based agent generation.

Returns the current status of an agent generation owned by the authenticated user.

Poll the URL supplied in the creation response's `Location` header. Stop polling when the status is `completed` or `failed`. A completed response includes the generated `agentId` and `workflowId`; a failed response includes an error code and message.

Generation status responses are not cached.


## OpenAPI

````yaml GET /agent-generations/{generationId}
openapi: 3.0.1
info:
  title: Phonely API
  description: API for Phonely services including agent management and call summaries
  version: 1.0.0
servers:
  - url: https://app.phonely.ai/api
security: []
paths:
  /agent-generations/{generationId}:
    get:
      summary: Get agent generation status
      description: >-
        Return the current status of a prompt-based agent generation owned by
        the authenticated user.
      parameters:
        - name: generationId
          in: path
          required: true
          description: Generation identifier returned by the create request
          schema:
            type: string
            pattern: ^gen_[a-f0-9]{40}$
      responses:
        '200':
          description: Current generation status
          headers:
            Cache-Control:
              description: Status responses are not cached
              schema:
                type: string
                example: no-store
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentGenerationResponse'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Generation not found or not owned by the authenticated user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Generation status could not be loaded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    AgentGenerationResponse:
      type: object
      required:
        - generationId
        - status
        - createdAt
        - updatedAt
      properties:
        generationId:
          type: string
          pattern: ^gen_[a-f0-9]{40}$
        status:
          type: string
          enum:
            - queued
            - generating
            - completed
            - failed
        agentId:
          type: string
          description: Generated agent identifier. Present when status is completed.
        workflowId:
          type: string
          description: Generated first-flow identifier. Present when status is completed.
        error:
          $ref: '#/components/schemas/AgentGenerationFailure'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error code or identifier
        message:
          type: string
          description: Detailed error message
    AgentGenerationFailure:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Authorization

````