REST API Documentation
The REST API requires at least xltrail v4.0.2
API Key
In xltrail, go to Settings > Access > API Key
to create and copy your API key.
Headers
All requests must include the following headers:
X-API-KEY: your_api_key
Accept: application/json
Content-Type: application/json
Base URL
The base URL is the URL of your xltrail app + /api
. If you are using the cloud, it is
https://app.xltrail.com/api
. Always prepend the base URL in front of the endpoints below.
Endpoints
GET /repositories
Lists all repositories.
Sample Request
curl --request GET \
--header "X-API-KEY: your_api_key" \
--header "Accept: application/json" \
--header "Content-type: application/json" \
"https://app.xltrail.com/api/repositories"
Sample Response
[
{
"id": "62ab6fb3-a152-44bd-b566-59acce5eff24",
"name": "Accounting",
"full_name": "Accounting",
"url": null,
"created_at": "2024-03-14T13:52:56.866088+00:00"
},
{
"id": "0500a155-d85a-4eae-a45e-5ec4087b4b43",
"name": "salesplan",
"full_name": "github.com/fzumstein/salesplan.git",
"url": "https://github.com/fzumstein/salesplan.git",
"created_at": "2024-03-14T13:52:16.272240+00:00"
},
]
POST /repositories
Create a new repository.
Sample Request (Drag and drop)
curl --request POST \
--header "X-API-KEY: your_api_key" \
--header "Accept: application/json" \
--header "Content-type: application/json" \
--data '{"name": "Accounting"}' \
"https://app.xltrail.com/api/repositories"
Sample Response (Drag and drop)
{
"id": "62ab6fb3-a152-44bd-b566-59acce5eff24",
"name": "Accounting",
"full_name": "Accounting",
"url": null,
"created_at": "2024-03-14T13:52:56.866088+00:00"
}
Sample Request (external Git repo)
curl --request POST \
--header "X-API-KEY: your_api_key" \
--header "Accept: application/json" \
--header "Content-type: application/json" \
--data '{"url": "https://github.com/fzumstein/salesplan.git", "username": "...", "password": "..."}' \
"https://app.xltrail.com/api/repositories"
Sample Response (external Git repo)
{
"id": "0500a155-d85a-4eae-a45e-5ec4087b4b43",
"name": "salesplan",
"full_name": "github.com/fzumstein/salesplan.git",
"url": "https://github.com/fzumstein/salesplan.git",
"created_at": "2024-03-14T13:52:16.272240+00:00"
}