> ## 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 versão

## Propósito

Cria uma nova versão de conteúdo para um prompt.

## Parâmetros

* `prompt_id` (path, string) obrigatório
* Corpo JSON:
  * `content` (string) obrigatório
  * `change_summary` (string) opcional
  * `metadata_` (object) opcional

## Dados retornados

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

## Exemplo

```bash theme={null}
curl -X POST "${BASE_URL}/v1/integration/prompts/pr_1/versions" \
  -H "X-API-Key: ak_xxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Bem-vindo ao app!",
    "change_summary": "Atualização do tom",
    "metadata_": { "lang": "pt-BR" }
  }'
```

## Códigos de status

* 200 Sucesso
* 404 Prompt não encontrado
* 403 Projeto não autorizado pela API Key

## Casos de uso

* Evoluir conteúdo mantendo histórico e versionamento


## OpenAPI

````yaml api-reference/openapi.json post /v1/integration/prompts/{prompt_id}/versions
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}/versions:
    post:
      summary: Create version
      parameters:
        - in: path
          name: prompt_id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVersionRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActiveVersionResponse'
components:
  schemas:
    CreateVersionRequest:
      type: object
      properties:
        content:
          type: string
        change_summary:
          type: string
          nullable: true
        metadata_:
          type: object
          additionalProperties: true
          nullable: true
      required:
        - content
    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

````