# Upsert Audit Timelines

Endpoint: PUT /{auditId}/timelines/stages/upsert
Version: 1.0
Security: oauth2

## Path parameters:

  - `auditId` (string, required)
    Unique ID of the audit.

## Request fields (application/json):

  - `id` (string)
    The unique identifier of the timeline stage

  - `name` (string)
    Name of the timeline stage
    Example: "Onsite Visit"

  - `startDate` (string,null)
    The date the stage begins (ISO-8601 format)
    Example: "2023-09-13T12:00:00Z"

  - `endDate` (string)
    The date the stage ends (ISO-8601 format)
    Example: "2023-09-15T12:00:00Z"

  - `stage` (string)
    Enum: "preparation", "evidenceCollection", "onsiteVisit", "testing", "remediation", "reporting", "custom"

  - `sortOrder` (integer)
    Position of the stage in the timeline
    Example: 3

  - `status` (string)
    The status of the object.
    Enum: "active", "archived", "pending", "canceled", "deleted", "closed"

## Response 200 fields (application/json):

  - `id` (string, required)
    The unique identifier for the timeline stage
    Example: "a3f89b48-9ae1-4852-a229-c4aea92230b0"

  - `orgId` (string, required)
    The unique identifier of the organization the audit belongs to
    Example: "ce83e3cd-5199-11ee-a644-522476618ae8"

  - `status` (string, required)
    The status of the object.
    Enum: same as `status` (6 values)

  - `createdBy` (string, required)
    The unique identifier of the user who created the timeline stage
    Example: "82d7c228-8bcd-11e9-a94b-ab3de8494987"

  - `createdOn` (string, required)
    The date the timeline stage was created (ISO-8601 format)
    Example: "2023-09-12T18:26:10.005365Z"

  - `updatedBy` (string, required)
    The unique identifier of the user who last updated the timeline stage
    Example: "82d7c228-8bcd-11e9-a94b-ab3de8494987"

  - `updatedOn` (string, required)
    The date the timeline stage was last updated (ISO-8601 format)
    Example: "2023-09-12T18:26:10.005365Z"

  - `name` (string, required)
    Name of the timeline stage
    Example: "Onsite Visit"

  - `startDate` (string,null)
    The date the stage begins (ISO-8601 format)
    Example: "2023-09-13T12:00:00Z"

  - `endDate` (string, required)
    The date the stage ends (ISO-8601 format)
    Example: "2023-09-15T12:00:00Z"

  - `stage` (string, required)
    Enum: same as `stage` (7 values)

  - `sortOrder` (integer, required)
    Position of the stage in the timeline
    Example: 3

  - `auditId` (string, required)
    The unique identifier of the audit the timeline stage belongs to
    Example: "16d22ded-88ac-4f5c-bc99-8064d9fc44d7"


## Response 400 fields

## Response 401 fields

## Response 403 fields
