{
  "opencollection": "1.0.0",
  "info": {
    "name": "Samsara Assignments API",
    "version": "2024-11-18"
  },
  "request": {
    "auth": {
      "type": "bearer",
      "token": "{{bearerToken}}"
    }
  },
  "items": [
    {
      "info": {
        "name": "Assignments",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Get Driver Coach Assignments.",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.samsara.com/coaching/driver-coach-assignments",
            "params": [
              {
                "name": "driverIds",
                "value": "",
                "type": "query",
                "description": "Optional string of comma separated IDs of the drivers. This can be either a unique Samsara driver ID or an external ID for the driver."
              },
              {
                "name": "coachIds",
                "value": "",
                "type": "query",
                "description": "Optional string of comma separated IDs of the coaches."
              },
              {
                "name": "includeExternalIds",
                "value": "",
                "type": "query",
                "description": "Optional boolean indicating whether to return external IDs on supported entities"
              },
              {
                "name": "after",
                "value": "",
                "type": "query",
                "description": " If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results."
              }
            ]
          },
          "docs": "This endpoint will return coach assignments for your organization based on the parameters passed in. Results are paginated.\n\n <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href=\"https://developers.samsara.com/docs/rate-limits\" target=\"_blank\">here</a>).\n\nTo use this endpoint, select **Read Coaching** under the Coaching category when creating or editing an API token. <a href=\"https://developers.samsara.com/docs/authentication#scopes-for-api-tokens\" target=\"_blank\">Learn More"
        },
        {
          "info": {
            "name": "Put Driver Coach Assignments.",
            "type": "http"
          },
          "http": {
            "method": "PUT",
            "url": "https://api.samsara.com/coaching/driver-coach-assignments",
            "params": [
              {
                "name": "driverId",
                "value": "",
                "type": "query",
                "description": "Required string ID of the driver. This is a unique Samsara ID of a driver."
              },
              {
                "name": "coachId",
                "value": "",
                "type": "query",
                "description": "Optional string ID of the coach. This is a unique Samsara user ID. If not provided, existing coach assignment will be removed."
              }
            ]
          },
          "docs": "This endpoint will update an existing or create a new coach-to-driver assignment for your organization based on the parameters passed in. This endpoint should only be used for existing Coach to Driver assignments. In order to remove a driver-coach-assignment for a given driver, set coachId to null\n\n <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href=\"https://developers.samsara.com/docs/rate-limits\" target=\"_blank\">here</a>).\n\nTo use this endpoint, select **Write Coaching** "
        },
        {
          "info": {
            "name": "Retrieve Assignments",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.samsara.com/fleet/carrier-proposed-assignments",
            "params": [
              {
                "name": "limit",
                "value": "",
                "type": "query",
                "description": "The limit for how many objects will be in the response. Default and max for this value is 512 objects."
              },
              {
                "name": "after",
                "value": "",
                "type": "query",
                "description": "If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results."
              },
              {
                "name": "driverIds",
                "value": "",
                "type": "query",
                "description": "A filter on the data based on this comma-separated list of driver IDs and externalIds. Example: `driverIds=1234,5678,payroll:4841`"
              },
              {
                "name": "activeTime",
                "value": "",
                "type": "query",
                "description": "If specified, shows assignments that will be active at this time. Defaults to now, which would show current active assignments. In RFC 3339 format. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00)."
              }
            ]
          },
          "docs": "Show the assignments created by the POST fleet/carrier-proposed-assignments. This endpoint will only show the assignments that are active for drivers and currently visible to them in the driver app. Once a proposed assignment has been accepted, the endpoint will not return any data. \n\n **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href=\"https://forms.gle/zkD4NCH7HjKb7mm69\" target=\"_blank\">API feedback form</a>. If you encountered an issue or"
        },
        {
          "info": {
            "name": "Create an Assignment",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.samsara.com/fleet/carrier-proposed-assignments",
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Creates a new assignment that a driver can later use. Each driver can only have one future assignment. \n\n **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href=\"https://forms.gle/zkD4NCH7HjKb7mm69\" target=\"_blank\">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href=\"https://www.samsara.com/help\" target=\"_blank\">submit a case</a> to our support team.\n\nTo use this endpoint, select **"
        },
        {
          "info": {
            "name": "Delete an Assignment",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://api.samsara.com/fleet/carrier-proposed-assignments/:id",
            "params": [
              {
                "name": "id",
                "value": "",
                "type": "path",
                "description": "ID of the assignment."
              }
            ]
          },
          "docs": "Permanently delete an assignment. You can only delete assignments that are not yet active. To override a currently active assignment, create a new empty one, instead. \n\n **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href=\"https://forms.gle/zkD4NCH7HjKb7mm69\" target=\"_blank\">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href=\"https://www.samsara.com/help\" target=\"_blank\">submit "
        },
        {
          "info": {
            "name": "Get All Driver-vehicle Assignments",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.samsara.com/fleet/driver-vehicle-assignments",
            "params": [
              {
                "name": "filterBy",
                "value": "",
                "type": "query",
                "description": "Option to filter by drivers or vehicles.  Valid values: `drivers`, `vehicles`"
              },
              {
                "name": "startTime",
                "value": "",
                "type": "query",
                "description": " A start time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00)."
              },
              {
                "name": "endTime",
                "value": "",
                "type": "query",
                "description": " An end time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00)."
              },
              {
                "name": "driverIds",
                "value": "",
                "type": "query",
                "description": " A filter on the data based on this comma-separated list of driver IDs and externalIds. Example: `driverIds=1234,5678,payroll:4841`"
              },
              {
                "name": "vehicleIds",
                "value": "",
                "type": "query",
                "description": "ID of the vehicle. This can either be the Samsara-specified ID, or an external ID. External IDs are customer specified key-value pairs created in the POST or PATCH requests of this resource. To specify an external ID as part of a path parameter, use the following format: \"key:value\". For example, \"maintenanceId:250020\"."
              },
              {
                "name": "driverTagIds",
                "value": "",
                "type": "query",
                "description": " A filter on the data based on this comma-separated list of driver tag IDs. Example: `tagIds=1234,5678`"
              },
              {
                "name": "vehicleTagIds",
                "value": "",
                "type": "query",
                "description": " A filter on the data based on this comma-separated list of vehicle tag IDs. Example: `tagIds=1234,5678`"
              },
              {
                "name": "after",
                "value": "",
                "type": "query",
                "description": " If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results."
              },
              {
                "name": "assignmentType",
                "value": "",
                "type": "query",
                "description": "Specifies which assignment type to filter by.  Valid values: `HOS`, `idCard`, `static`, `faceId`, `tachograph`, `safetyManual`, `RFID`, `trailer`, `external`, `qrCode`"
              }
            ]
          },
          "docs": "Get all driver-vehicle assignments for the requested drivers or vehicles in the requested time range. To fetch driver-vehicle assignments out of the vehicle trips' time ranges, assignmentType needs to be specified. Note: this endpoint replaces past endpoints to fetch assignments by driver or by vehicle. Visit [this migration guide](https://developers.samsara.com/docs/migrating-from-driver-vehicle-assignment-or-vehicle-driver-assignment-endpoints) for more information.\n\n <b>Rate limit:</b> 5 requ"
        },
        {
          "info": {
            "name": "Create a New Driver-vehicle Assignment",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.samsara.com/fleet/driver-vehicle-assignments",
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Assign vehicle drive-time to a driver via API. For a step-by-step instruction on how to leverage this endpoint, see [this guide](https://developers.samsara.com/docs/creating-driver-vehicle-assignments)\n\n <b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href=\"https://developers.samsara.com/docs/rate-limits\" target=\"_blank\">here</a>).\n\nTo use this endpoint, select **Write Assignments** under the Assignments category when creating or editing an API token. <a href=\"https://develo"
        },
        {
          "info": {
            "name": "Update API Generated Driver-vehicle Assignments",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "https://api.samsara.com/fleet/driver-vehicle-assignments",
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Update driver assignments that were created using the `POST fleet/driver-vehicle-assignments`. Vehicle Id, Driver Id, and Start Time must match an existing assignment.\n\n <b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href=\"https://developers.samsara.com/docs/rate-limits\" target=\"_blank\">here</a>).\n\nTo use this endpoint, select **Write Assignments** under the Assignments category when creating or editing an API token. <a href=\"https://developers.samsara.com/docs/authenticati"
        },
        {
          "info": {
            "name": "Delete API Generated Driver-vehicle Assignments",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://api.samsara.com/fleet/driver-vehicle-assignments",
            "body": {
              "type": "json",
              "data": "{}"
            }
          },
          "docs": "Delete driver assignments that were created using the `POST fleet/driver-vehicle-assignments` endpoint for the requested vehicle in the requested time range.\n\n <b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href=\"https://developers.samsara.com/docs/rate-limits\" target=\"_blank\">here</a>).\n\nTo use this endpoint, select **Write Assignments** under the Assignments category when creating or editing an API token. <a href=\"https://developers.samsara.com/docs/authentication#scopes-"
        },
        {
          "info": {
            "name": "[legacy] Get All Vehicles Assigned to a Set of Drivers",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.samsara.com/fleet/drivers/vehicle-assignments",
            "params": [
              {
                "name": "driverIds",
                "value": "",
                "type": "query",
                "description": " A filter on the data based on this comma-separated list of driver IDs and externalIds. Example: `driverIds=1234,5678,payroll:4841`"
              },
              {
                "name": "startTime",
                "value": "",
                "type": "query",
                "description": " A start time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00). The maximum allowed startTime-endTime range is 7 days."
              },
              {
                "name": "endTime",
                "value": "",
                "type": "query",
                "description": " An end time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00). The maximum allowed startTime-endTime range is 7 days."
              },
              {
                "name": "tagIds",
                "value": "",
                "type": "query",
                "description": " A filter on the data based on this comma-separated list of driver tag IDs. Example: `tagIds=1234,5678`"
              },
              {
                "name": "parentTagIds",
                "value": "",
                "type": "query",
                "description": " A filter on the data based on this comma-separated list of driver parent tag IDs, for use by orgs with tag hierarchies. Specifying a parent tag will implicitly include all descendent tags of the parent tag. Example: `parentTagIds=345,678`"
              },
              {
                "name": "driverActivationStatus",
                "value": "",
                "type": "query",
                "description": "If value is `deactivated`, only drivers that are deactivated will appear in the response. This parameter will default to `active` if not provided (fetching only active drivers).  Valid values: `active`, `deactivated`"
              },
              {
                "name": "after",
                "value": "",
                "type": "query",
                "description": " If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results."
              }
            ]
          },
          "docs": "**Note: This is a legacy endpoint, consider using [this endpoint](https://developers.samsara.com/reference/getdrivervehicleassignments) instead. The endpoint will continue to function as documented.** Get all vehicle assignments for the requested drivers in the requested time range. The only type of assignment supported right now are assignments created through the driver app.\n\n <b>Rate limit:</b> 25 requests/sec (learn more about rate limits <a href=\"https://developers.samsara.com/docs/rate-lim"
        },
        {
          "info": {
            "name": "[legacy] Get All Drivers Assigned to a Set of Vehicles",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.samsara.com/fleet/vehicles/driver-assignments",
            "params": [
              {
                "name": "startTime",
                "value": "",
                "type": "query",
                "description": " A start time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00). The maximum allowed startTime-endTime range is 7 days."
              },
              {
                "name": "endTime",
                "value": "",
                "type": "query",
                "description": " An end time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00). The maximum allowed startTime-endTime range is 7 days."
              },
              {
                "name": "vehicleIds",
                "value": "",
                "type": "query",
                "description": " A filter on the data based on this comma-separated list of vehicle IDs and externalIds. Example: `vehicleIds=1234,5678,samsara.vin:1HGBH41JXMN109186`"
              },
              {
                "name": "tagIds",
                "value": "",
                "type": "query",
                "description": " A filter on the data based on this comma-separated list of tag IDs. Example: `tagIds=1234,5678`"
              },
              {
                "name": "parentTagIds",
                "value": "",
                "type": "query",
                "description": " A filter on the data based on this comma-separated list of parent tag IDs, for use by orgs with tag hierarchies. Specifying a parent tag will implicitly include all descendent tags of the parent tag. Example: `parentTagIds=345,678`"
              },
              {
                "name": "after",
                "value": "",
                "type": "query",
                "description": " If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results."
              }
            ]
          },
          "docs": "**Note: This is a legacy endpoint, consider using [this endpoint](https://developers.samsara.com/reference/getdrivervehicleassignments) instead. The endpoint will continue to function as documented.** Get all driver assignments for the requested vehicles in the requested time range. The only type of assignment supported right now are assignments created through the driver app.\n\n <b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href=\"https://developers.samsara.com/docs/rate-limi"
        },
        {
          "info": {
            "name": "[beta] Create Training Assignments.",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://api.samsara.com/training-assignments",
            "params": [
              {
                "name": "courseId",
                "value": "",
                "type": "query",
                "description": "String for the course ID."
              },
              {
                "name": "dueAtTime",
                "value": "",
                "type": "query",
                "description": "Due date of the training assignment in RFC 3339 format. Millisecond precision and timezones are supported."
              },
              {
                "name": "learnerIds",
                "value": "",
                "type": "query",
                "description": "Optional string of comma separated learner IDs. If learner ID is present, training assignments for the specified learner(s) will be returned. Max value for this value is 100 objects. Example: `learnerIds=driver-281474,driver-46282156`"
              }
            ]
          },
          "docs": "Create training assignments. Existing assignments will remain unchanged. \n\n**Beta:** This endpoint is in beta and is likely to change before being broadly available. Reach out to your Samsara Representative to have Training APIs enabled for your organization.\n\n <b>Rate limit:</b> 10 requests/sec (learn more about rate limits <a href=\"https://developers.samsara.com/docs/rate-limits\" target=\"_blank\">here</a>).\n\nTo use this endpoint, select **Write Training Assignments** under the Closed Beta categ"
        },
        {
          "info": {
            "name": "[beta] Get a Stream of Filtered Training Assignments.",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.samsara.com/training-assignments/stream",
            "params": [
              {
                "name": "after",
                "value": "",
                "type": "query",
                "description": " If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results."
              },
              {
                "name": "startTime",
                "value": "",
                "type": "query",
                "description": " A start time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00)."
              },
              {
                "name": "endTime",
                "value": "",
                "type": "query",
                "description": " An end time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00)."
              },
              {
                "name": "learnerIds",
                "value": "",
                "type": "query",
                "description": "Optional string of comma separated learner IDs. If learner ID is present, training assignments for the specified learner(s) will be returned. Max value for this value is 100 objects. Example: `learnerIds=driver-281474,driver-46282156`"
              },
              {
                "name": "courseIds",
                "value": "",
                "type": "query",
                "description": "Optional string of comma separated course IDs. If course ID is present, training assignments for the specified course ID(s) will be returned. Max value for this value is 100 objects. Defaults to returning all courses. Example: `courseIds=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075`"
              },
              {
                "name": "status",
                "value": "",
                "type": "query",
                "description": "Optional string of comma separated values. If status is present, training assignments for the specified status(s) will be returned. Valid values: \"notStarted\", \"inProgress\", \"completed\". Defaults to returning all courses."
              }
            ]
          },
          "docs": "Returns all training assignments data that has been created or modified for your organization based on the time parameters passed in. Results are paginated and are sorted by last modified date. If you include an endTime, the endpoint will return data up until that point (exclusive). If you don't include an endTime, you can continue to poll the API real-time with the pagination cursor that gets returned on every call. \n\n**Beta:** This endpoint is in beta and is likely to change before being broad"
        },
        {
          "info": {
            "name": "List Trailer Assignments for a Given Trailer",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://api.samsara.com/v1/fleet/trailers/:trailerId/assignments",
            "params": [
              {
                "name": "trailerId",
                "value": "",
                "type": "path",
                "description": "ID of trailer. Must contain only digits 0-9."
              },
              {
                "name": "startMs",
                "value": "",
                "type": "query",
                "description": "Timestamp in Unix epoch milliseconds representing the start of the period to fetch. Omitting both startMs and endMs only returns current assignments."
              },
              {
                "name": "endMs",
                "value": "",
                "type": "query",
                "description": "Timestamp in Unix epoch milliseconds representing the end of the period to fetch. Omitting endMs sets endMs as the current time"
              }
            ]
          },
          "docs": "<n class=\"warning\">\n<nh>\n<i class=\"fa fa-exclamation-circle\"></i>\nThis endpoint is still on our legacy API.\n</nh>\n</n>\n\nFetch trailer assignment data for a single trailer. \n\n <b>Rate limit:</b> 100 requests/sec (learn more about rate limits <a href=\"https://developers.samsara.com/docs/rate-limits\" target=\"_blank\">here</a>). \n\n **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href=\"https://forms.gle/zkD4NCH7HjKb7mm69\" target=\"_blank\">API feedbac"
        }
      ]
    }
  ],
  "bundled": true
}