Manage your inventory programmatically -- add listings, update status, and upload photos without opening the site.
Every request (except the public reference endpoints) must include your token in the Authorization header:
Authorization: Bearer osk_your_token_hereTokens are tied to your account -- every listing you create, edit, or read through the API is scoped to your own inventory only.
A listing created through the API always starts as a draft, the same as starting one by hand on the site -- it can't publish without at least one photo, and this call can't carry one.
The account your token belongs to
curl https://onlysalvage.com/api/v1/me/ \
-H "Authorization: Bearer osk_your_token_here"Valid values for status, vehicle_type, fuel_type, etc.
curl https://onlysalvage.com/api/v1/schema/choices/List all vehicle makes (no token required)
curl https://onlysalvage.com/api/inventory/makes/List models for a given make (no token required)
curl "https://onlysalvage.com/api/inventory/models/?make=21"List your own listings -- filterable, see below
curl "https://onlysalvage.com/api/v1/listings/?status=AV&min_price=5000" \
-H "Authorization: Bearer osk_your_token_here"Create a new listing (always starts as a draft)
curl -X POST https://onlysalvage.com/api/v1/listings/ \
-H "Authorization: Bearer osk_your_token_here" \
-H "Content-Type: application/json" \
-d '{
"vin": "1HGCM82633A004352",
"year": 2018,
"make": 21,
"model": 186,
"price": 9500,
"vehicle_type": "SDN",
"title_document": "SA"
}'Get a single listing of yours
curl https://onlysalvage.com/api/v1/listings/123/ \
-H "Authorization: Bearer osk_your_token_here"Edit a listing's fields (partial updates supported)
curl -X PATCH https://onlysalvage.com/api/v1/listings/123/ \
-H "Authorization: Bearer osk_your_token_here" \
-H "Content-Type: application/json" \
-d '{"price": 8900, "description": "Price reduced -- motivated seller."}'Permanently delete a listing and its photos
curl -X DELETE https://onlysalvage.com/api/v1/listings/123/ \
-H "Authorization: Bearer osk_your_token_here"
# 204 No Content on successChange just a listing's status
curl -X POST https://onlysalvage.com/api/v1/listings/123/status/ \
-H "Authorization: Bearer osk_your_token_here" \
-H "Content-Type: application/json" \
-d '{"status": "AV"}'Bump an eligible listing back to the top
curl -X POST https://onlysalvage.com/api/v1/listings/123/renew/ \
-H "Authorization: Bearer osk_your_token_here"List a listing's photos
curl https://onlysalvage.com/api/v1/listings/123/images/ \
-H "Authorization: Bearer osk_your_token_here"Upload a photo, by file or image_url
curl -X POST https://onlysalvage.com/api/v1/listings/123/images/ \
-H "Authorization: Bearer osk_your_token_here" \
-F "file=@photo.jpg"
# or, from an existing hosted URL instead of a local file:
curl -X POST https://onlysalvage.com/api/v1/listings/123/images/ \
-H "Authorization: Bearer osk_your_token_here" \
-H "Content-Type: application/json" \
-d '{"image_url": "https://example.com/photo.jpg"}'Remove a single photo
curl -X DELETE https://onlysalvage.com/api/v1/listings/123/images/456/ \
-H "Authorization: Bearer osk_your_token_here"
# 204 No Content on success