> For the complete documentation index, see [llms.txt](https://docs.connect.jfrog.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.connect.jfrog.io/developers/api-reference/connect-api-reference/device-files.md).

# Device Files

## Fetch Files

> Triggers Connect to fetch files from the device you specify. For example, you can use this command to fetch logs from a device. The files are fetched from the device path you specify in the request body using the \`files\_path\` attribute. You can specify a folder or a specific file.\
> \
> The request returns a URL. You can use the Artifactory UI, API, or CLI to download the files from this URL. The files are not available immediately at the URL. They become available when the device uploads them and if the upload is successful.

```json
{"openapi":"3.0.0","info":{"title":"Logs API","version":"1.0.0"},"servers":[{"url":"https://api.connect.jfrog.io"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"You will need to get an access token from the Connect web UI to use the Connect API v2. The v1 token will not work for v2.\n\n    Important: For security reasons, the new token generated by Connect will not be stored. Ensure that you copy the token and save it in a safe place.\n"}}},"paths":{"/api/v2/{project_key}/devices/{device_uuid}/logs":{"post":{"tags":["Device Files"],"summary":"Fetch Files","description":"Triggers Connect to fetch files from the device you specify. For example, you can use this command to fetch logs from a device. The files are fetched from the device path you specify in the request body using the `files_path` attribute. You can specify a folder or a specific file.\n\nThe request returns a URL. You can use the Artifactory UI, API, or CLI to download the files from this URL. The files are not available immediately at the URL. They become available when the device uploads them and if the upload is successful.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"files_path":{"type":"string","description":"The path where the requested files are on the device."}}}}}},"parameters":[{"name":"project_key","in":"path","schema":{"type":"string"},"required":true,"description":"The fleet key of the relevant fleet in the account. An account can have multiple fleets (formerly called projects). If you don't know the fleet key, you can find it in the Fleet Settings of the web UI."},{"name":"device_uuid","in":"path","schema":{"type":"string"},"required":true,"description":"The  UUID of the device you are acting on. This is the unique identifier of the device in Connect, for example, d-4cfe-4e51. You can find the UUID in the ID column of the Devices table in the [Devices](https://docs.connect.jfrog.io/devices/view-device-details) page of the web UI."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"download_url":{"type":"string"}}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"NOT FOUND","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.connect.jfrog.io/developers/api-reference/connect-api-reference/device-files.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
