Get a Skill file
curl --request GET \
--url https://api.langdock.com/skills/v1/{skillId}/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.langdock.com/skills/v1/{skillId}/files"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.langdock.com/skills/v1/{skillId}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.langdock.com/skills/v1/{skillId}/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.langdock.com/skills/v1/{skillId}/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.langdock.com/skills/v1/{skillId}/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/skills/v1/{skillId}/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"path": "<string>",
"sizeBytes": 123,
"extension": "<string>",
"hasScript": true,
"sha256": "<string>",
"content": "<string>"
}Skills API
Get Skill File
Retrieve a stored Skill file by path
GET
/
skills
/
v1
/
{skillId}
/
files
Get a Skill file
curl --request GET \
--url https://api.langdock.com/skills/v1/{skillId}/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.langdock.com/skills/v1/{skillId}/files"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.langdock.com/skills/v1/{skillId}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.langdock.com/skills/v1/{skillId}/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.langdock.com/skills/v1/{skillId}/files"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.langdock.com/skills/v1/{skillId}/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/skills/v1/{skillId}/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"path": "<string>",
"sizeBytes": 123,
"extension": "<string>",
"hasScript": true,
"sha256": "<string>",
"content": "<string>"
}Retrieves a stored Skill file by path from your workspace.
The file must be valid UTF-8 and no larger than 512 KB. Readable extensions are
Base URL
https://api.langdock.com/skills/v1/{skillId}/files
Dedicated deploymentsReplace
api.langdock.com with <your-deployment-url>/api/public in all requests.Required Scopes
This endpoint requires theSKILL_API scope.
Requires viewer access to the Skill.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
skillId | string | Yes | UUID of the Skill to retrieve. |
path | string | Yes | Relative path of the file inside the Skill, for example references/template.md. Maximum: 255 characters. Absolute paths, drive-prefixed paths, control characters, and .. segments are rejected. |
.md, .mdx, .txt, .py, .sh, .js, .ts, .json, .yaml, .yml, .toml, .csv, .xml, .xsd, .html, .css, and .svg. Binary and other unsupported files stay listed on Get Skill. This endpoint does not return their contents.
Example
const axios = require("axios");
async function getSkillFile(skillId, path) {
const response = await axios.get(
`https://api.langdock.com/skills/v1/${skillId}/files`,
{
params: { path },
headers: {
Authorization: "Bearer YOUR_API_KEY"
}
}
);
console.log("Content:", response.data.content);
}
getSkillFile(
"550e8400-e29b-41d4-a716-446655440000",
"references/template.md"
);
Response Format
Success Response (200 OK)
{
path: string;
sizeBytes: number;
extension: string;
hasScript: boolean;
sha256: string;
content: string;
}
Error Handling
| Status Code | Description |
|---|---|
| 400 | Invalid Skill ID, invalid path, unsupported file type, invalid UTF-8, or file larger than 512 KB |
| 401 | Invalid or missing API key |
| 403 | Missing SKILL_API scope or Skills product access |
| 404 | Skill or file not found, or not accessible |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.
Authorizations
API key as Bearer token. Format "Bearer YOUR_API_KEY"
Path Parameters
UUID of the Skill.
Query Parameters
Relative path of the file inside the Skill.
Required string length:
1 - 255Response
File returned successfully
Relative path inside the Skill.
File size in bytes.
Lowercase file extension, including the leading dot.
Whether the file is a script file (.py, .sh, .js, or .ts).
Lowercase SHA-256 hash of the original file bytes.
UTF-8 file contents.
Was this page helpful?