> ## 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.

# Criar Ambiente

## Propósito

Define a versão ativa de um prompt para um ambiente.

## Parâmetros

* `prompt_id` (path, string) obrigatório
* Corpo JSON:
  * `environment` (string) obrigatório. Ex.: `production`, `staging`
  * `version_id` (string) obrigatório

## Dados retornados

`{"updated": true}` em caso de sucesso.

## Exemplo

```bash theme={null}
curl -X POST "${BASE_URL}/v1/integration/prompts/pr_1/set-active" \
  -H "X-API-Key: ak_xxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "environment": "production",
    "version_id": "ver_12"
  }'
```

## Códigos de status

* 200 Sucesso
* 404 Prompt ou versão não encontrada
* 403 Projeto não autorizado pela API Key

## Casos de uso

* Promover versão de staging para produção


## OpenAPI

````yaml api-reference/openapi.json post /v1/integration/prompts/{prompt_id}/set-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}/set-active:
    post:
      summary: Set active version
      parameters:
        - in: path
          name: prompt_id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetActiveRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdatedResponse'
components:
  schemas:
    SetActiveRequest:
      type: object
      properties:
        environment:
          type: string
        version_id:
          type: string
      required:
        - environment
        - version_id
    UpdatedResponse:
      type: object
      properties:
        updated:
          type: boolean
      required:
        - updated
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````