{
  "info": {
    "name": "Parlavi API",
    "_postman_id": "parlavi-api-v1",
    "description": "Parlavi Style-Profile & Restyle API.\n\nVariables:\n- `base_url` — e.g. https://parlavi.com\n- `api_key`  — from /dashboard → Developer → API Keys",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://parlavi.com",
      "type": "string"
    },
    {
      "key": "api_key",
      "value": "",
      "type": "string"
    },
    {
      "key": "profile_id",
      "value": "",
      "type": "string",
      "description": "UUID from analyze response"
    },
    {
      "key": "source_id",
      "value": "",
      "type": "string",
      "description": "UUID from sources response"
    },
    {
      "key": "key_id",
      "value": "",
      "type": "string",
      "description": "UUID from keys response"
    },
    {
      "key": "adapter_id",
      "value": "",
      "type": "string",
      "description": "UUID from lora response"
    }
  ],
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-API-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{api_key}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Style Profiles",
      "item": [
        {
          "name": "Analyze text",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/analyze",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "analyze"
              ],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"text\": \"Paste your writing sample here — at least 200 words.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Extract a structured writing-style profile from a prose sample."
          }
        },
        {
          "name": "Get profile",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/profiles/{id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "profiles",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "",
                  "description": "Replace with actual id"
                }
              ]
            },
            "description": "Retrieve a style profile by UUID."
          }
        },
        {
          "name": "Delete profile",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/profiles/{id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "profiles",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "",
                  "description": "Replace with actual id"
                }
              ]
            },
            "description": "Permanently delete a style profile."
          }
        },
        {
          "name": "List demo profiles",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/profiles/demo",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "profiles",
                "demo"
              ],
              "variable": []
            },
            "description": "List all demo style profiles available for anonymous restyle."
          }
        }
      ]
    },
    {
      "name": "Restyle",
      "item": [
        {
          "name": "Restyle text",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/restyle",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "restyle"
              ],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"text\": \"Your original text here.\",\n  \"profileId\": \"{{profile_id}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Rewrite text in the style of the given profile."
          }
        },
        {
          "name": "List voices",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/voices",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "voices"
              ],
              "variable": []
            },
            "description": "List available voice clusters with their demo profile IDs."
          }
        }
      ]
    },
    {
      "name": "Data Sources",
      "item": [
        {
          "name": "Add source",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/sources",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "sources"
              ],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://medium.com/@yourhandle\",\n  \"type\": \"medium\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Connect a content source (Medium, Substack, X) to ingest writing samples."
          }
        },
        {
          "name": "List sources",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/sources",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "sources"
              ],
              "variable": []
            },
            "description": "List all connected data sources for the authenticated user."
          }
        },
        {
          "name": "Delete source",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/sources/{id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "sources",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "",
                  "description": "Replace with actual id"
                }
              ]
            },
            "description": "Remove a connected data source."
          }
        }
      ]
    },
    {
      "name": "Ingest",
      "item": [
        {
          "name": "Ingest text",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/ingest",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ingest"
              ],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"text\": \"A paragraph or more of your writing.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Ingest a writing sample for voice training. Samples are used to train your personal voice model."
          }
        }
      ]
    },
    {
      "name": "Custom Models",
      "item": [
        {
          "name": "Start training run",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/lora/train",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "lora",
                "train"
              ],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"profileId\": \"{{profile_id}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Kick off a LoRA fine-tune training run for a given style profile."
          }
        },
        {
          "name": "List custom models",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/lora",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "lora"
              ],
              "variable": []
            },
            "description": "List all custom model training runs for the authenticated user."
          }
        },
        {
          "name": "Get custom model",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/lora/{id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "lora",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "",
                  "description": "Replace with actual id"
                }
              ]
            },
            "description": "Get status and metadata for a specific training run."
          }
        },
        {
          "name": "Delete custom model",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/lora/{id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "lora",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "",
                  "description": "Replace with actual id"
                }
              ]
            },
            "description": "Delete a custom model record."
          }
        }
      ]
    },
    {
      "name": "API Keys",
      "item": [
        {
          "name": "Create key",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/keys",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "keys"
              ],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"My integration\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Create a new API key. The raw key is returned only once."
          }
        },
        {
          "name": "List keys",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/keys",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "keys"
              ],
              "variable": []
            },
            "description": "List all API keys (masked) for the authenticated user."
          }
        },
        {
          "name": "Delete key",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/keys/{id}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "keys",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "",
                  "description": "Replace with actual id"
                }
              ]
            },
            "description": "Revoke an API key."
          }
        }
      ]
    },
    {
      "name": "Usage",
      "item": [
        {
          "name": "Get usage",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/usage",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "usage"
              ],
              "variable": []
            },
            "description": "Get current-month API call count and quota for the authenticated user."
          }
        }
      ]
    },
    {
      "name": "Teams",
      "item": [
        {
          "name": "Create team",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/teams",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "teams"
              ],
              "variable": []
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Acme Corp\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Create a new team. Requires Team plan."
          }
        },
        {
          "name": "List teams",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/teams",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "teams"
              ],
              "variable": []
            },
            "description": "List all teams the authenticated user belongs to."
          }
        },
        {
          "name": "Invite member",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/teams/{id}/invitations",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "teams",
                ":id",
                "invitations"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "",
                  "description": "Replace with actual id"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"colleague@company.com\",\n  \"role\": \"member\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Invite a user to a team by email."
          }
        },
        {
          "name": "List members",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-API-Key",
                "value": "{{api_key}}",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/teams/{id}/members",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "teams",
                ":id",
                "members"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "",
                  "description": "Replace with actual id"
                }
              ]
            },
            "description": "List all members of a team."
          }
        }
      ]
    },
    {
      "name": "Health",
      "item": [
        {
          "name": "Health check",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/healthz",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "healthz"
              ],
              "variable": []
            },
            "description": "Returns 200 OK when the service is up."
          }
        }
      ]
    }
  ]
}