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

# Update a project



## OpenAPI

````yaml /api-reference/openapi.yaml put /project/{projectId}
openapi: 3.0.3
info:
  title: Gapstack API
  version: '1.0'
  description: >-
    REST API for Gapstack tenants, projects, environments, resources, and
    integrations.
servers:
  - url: https://9nr7sbhimh.execute-api.us-west-1.amazonaws.com/prod
    description: Production
security:
  - BearerAuth: []
tags:
  - name: healthcheck
    description: Service health
  - name: tenants
    description: Tenants, members, infrastructure, and API keys
  - name: invitations
    description: Tenant invitations
  - name: projects
    description: Projects, variables, webhooks, and integrations
  - name: environments
    description: Environments, deploys, artifacts, and variables
  - name: resources
    description: Cloud resources
  - name: workflows
    description: Deployment and infrastructure workflows
  - name: aws-accounts
    description: Linked AWS accounts
  - name: integrations
    description: Marketplace integrations
  - name: github
    description: GitHub App install and webhooks
  - name: costs
    description: Aggregated cloud costs
  - name: summary
    description: Tenant dashboard summary
  - name: subscription
    description: Plans, usage, and billing webhooks
  - name: settings
    description: System settings, permissions, and superadmins
paths:
  /project/{projectId}:
    put:
      tags:
        - projects
      summary: Update a project
      operationId: updateProject
      parameters:
        - $ref: '#/components/parameters/TenantId'
        - $ref: '#/components/parameters/ProjectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectUpdate'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectDetails'
        '400':
          description: Bad request, validation failure, or applicable mapped 4xx errors.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Authenticated but not allowed (e.g. subscription limits).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict (e.g. duplicate or already exists).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  parameters:
    TenantId:
      name: Tenant-Id
      in: header
      required: true
      schema:
        type: string
      description: ID of the tenant (current tenant context).
    ProjectId:
      name: projectId
      in: path
      required: true
      schema:
        type: string
      description: Project identifier.
  schemas:
    ProjectUpdate:
      type: object
      description: Payload to update an existing project.
      required:
        - aws_account_id
        - aws_region
        - id
        - max_budget
        - name
        - status
      properties:
        id:
          type: string
          example: Project_00000000
        name:
          type: string
          example: Project Name
        description:
          type: string
          example: Project Description
        aws_account_id:
          type: string
          example: '123123123123'
        aws_region:
          $ref: '#/components/schemas/AwsRegion'
        max_budget:
          type: integer
          minimum: 0
          example: 1000
        notify_when_forecast_cost_exceed:
          type: boolean
          example: true
        notify_when_actual_cost_exceed:
          type: boolean
          example: true
        notify_email:
          type: string
          nullable: true
          description: >-
            May be omitted, null, or empty; when notify_when_actual_cost_exceed
            is true, a non-empty valid email is required (validated by the API).
          example: test@example.com
        domain:
          type: string
          example: example.com
        status:
          $ref: '#/components/schemas/ProjectStatus'
    ProjectDetails:
      type: object
      description: >-
        Full project representation returned by the API (includes relations and
        cost summary).
      properties:
        id:
          type: string
          description: Primary key (project id).
          x-go-name: Pk
        sk:
          type: string
          description: Sort key.
        type:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        name:
          type: string
        description:
          type: string
        aws_account_id:
          type: string
          description: Linked AWS account id (12 digits).
        aws_region:
          $ref: '#/components/schemas/AwsRegion'
        max_budget:
          type: integer
          description: Maximum budget threshold for notifications.
        notify_when_forecast_cost_exceed:
          type: boolean
        notify_when_actual_cost_exceed:
          type: boolean
        domain:
          type: string
        cost:
          type: integer
          description: Current or last reported cost (application-defined units).
        webhooks:
          type: array
          items:
            $ref: '#/components/schemas/Webhook'
        env_variables:
          type: array
          items:
            $ref: '#/components/schemas/EnvVariable'
        integrations:
          type: array
          items:
            $ref: '#/components/schemas/Integration'
        status:
          $ref: '#/components/schemas/ProjectStatus'
        notify_email:
          type: string
          nullable: true
          description: Notification email; may be null or empty when unset.
        month_cost:
          $ref: '#/components/schemas/MonthCostDetails'
          nullable: true
        cost_exceeded:
          type: boolean
          description: True when cost has exceeded configured thresholds.
    ErrorResponse:
      type: object
      description: >
        JSON body returned by WriteJsonError (internal/app/util.go
        errorResponse).

        Field `error` carries the human-readable message; `code` is set for
        Gapstack errors.
      properties:
        code:
          description: >
            Machine-readable code from paas-lib when the error is a
            GapstackError; omitted when not.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/PaasLibErrorCode'
        error:
          type: string
          description: Human-readable error message (JSON key `error`, not `message`).
        meta:
          type: object
          additionalProperties:
            type: string
          description: Optional metadata (e.g. validation field names).
    AwsRegion:
      type: string
      description: AWS region identifier. Matches models.AwsRegion JSON values in paas-lib.
      example: us-east-1
      enum:
        - us-east-1
        - us-east-2
        - us-west-1
        - us-west-2
        - us-gov-east-1
        - us-gov-west-1
        - ca-central-1
        - ca-west-1
        - eu-central-1
        - eu-central-2
        - eu-north-1
        - eu-west-1
        - eu-west-2
        - eu-west-3
        - eu-south-1
        - eu-south-2
        - me-south-1
        - me-central-1
        - mx-central-1
        - cn-north-1
        - cn-northwest-1
        - ap-east-1
        - ap-south-1
        - ap-south-2
        - ap-northeast-1
        - ap-northeast-2
        - ap-northeast-3
        - ap-southeast-1
        - ap-southeast-2
        - ap-southeast-3
        - ap-southeast-4
        - ap-southeast-5
        - ap-east-2
        - ap-southeast-7
        - ap-southeast-6
        - af-south-1
        - sa-east-1
      x-enum-varnames:
        - AwsRegionUsEast1
        - AwsRegionUsEast2
        - AwsRegionUsWest1
        - AwsRegionUsWest2
        - AwsRegionUsGovEast1
        - AwsRegionUsGovWest1
        - AwsRegionCaCentral1
        - AwsRegionCaWest1
        - AwsRegionEuCentral1
        - AwsRegionEuCentral2
        - AwsRegionEuNorth1
        - AwsRegionEuWest1
        - AwsRegionEuWest2
        - AwsRegionEuWest3
        - AwsRegionEuSouth1
        - AwsRegionEuSouth2
        - AwsRegionMeSouth1
        - AwsRegionMeCentral1
        - AwsRegionMxCentral1
        - AwsRegionCnNorth1
        - AwsRegionCnNorthwest1
        - AwsRegionApEast1
        - AwsRegionApSouth1
        - AwsRegionApSouth2
        - AwsRegionApNortheast1
        - AwsRegionApNortheast2
        - AwsRegionApNortheast3
        - AwsRegionApSoutheast1
        - AwsRegionApSoutheast2
        - AwsRegionApSoutheast3
        - AwsRegionApSoutheast4
        - AwsRegionApSoutheast5
        - AwsRegionApEast2
        - AwsRegionApSoutheast7
        - AwsRegionApSoutheast6
        - AwsRegionAfSouth1
        - AwsRegionSaEast1
    ProjectStatus:
      type: string
      description: Lifecycle status of the project.
      enum:
        - ALPHA
        - BETA
        - RELEASE
    Webhook:
      type: object
      description: Project webhook subscription.
      properties:
        id:
          type: string
        events:
          type: array
          items:
            type: string
        endpoint:
          type: string
          format: uri
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    EnvVariable:
      type: object
      description: Environment variable at project or environment scope.
      required:
        - id
        - name
        - value
      properties:
        id:
          type: string
        name:
          type: string
        value:
          type: string
        sensitive:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        actor:
          type: string
          description: Email or identifier of the user who last changed the variable.
    Integration:
      type: object
      description: Integration attached to a project (marketplace metadata + env vars).
      required:
        - category
        - company
        - description
        - instructions
        - name
        - overview
        - website_url
      properties:
        id:
          type: string
          x-go-name: Pk
        sk:
          type: string
        type:
          type: string
        created_at:
          type: string
          format: date-time
        name:
          type: string
        description:
          type: string
        overview:
          type: string
        instructions:
          type: string
        is_free:
          type: boolean
        category:
          $ref: '#/components/schemas/IntegrationCategory'
        website_url:
          type: string
          format: uri
        doc:
          type: string
        support_url:
          type: string
        company:
          type: string
        privacy_policy_url:
          type: string
        icon:
          type: string
          format: uri
        is_active:
          type: boolean
        env_variables:
          type: array
          items:
            $ref: '#/components/schemas/IntegrationEnvVariable'
    MonthCostDetails:
      type: object
      description: Aggregated cost summary for a billing period.
      properties:
        cost:
          type: number
          format: double
        cost_unit:
          type: string
          description: Currency or unit for cost values (e.g. USD).
        max_day_cost:
          type: number
          format: double
        min_day_cost:
          type: number
          format: double
        average_day_cost:
          type: number
          format: double
    PaasLibErrorCode:
      type: string
      description: >
        Machine-readable code from paas-lib (errors.Code). Matches
        github.com/gapai-io/paas-lib/pkg/errors.Code.
      enum:
        - common.internal_error
        - common.unavailable
        - common.timeout
        - common.conflict
        - common.not_implemented
        - validation.invalid
        - validation.required
        - auth.unauthorized
        - auth.forbidden
        - storage.not_found
        - storage.already_exists
        - storage.db_error
        - storage.constraint_violation
        - service.invalid_state
        - service.rule_violation
        - service.aborted
        - external.error
        - external.timeout
        - external.bad_response
        - stack.manual_deletion
        - subscription.invalid_state
        - subscription.rule_violation
        - subscription.canceled
        - subscription.not_found
        - subscription.limit_reached
      x-enum-varnames:
        - ErrInternalErrorCode
        - ErrUnavailableErrorCode
        - ErrTimeoutErrorCode
        - ErrConflictErrorCode
        - ErrNotImplementedErrorCode
        - ErrValidationInvalidCode
        - ErrValidationRequiredCode
        - ErrUnauthorizedCode
        - ErrForbiddenCode
        - ErrRepoNotFoundErrorCode
        - ErrRepoAlreadyExistsErrorCode
        - ErrRepoDBErrorCode
        - ErrRepoConstraintViolationErrorCode
        - ErrInvalidStateCode
        - ErrBusinessRuleCode
        - ErrOperationAbortCode
        - ErrExternalErrorCode
        - ErrExternalTimeoutCode
        - ErrExternalBadRespCode
        - ErrStackManualDeletionCode
        - ErrSubscriptionInvalidStateCode
        - ErrSubscriptionBusinessRuleCode
        - ErrSubscriptionCanceledCode
        - ErrSubscriptionNotFoundCode
        - ErrSubscriptionLimitReachedCode
    IntegrationCategory:
      type: string
      description: Integration marketplace category.
      enum:
        - PAYMENT
        - CRM
        - MARKETING
        - ACCOUNTING
        - OTHER
      x-enum-varnames:
        - Payment
        - CRM
        - Marketing
        - Accounting
        - Other
    IntegrationEnvVariable:
      type: object
      description: Environment variable stored on a project integration.
      required:
        - name
        - value
      properties:
        id:
          type: string
        name:
          type: string
        value:
          type: string
        sensitive:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        actor:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token in the Authorization header (e.g. JWT / Cognito access
        token).
    ApiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: API key in the X-Api-Key header.

````