---
agentTools:
  projectIndex: https://developer-docs.gomotive.com/llms.txt
---

# Update the status of a document (v2)

**Purpose**: Use this API to update the status of a document upload to the Amazon S3 bucket. This endpoint is mostly used for updating the status of the dispatching documents. After you send the dispatch document, you must use the `upload_url` and upload the document in the S3 bucket.

After you upload the document, you must mark the same document as `completed`.

## Response Parameters

### Document

* **Type**: Object
* **Description**: Contains details of the document.

***

### id

* **Type**: Integer
* **Description**: The unique identifier for the document.

### category

* **Type**: String
* **Description**: The category of the document, e.g., "notes".

### ref\_no

* **Type**: String
* **Description**: The reference number associated with the document.

### notes

* **Type**: String
* **Description**: Notes associated with the document.

### doc\_date

* **Type**: Date (YYYY-MM-DD)
* **Description**: The date associated with the document.

### doc\_fields

* **Type**: Object
* **Description**: The fields associated with the document.

### notes

* **Type**: String
* **Description**: Notes content in the document fields.

### doc\_time

* **Type**: DateTime (ISO 8601)
* **Description**: The time associated with the document.

### uploader

* **Type**: Object
* **Description**: The user who uploaded the document.

### id

* **Type**: Integer
* **Description**: The unique identifier for the user who uploaded the document.

### first\_name

* **Type**: String
* **Description**: The first name of the user who uploaded the document.

### last\_name

* **Type**: String
* **Description**: The last name of the user who uploaded the document.

### email

* **Type**: String
* **Description**: The email address of the user who uploaded the document.

### role

* **Type**: String
* **Description**: The role of the user who uploaded the document, e.g., "dispatcher".

### deactivated\_at

* **Type**: DateTime
* **Description**: The timestamp when the uploader was deactivated.

### driver\_company\_id

* **Type**: Integer
* **Description**: The unique identifier for the driver's company.

### attachments

* **Type**: Array of Objects
* **Description**: A list of attachments associated with the document.

### id

* **Type**: Integer
* **Description**: The unique identifier for the attachment.

### name

* **Type**: String
* **Description**: The name of the attachment.

### upload\_url

* **Type**: String
* **Description**: The URL to upload the document.

### doc\_type

* **Type**: String
* **Description**: The type of the document, e.g., "jpeg".

### offline\_id

* **Type**: String
* **Description**: The offline identifier for the attachment.

### field\_docs

* **Type**: String
* **Description**: Any additional documents fields, if applicable.

### created\_at

* **Type**: DateTime
* **Description**: The timestamp when the document was created.

### updated\_at

* **Type**: DateTime
* **Description**: The timestamp when the document was last updated.

***

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Motive",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.gomotive.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v2/documents/{id}": {
      "put": {
        "summary": "Update the status of a document (v2)",
        "description": "",
        "operationId": "update-the-status-of-a-document-copy",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Specify the ID of the document that you want to update.",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "upload_status"
                ],
                "properties": {
                  "upload_status": {
                    "type": "string",
                    "description": "Update the upload status of the document to the Amazon S3. Allowed values are 'Completed' or 'Failed'."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Document status updated": {
                    "value": "{\n  \"document\": {\n    \"id\": 13992548,\n    \"category\": \"notes\",\n    \"ref_no\": \"ref\",\n    \"notes\": \"notes\",\n    \"doc_date\": \"2021-01-01\",\n    \"doc_fields\": {\n      \"notes\": \"notes\"\n    },\n    \"doc_time\": \"2021-10-14T22:30:31Z\",\n    \"uploader\": {\n      \"id\": 1044876,\n      \"first_name\": \"John\",\n      \"last_name\": \"Doe\",\n      \"email\": \"john@keeptruckin.com\",\n      \"role\": \"dispatcher\",\n      \"deactivated_at\": null,\n      \"driver_company_id\": null\n    },\n    \"attachments\": [\n      {\n        \"id\": 13992548,\n        \"name\": \"attach1\",\n        \"upload_url\": \"/path/of/document/url\",\n        \"doc_type\": \"jpeg\",\n        \"offline_id\": null\n      }\n    ],\n    \"field_docs\": null,\n    \"created_at\": \"2021-10-14T22:33:00Z\",\n    \"updated_at\": \"2021-10-14T22:43:59.001248Z\"\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "document": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "example": 13992548,
                          "default": 0
                        },
                        "category": {
                          "type": "string",
                          "example": "notes"
                        },
                        "ref_no": {
                          "type": "string",
                          "example": "ref"
                        },
                        "notes": {
                          "type": "string",
                          "example": "notes"
                        },
                        "doc_date": {
                          "type": "string",
                          "example": "2021-01-01"
                        },
                        "doc_fields": {
                          "type": "object",
                          "properties": {
                            "notes": {
                              "type": "string",
                              "example": "notes"
                            }
                          }
                        },
                        "doc_time": {
                          "type": "string",
                          "example": "2021-10-14T22:30:31Z"
                        },
                        "uploader": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer",
                              "example": 1044876,
                              "default": 0
                            },
                            "first_name": {
                              "type": "string",
                              "example": "John"
                            },
                            "last_name": {
                              "type": "string",
                              "example": "Doe"
                            },
                            "email": {
                              "type": "string",
                              "example": "john@keeptruckin.com"
                            },
                            "role": {
                              "type": "string",
                              "example": "dispatcher"
                            },
                            "deactivated_at": {},
                            "driver_company_id": {}
                          }
                        },
                        "attachments": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "example": 13992548,
                                "default": 0
                              },
                              "name": {
                                "type": "string",
                                "example": "attach1"
                              },
                              "upload_url": {
                                "type": "string",
                                "example": "/path/of/document/url"
                              },
                              "doc_type": {
                                "type": "string",
                                "example": "jpeg"
                              },
                              "offline_id": {}
                            }
                          }
                        },
                        "field_docs": {},
                        "created_at": {
                          "type": "string",
                          "example": "2021-10-14T22:33:00Z"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2021-10-14T22:43:59.001248Z"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Could not update": {
                    "value": "{\n  \"error_message\": \"document could not be updated\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error_message": {
                      "type": "string",
                      "example": "document could not be updated"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "403",
            "content": {
              "application/json": {
                "examples": {
                  "Invalid API Key": {
                    "value": "{\n  \"error_message\": \"invalid API key\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error_message": {
                      "type": "string",
                      "example": "invalid API key"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "examples": {
                  "Document not found": {
                    "value": "{\n  \"error_message\": \"document not found\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error_message": {
                      "type": "string",
                      "example": "document not found"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "66acf64a829e88001980fbf2:66d607d314782b0018d66f03"
}
```