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

# Updates a project. Send only the fields you want to change.

> An omitted field is left alone; re-sending a value the project already holds is a no-op
rather than an error, and records no activity. Sending nothing at all is a 400.
            
Lists replace outright: send an empty array to clear one. `LeadAssigneeId: 0`
removes the lead, and `ClearTargetDate: true` removes the target date.
            
`ClosedOn` backdates the close of a project being migrated from another system, and
also becomes its `UpdatedOn`. It is only accepted for a project that is Closed -
already, or by this same request - and never for a future date or one before the project
was created. Omit it and closing a project stamps the time of the change; reopening a
Closed project clears it. Completed is reached automatically and carries no date.
            
Two field pairings are enforced because the data requires them: moving the project to a
different `ClientId` needs a `LocationId` in that client and **clears the
shared contacts**, and a technician cannot be both the lead and a watcher.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/projects/{projectId}
openapi: 3.0.4
info:
  title: Public API
  description: Gorelo Public API documentation.
  version: 1.0.0
servers:
  - url: https://api.usw.gorelo.io
    description: US
  - url: https://api.aue.gorelo.io
    description: Australia
security:
  - ApiKeyAuth: []
tags:
  - name: Attachments
    description: "Uploading a file, for anything that can carry one. One endpoint rather than one per record\r\ntype, because the upload itself is identical - only the record it is checked against differs."
  - name: Alerts
    description: Alerts management operations
  - name: Assets
    description: Assets management operations
  - name: Billing
    description: Billing management operations
  - name: Tickets
    description: Tickets management operations
  - name: Clients
    description: Clients management operations
  - name: Contacts
    description: Contacts management operations
  - name: Deletions
    description: Deletions management operations
  - name: Documents
    description: Documents management operations
  - name: Forms
    description: Forms management operations
  - name: Organization
    description: Organization management operations
  - name: Projects
    description: Projects management operations
paths:
  /v1/projects/{projectId}:
    patch:
      tags:
        - Projects
      summary: Updates a project. Send only the fields you want to change.
      description: "An omitted field is left alone; re-sending a value the project already holds is a no-op\r\nrather than an error, and records no activity. Sending nothing at all is a 400.\r\n            \r\nLists replace outright: send an empty array to clear one. `LeadAssigneeId: 0`\r\nremoves the lead, and `ClearTargetDate: true` removes the target date.\r\n            \r\n`ClosedOn` backdates the close of a project being migrated from another system, and\r\nalso becomes its `UpdatedOn`. It is only accepted for a project that is Closed -\r\nalready, or by this same request - and never for a future date or one before the project\r\nwas created. Omit it and closing a project stamps the time of the change; reopening a\r\nClosed project clears it. Completed is reached automatically and carries no date.\r\n            \r\nTwo field pairings are enforced because the data requires them: moving the project to a\r\ndifferent `ClientId` needs a `LocationId` in that client and **clears the\r\nshared contacts**, and a technician cannot be both the lead and a watcher."
      operationId: patch_v1_projects_projectId
      parameters:
        - name: projectId
          in: path
          description: Project to update.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Fields to change.
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/UpdateProjectCommand'
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProjectCommand'
          text/json:
            schema:
              $ref: '#/components/schemas/UpdateProjectCommand'
          application/*+json:
            schema:
              $ref: '#/components/schemas/UpdateProjectCommand'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/UpdateProjectResultBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateProjectResultBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/UpdateProjectResultBaseResponse'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
        '500':
          description: Internal Server Error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
components:
  schemas:
    UpdateProjectCommand:
      type: object
      properties:
        Title:
          type: string
          description: New project title.
          nullable: true
        Description:
          type: string
          description: New description. Send an empty string to remove it.
          nullable: true
        ClientId:
          type: integer
          description: "Move the project to a different client. **Clears the shared contacts**, because a contact\r\nbelongs to the client it came from - the app does the same.\r\nSend `LocationId` with it: a location belongs to a client."
          format: int64
          nullable: true
        LocationId:
          type: integer
          description: New client location.
          format: int64
          nullable: true
        SharedWithContactIds:
          type: array
          items:
            type: integer
            format: int64
          description: >-
            Replaces the contacts the project is shared with. Empty array clears
            them.
          nullable: true
        TypeId:
          type: string
          description: New project type.
          format: uuid
          nullable: true
        TagIds:
          type: array
          items:
            type: string
            format: uuid
          description: Replaces the tags. Empty array clears them.
          nullable: true
        LeadAssigneeId:
          type: integer
          description: New lead assignee. Send 0 to remove the lead.
          format: int64
          nullable: true
        WatcherIds:
          type: array
          items:
            type: integer
            format: int64
          description: Replaces the watchers. Empty array clears them.
          nullable: true
        GroupIds:
          type: array
          items:
            type: integer
            format: int64
          description: Replaces the technician groups the project belongs to.
          nullable: true
        TargetDate:
          type: string
          description: New target date (UTC). To remove it, send `ClearTargetDate`.
          format: date-time
          nullable: true
        ClearTargetDate:
          type: boolean
          description: Set true to remove the due date.
          nullable: true
        StatusId:
          type: integer
          description: "New status: 1 Not started, 2 In progress, 3 On hold, 4 Completed, 5 Closed. Completed is\r\nnormally reached automatically once every task is Done; Closed is the manual end state\r\nand stamps `ClosedOn`. Moving a Closed project to any other status clears it."
          format: int64
          nullable: true
        StatusReason:
          type: string
          description: >-
            Free-text reason recorded with the status. Only read when `StatusId`
            is sent.
          nullable: true
        ClosedOn:
          type: string
          description: "The date the project was closed (UTC), for recording the real close date of a project\r\nmigrated from another system. The project must already be Closed, or be moved into that\r\nstatus by this same request. Must not be in the future or earlier than the project's\r\n`CreatedOn`. A supplied date also becomes the project's `UpdatedOn`. Omit it to\r\nleave the date untouched - closing a project normally stamps it with the time of the change."
          format: date-time
          nullable: true
        UpdatedByName:
          type: string
          description: "Display name to record as the actor. An API key is not a person, so when it is\r\nomitted or blank the actor is recorded as `API`."
          nullable: true
      additionalProperties: false
      description: "Request body for updating a project. Every field is optional - send only what you want to\r\nchange. An omitted field leaves the stored value alone; sending nothing at all is a 400."
    UpdateProjectResultBaseResponse:
      type: object
      properties:
        StatusCode:
          $ref: '#/components/schemas/HttpStatusCode'
        IsSuccess:
          type: boolean
        Data:
          $ref: '#/components/schemas/UpdateProjectResult'
        DataContext:
          type: object
          additionalProperties: false
          nullable: true
          example: null
        Notifications:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      additionalProperties: false
    ObjectBaseResponse:
      type: object
      properties:
        StatusCode:
          $ref: '#/components/schemas/HttpStatusCode'
        IsSuccess:
          type: boolean
        Data:
          nullable: true
        DataContext:
          $ref: '#/components/schemas/ErrorDataContext'
        Notifications:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      additionalProperties: false
    HttpStatusCode:
      enum:
        - 100
        - 101
        - 102
        - 103
        - 200
        - 201
        - 202
        - 203
        - 204
        - 205
        - 206
        - 207
        - 208
        - 226
        - 300
        - 301
        - 302
        - 303
        - 304
        - 305
        - 306
        - 307
        - 308
        - 400
        - 401
        - 402
        - 403
        - 404
        - 405
        - 406
        - 407
        - 408
        - 409
        - 410
        - 411
        - 412
        - 413
        - 414
        - 415
        - 416
        - 417
        - 421
        - 422
        - 423
        - 424
        - 426
        - 428
        - 429
        - 431
        - 451
        - 500
        - 501
        - 502
        - 503
        - 504
        - 505
        - 506
        - 507
        - 508
        - 510
        - 511
      type: integer
      format: int32
    UpdateProjectResult:
      type: object
      properties:
        Id:
          type: string
          description: Identifier of the updated project.
          format: uuid
      additionalProperties: false
      description: The identifier of the updated project.
    Error:
      type: object
      properties:
        Code:
          pattern: ^[0-9]{6}$
          type: string
          description: 6-digit MMTTNN error code. See the Public API error-code registry.
          example: '070101'
        Message:
          type: string
        PropertyName:
          type: string
          nullable: true
        ActionHint:
          type: string
          nullable: true
        DocUrl:
          type: string
          nullable: true
      additionalProperties: false
    ErrorDataContext:
      type: object
      properties:
        TraceId:
          type: string
          description: Request correlation id. Quote this when reporting a problem.
          nullable: true
      additionalProperties: false
      description: "The `DataContext` of an error response: carries the correlation id for the failed\r\nrequest."
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: >-
        Your Gorelo API key. See [Generate API key](/generate-api-key). If your
        data is hosted in Australia, click the base URL at the top of this page
        and select `https://api.aue.gorelo.io`.
      name: X-API-Key
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.