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

# Update Analysis

> Update an existing analysis.

Supports updating: name, description, URLs (add), sub-analyses (remove),
prompts (replace), and configuration.



## OpenAPI

````yaml /openapi-web.json patch /v1/analyses/{analysis_id}
openapi: 3.1.0
info:
  title: GreetIncs API
  description: Analyze any business via API
  version: 0.1.0
servers: []
security: []
tags:
  - name: health
    x-displayName: Health
  - name: analyses
    x-displayName: Analyses
  - name: prompts
    x-displayName: Prompts
paths:
  /v1/analyses/{analysis_id}:
    patch:
      tags:
        - analyses
      summary: Update Analysis
      description: |-
        Update an existing analysis.

        Supports updating: name, description, URLs (add), sub-analyses (remove),
        prompts (replace), and configuration.
      operationId: updateAnalysis
      parameters:
        - name: analysis_id
          in: path
          required: true
          schema:
            type: string
            description: Analysis ID in TypeID format
            title: Analysis Id
          description: Analysis ID in TypeID format
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/app__api__v1__analyses__schemas__AnalysisUpdateRequest
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/app__api__v1__analyses__schemas__AnalysisDescriptionResponse
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    app__api__v1__analyses__schemas__AnalysisUpdateRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Description
        urls_add:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Urls Add
          description: URLs to add as new sub-analyses
        sub_analysis_ids_remove:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Sub Analysis Ids Remove
          description: Sub-analysis IDs to mark as SKIPPED
        structured_prompts:
          anyOf:
            - $ref: >-
                #/components/schemas/app__api__v1__prompts__schemas__StructuredPromptInput
            - type: 'null'
          description: Replace all prompts with this list
        config:
          anyOf:
            - $ref: '#/components/schemas/AnalysisConfigInput'
            - type: 'null'
          description: Replace analysis configuration
      additionalProperties: false
      type: object
      title: AnalysisUpdateRequest
      description: |-
        Request schema for updating an analysis.

        All fields are optional. At least one field must be provided.
    app__api__v1__analyses__schemas__AnalysisDescriptionResponse:
      properties:
        response_type:
          type: string
          title: Response Type
          default: AnalysisDescriptionResponse
        data:
          $ref: >-
            #/components/schemas/app__api__v1__analyses__schemas__AnalysisDescriptionData
        links:
          items:
            $ref: '#/components/schemas/Link'
          type: array
          title: Links
          description: HATEOAS links related to this response (e.g., self, next, prev)
          default: []
          examples:
            - - href: /resource/{resource_id}
                method: GET
                rel: self
                title: Resource Details
              - href: /resource/{resource_id}/related
                method: GET
                rel: related
                title: Related Resources
      additionalProperties: false
      type: object
      required:
        - data
      title: AnalysisDescriptionResponse
      description: Analysis with loaded prompt details and URLs.
    app__api__v1__prompts__schemas__StructuredPromptInput:
      properties:
        ids:
          anyOf:
            - items:
                anyOf:
                  - type: string
                    pattern: ^prompt_[0-9a-hjkmnp-tv-z]{26}$
                    description: >-
                      TypeID with 'prompt' prefix. Format:
                      {prefix}_{base32_uuid7}. Example:
                      prompt_01h45ytscbebyvny4gc8cr8ma2
                    examples:
                      - prompt_01h45ytscbebyvny4gc8cr8ma2
                  - type: string
                    pattern: ^prompt_[0-9a-hjkmnp-tv-z]{26}@[0-9]+$
                    description: >-
                      Versioned prompt ID. Format: prompt_xxx@version. Includes
                      version suffix after @. Example:
                      prompt_01h45ytscbebyvny4gc8cr8ma2@1
                    examples:
                      - prompt_01h45ytscbebyvny4gc8cr8ma2@1
              type: array
            - type: 'null'
          title: Ids
          description: >-
            List of existing prompt refs. Unversioned (prompt_xxx) uses latest
            version. Versioned (prompt_xxx@3) pins to specific version.
        definitions:
          anyOf:
            - items:
                $ref: >-
                  #/components/schemas/app__api__v1__prompts__schemas__StructuredPromptCreateData
              type: array
            - type: 'null'
          title: Definitions
          description: List of structured prompt definitions to create
      type: object
      title: StructuredPromptInput
      description: Input for structured prompts - either refs or full definitions.
    AnalysisConfigInput:
      properties:
        normalize_input_to_domains:
          type: boolean
          title: Normalize Input To Domains
          description: >-
            If true (default), input strings are normalized to domains and
            multi-page exploration is used. If false, URLs are used as-is for
            single-page extraction.
          default: true
        max_pages:
          type: integer
          maximum: 50
          minimum: 1
          title: Max Pages
          description: >-
            Maximum number of pages to explore per domain when
            normalize_input_to_domains is true. Default is 5.
          default: 5
      additionalProperties: false
      type: object
      title: AnalysisConfigInput
      description: Analysis workflow configuration.
    app__api__v1__analyses__schemas__AnalysisDescriptionData:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        owner_id:
          type: string
          title: Owner Id
        created_at:
          type: integer
          title: Created At
        last_run_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Last Run At
        urls:
          items:
            type: string
          type: array
          title: Urls
        prompts:
          items:
            $ref: >-
              #/components/schemas/app__api__v1__prompts__schemas__StructuredPromptResponseData
          type: array
          title: Prompts
      type: object
      required:
        - id
        - name
        - owner_id
        - created_at
        - urls
        - prompts
      title: AnalysisDescriptionData
      description: Analysis detail data.
    Link:
      properties:
        href:
          type: string
          title: Href
          description: The URL of the linked resource
        rel:
          type: string
          title: Rel
          description: The relationship type (e.g., 'self', 'next')
        method:
          type: string
          title: Method
          description: The HTTP method (e.g., 'GET', 'POST')
          default: GET
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
          description: Optional human-readable title
      type: object
      required:
        - href
        - rel
      title: Link
    app__api__v1__prompts__schemas__StructuredPromptCreateData:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
          examples:
            - Company Summary Extractor
        description:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Description
          examples:
            - >-
              Extracts what a company does and whether it is generalist or
              specialist.
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt
          examples:
            - >-
              Given the page content, answer the questions according to the
              schema.
        response_schema:
          anyOf:
            - $ref: '#/components/schemas/app__api__v1__prompts__schemas__JSONSchema'
            - type: 'null'
          description: >-
            Draft-07 JSON Schema describing the structured response. If omitted,
            defaults to {"type":"string"}.
          examples:
            - draft_07:
                enum:
                  - generalist
                  - specialist
                type: string
            - draft_07:
                additionalProperties: false
                properties:
                  what_does_this_company_do:
                    type: string
                  offer_type:
                    enum:
                      - generalist
                      - specialist
                    type: string
                required:
                  - what_does_this_company_do
                  - offer_type
                type: object
      type: object
      required:
        - name
      title: StructuredPromptCreateData
      description: Full structured prompt definition for creation.
    app__api__v1__prompts__schemas__StructuredPromptResponseData:
      properties:
        id:
          type: string
          pattern: ^prompt_[0-9a-hjkmnp-tv-z]{26}$
          title: Id
          description: >-
            TypeID with 'prompt' prefix. Format: {prefix}_{base32_uuid7}.
            Example: prompt_01h45ytscbebyvny4gc8cr8ma2
          examples:
            - prompt_01h45ytscbebyvny4gc8cr8ma2
        idx:
          type: integer
          title: Idx
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        prompt:
          type: string
          title: Prompt
        version:
          type: integer
          title: Version
          description: Version number of this prompt
      type: object
      required:
        - id
        - idx
        - name
        - prompt
        - version
      title: StructuredPromptResponseData
      description: Data model for structured prompts.
    app__api__v1__prompts__schemas__JSONSchema:
      properties:
        draft_07:
          additionalProperties: true
          type: object
          title: Draft 07
          description: >-
            Draft-07 JSON Schema. Supports primitive schemas (e.g.,
            {"type":"string"}) or object schemas. If omitted, defaults to
            {"type":"string"}.
          examples:
            - enum:
                - generalist
                - specialist
              type: string
            - type: string
            - additionalProperties: false
              properties:
                what_does_this_company_do:
                  type: string
                offer_type:
                  enum:
                    - generalist
                    - specialist
                  type: string
              required:
                - what_does_this_company_do
                - offer_type
              type: object
            - type: boolean
            - maximum: 100
              minimum: 0
              type: number
      type: object
      required:
        - draft_07
      title: JSONSchema
      description: >-
        JSON Schema Draft-07 model for structured prompt responses.

        Supports both primitive schemas (e.g., {"type": "string"}) and object
        schemas.

        If omitted, defaults to {"type": "string"}.
  responses:
    BadRequest:
      description: Request Validation Error
      content:
        application/problem+json:
          schema:
            additionalProperties: false
            description: >-
              Error response wrapper for problem details that can be returned
              directly from FastAPI.
            properties:
              response_type:
                default: ErrorResponse
                description: Always 'ErrorResponse' for error responses
                examples:
                  - ErrorResponse
                title: Response Type
                type: string
              data:
                additionalProperties: true
                description: Problem detail for validation errors.
                properties:
                  title:
                    default: Request Validation Error
                    title: Title
                    type: string
                  status:
                    default: 422
                    title: Status
                    type: integer
                  detail:
                    default: Request validation failed
                    title: Detail
                    type: string
                  instance:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem
                    examples:
                      - https://urlyourequest.com/path?query=value
                    title: Instance
                title: ValidationError
                type: object
            required:
              - data
            title: ErrorResponse
            type: object
    Unauthorized:
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            additionalProperties: false
            description: >-
              Error response wrapper for problem details that can be returned
              directly from FastAPI.
            properties:
              response_type:
                default: ErrorResponse
                description: Always 'ErrorResponse' for error responses
                examples:
                  - ErrorResponse
                title: Response Type
                type: string
              data:
                additionalProperties: true
                description: Problem detail for authentication errors.
                properties:
                  title:
                    default: Unauthorized
                    title: Title
                    type: string
                  status:
                    default: 401
                    title: Status
                    type: integer
                  detail:
                    default: Authentication required
                    title: Detail
                    type: string
                  instance:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem
                    examples:
                      - https://urlyourequest.com/path?query=value
                    title: Instance
                title: UnauthorizedError
                type: object
            required:
              - data
            title: ErrorResponse
            type: object
    PaymentRequired:
      description: Payment Required
      content:
        application/problem+json:
          schema:
            additionalProperties: false
            description: >-
              Error response wrapper for problem details that can be returned
              directly from FastAPI.
            properties:
              response_type:
                default: ErrorResponse
                description: Always 'ErrorResponse' for error responses
                examples:
                  - ErrorResponse
                title: Response Type
                type: string
              data:
                additionalProperties: true
                description: Problem detail for payment required errors.
                properties:
                  title:
                    default: Payment Required
                    title: Title
                    type: string
                  status:
                    default: 402
                    title: Status
                    type: integer
                  detail:
                    default: Payment required
                    title: Detail
                    type: string
                  instance:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem
                    examples:
                      - https://urlyourequest.com/path?query=value
                    title: Instance
                title: PaymentRequiredError
                type: object
            required:
              - data
            title: ErrorResponse
            type: object
    Forbidden:
      description: Forbidden
      content:
        application/problem+json:
          schema:
            additionalProperties: false
            description: >-
              Error response wrapper for problem details that can be returned
              directly from FastAPI.
            properties:
              response_type:
                default: ErrorResponse
                description: Always 'ErrorResponse' for error responses
                examples:
                  - ErrorResponse
                title: Response Type
                type: string
              data:
                additionalProperties: true
                description: Problem detail for authorization errors.
                properties:
                  title:
                    default: Forbidden
                    title: Title
                    type: string
                  status:
                    default: 403
                    title: Status
                    type: integer
                  detail:
                    default: Access forbidden
                    title: Detail
                    type: string
                  instance:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem
                    examples:
                      - https://urlyourequest.com/path?query=value
                    title: Instance
                title: ForbiddenError
                type: object
            required:
              - data
            title: ErrorResponse
            type: object
    NotFound:
      description: Not Found
      content:
        application/problem+json:
          schema:
            additionalProperties: false
            description: >-
              Error response wrapper for problem details that can be returned
              directly from FastAPI.
            properties:
              response_type:
                default: ErrorResponse
                description: Always 'ErrorResponse' for error responses
                examples:
                  - ErrorResponse
                title: Response Type
                type: string
              data:
                additionalProperties: true
                description: Problem detail for resource not found errors.
                properties:
                  title:
                    default: Not Found
                    title: Title
                    type: string
                  status:
                    default: 404
                    title: Status
                    type: integer
                  detail:
                    default: Resource not found
                    title: Detail
                    type: string
                  instance:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem
                    examples:
                      - https://urlyourequest.com/path?query=value
                    title: Instance
                title: NotFoundError
                type: object
            required:
              - data
            title: ErrorResponse
            type: object
    InternalServerError:
      description: Internal Server Error
      content:
        application/problem+json:
          schema:
            additionalProperties: false
            description: >-
              Error response wrapper for problem details that can be returned
              directly from FastAPI.
            properties:
              response_type:
                default: ErrorResponse
                description: Always 'ErrorResponse' for error responses
                examples:
                  - ErrorResponse
                title: Response Type
                type: string
              data:
                additionalProperties: true
                description: Problem detail for internal server errors.
                properties:
                  title:
                    default: Internal Server Error
                    title: Title
                    type: string
                  status:
                    default: 500
                    title: Status
                    type: integer
                  detail:
                    default: Internal server error
                    title: Detail
                    type: string
                  instance:
                    anyOf:
                      - type: string
                      - type: 'null'
                    default: null
                    description: >-
                      A URI reference that identifies the specific occurrence of
                      the problem
                    examples:
                      - https://urlyourequest.com/path?query=value
                    title: Instance
                title: InternalServerError
                type: object
            required:
              - data
            title: ErrorResponse
            type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'API Key for external integrations (format: greetincs_...)'

````