---
updatedAt: 2025-09-10T20:59:55.000Z
agentTools:
  projectIndex: https://shipcars.readme.io/llms.txt
---

# /trips/{id}/

Updates an identified trip with the most recent information. All properties of the trip are sent to be updated and swapped with newer ones.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "CTMS",
    "description": "Ship.Cars CTMS",
    "contact": {
      "url": "https://ship.cars",
      "email": "support@ship.cars"
    },
    "version": "1.0.0"
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "oauth2",
        "flows": {
          "password": {
            "tokenUrl": "https://auth.ship.cars/auth/realms/master/protocol/openid-connect/token",
            "scopes": {}
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://ship.cars/api"
    }
  ],
  "paths": {
    "/trips/{id}/": {
      "put": {
        "tags": [
          "Trips"
        ],
        "description": "Updates an identified trip with the most recent information. All properties of the trip are sent to be updated and swapped with newer ones.",
        "operationId": "trip_update",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "description": "Authenticates API requests with a valid access token.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Unique ID of the trip.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "driver_id": {
                    "type": "string",
                    "description": "Internal ID of the driver assigned to the trip. Trips can still exist without a driver.",
                    "format": "uri"
                  },
                  "driver": {
                    "type": "string",
                    "description": "Url form of the driver."
                  },
                  "update_time": {
                    "type": "string",
                    "description": "Last time the trip was updated.",
                    "format": "date-time"
                  },
                  "create_time": {
                    "type": "string",
                    "description": "Time the trip was created.",
                    "format": "date-time"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name of the trip. The only condition needed to create a trip."
                  },
                  "status": {
                    "type": "string",
                    "description": "Status of the trip; Active – The trip is active. Archived – The trip is finished but kept in the history log of trips.",
                    "enum": [
                      "active",
                      "archived"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "description": "Internal ID of the trip."
                  },
                  "url": {
                    "type": "string",
                    "description": "Url form of the trip."
                  },
                  "loads": {
                    "type": "array",
                    "description": "Represents loads that are grouped in the trip. Can be added once the trip is named. However, trips can still exist without loads. Internal ID of the load in the trip.",
                    "items": {
                      "required": [
                        "id"
                      ],
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Internal ID of the load"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "driver_id": {
                      "type": "string",
                      "description": "Internal ID of the driver assigned to the trip. Trips can still exist without a driver.",
                      "format": "uri",
                      "readOnly": true
                    },
                    "driver": {
                      "type": "string",
                      "description": "Url form of the driver.",
                      "readOnly": true
                    },
                    "update_time": {
                      "type": "string",
                      "description": "Last time the trip was updated.",
                      "format": "date-time",
                      "readOnly": true
                    },
                    "create_time": {
                      "type": "string",
                      "description": "Time the trip was created.",
                      "format": "date-time",
                      "readOnly": true
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the trip. The only condition needed to create a trip."
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the trip; Active – The trip is active. Archived – The trip is finished but kept in the history log of trips.",
                      "enum": [
                        "active",
                        "archived"
                      ]
                    },
                    "id": {
                      "type": "string",
                      "description": "Internal ID of the trip.",
                      "readOnly": true
                    },
                    "url": {
                      "type": "string",
                      "description": "Url form of the trip.",
                      "readOnly": true
                    },
                    "loads": {
                      "type": "array",
                      "description": "Represents loads that are grouped in the trip. Can be added once the trip is named. However, trips can still exist without loads. Internal ID of the load in the trip.",
                      "items": {
                        "required": [
                          "id"
                        ],
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Internal ID of the load"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "driver_id": "je45",
                  "driver": "https://ship.cars/api/users/je45/",
                  "update_time": "2021-04-15T14:25:48.249Z",
                  "create_time": "2021-04-15T14:25:36.275Z",
                  "name": "Trip (04.15.2021)",
                  "status": "active",
                  "loads": [
                    {
                      "id": "dsa3f3"
                    },
                    {
                      "id": "sd3ds3"
                    }
                  ],
                  "id": "jkw2",
                  "url": "https://ship.cars/api/trips/jkw2/"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "Message giving details about the reason for the error response."
                    }
                  }
                },
                "example": {
                  "detail": "JSON parse error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "Message giving details about the reason for the error response."
                    }
                  }
                },
                "example": {
                  "detail": "Authentication credentials were not provided."
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "Message giving details about the reason for the error response."
                    }
                  }
                },
                "example": {
                  "detail": "You do not have permission to perform this action."
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "description": "Message giving details about the reason for the error response."
                    }
                  }
                },
                "example": {
                  "detail": "Not found."
                }
              }
            }
          }
        },
        "x-code-samples": [
          {
            "lang": "cURL",
            "source": "curl --request PUT \\\n--url 'https://ship.cars/api/trips/dev4v/' \\\n--header 'Authorization: Bearer <<USER_ACCESS_TOKEN>>' \\\n--header 'Content-Type: application/json' \\\n--data '{\"driver_id\": \"je45\", \"driver\": \"https://ship.cars/api/users/je45/\", \"update_time\": \"2021-04-15T09:25:48.249944-05:00\", \"create_time\": \"2021-04-15T09:25:36.275188-05:00\",\"name\": \"Trip (04.15.2021)\",\"status\": \"active\",\"loads\": [{\"id\": \"dsa3f3\"},{\"id\": \"sd3ds3\"}],\"id\": \"jkw2\",\"url\": \"https://ship.cars/api/trips/jkw2/\"}'\n"
          }
        ],
        "x-codegen-request-body-name": "data",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```