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

# Busca Ambiente

## Propósito

Retorna a versão ativa de um prompt em um ambiente específico.

## Parâmetros

* `prompt_id` (path, string) obrigatório
* `environment` (query, string) obrigatório

## Dados retornados

`id`, `prompt_id`, `version_number`, `content`, `metadata_`, `created_at`.

## Exemplo

```bash theme={null}
curl -H "X-API-Key: ak_xxxxxxxxx" \
  "${BASE_URL}/v1/integration/prompts/pr_1/version/active?environment=production"
```

Resposta:

```json theme={null}
{
  "id": "ver_12",
  "prompt_id": "pr_1",
  "version_number": 12,
  "content": "...",
  "metadata_": null,
  "created_at": "2025-11-27T12:00:00Z"
}
```

## Códigos de status

* 200 Sucesso
* 404 Versão ativa não encontrada
* 403 Acesso negado por workspace/projeto

## Casos de uso

* Obter o conteúdo atual utilizado pelo seu serviço em determinado ambiente


## OpenAPI

````yaml api-reference/openapi.json get /v1/integration/prompts/{prompt_id}/version/active
openapi: 3.0.3
info:
  title: Propty Integration API
  version: 1.0.0
servers:
  - url: https://api.aivra.cloud
security:
  - ApiKeyAuth: []
paths:
  /v1/integration/prompts/{prompt_id}/version/active:
    get:
      summary: Get active version
      parameters:
        - in: path
          name: prompt_id
          required: true
          schema:
            type: string
        - in: query
          name: environment
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActiveVersionResponse'
components:
  schemas:
    ActiveVersionResponse:
      type: object
      properties:
        id:
          type: string
        prompt_id:
          type: string
        version_number:
          type: integer
        content:
          type: string
        metadata_:
          type: object
          additionalProperties: true
          nullable: true
        created_at:
          type: string
          format: date-time
          nullable: true
      required:
        - id
        - prompt_id
        - version_number
        - content
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````