Shipeasy
APIOperations

Add a milestone to a trail

Add a named stage to the trail, with an optional description and target date. Milestones are ordered: omit position to add it last, or pass one to insert it…

Add a named stage to the trail, with an optional description and target date. Milestones are ordered: omit position to add it last, or pass one to insert it there and move the rest down. Progress is counted per milestone, and the build works the trail milestone by milestone — it launches item runs for the first milestone that still has open items. Approving a plan creates the milestones its breakdown lists; use this for any added later.

Safe for the restricted ops key.

Use case

The trail's first release went out and a second stage came up in review; add a "Dead-letter view" milestone with its own target date.

POST
/api/admin/trails/{handle}/milestones

Authorization

bearerSdkKey
AuthorizationBearer <token>

Pass an admin SDK key as Authorization: Bearer sdk_admin_…. Mint via POST /api/admin/keys with type: "admin".

In: header

Path Parameters

handle*string

The trail's handle (T-12) or its id.

Match^(?:T-[0-9]+|[0-9a-fA-F-]{32,36})$
Length1 <= length <= 64

Header Parameters

X-Project-Id?string

Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://shipeasy.ai/api/admin/trails/string/milestones" \  -H "Content-Type: application/json" \  -d '{    "name": "Dead-letter view",    "description": "Deliveries that fail permanently land in a view the customer can replay from",    "targetDate": "2026-11-27"  }'
{
  "id": "3b1f0c9e-7d42-4a8e-9f61-2c5d8e4a7b90",
  "name": "Dead-letter view",
  "description": "Deliveries that fail permanently land in a view the customer can replay from",
  "targetDate": "2026-11-27",
  "position": 1,
  "itemsTotal": 0,
  "itemsDone": 0,
  "late": false
}
{
  "error": "Malformed request (bad JSON, missing project scope).",
  "code": "BAD_REQUEST"
}
{
  "error": "Missing or invalid admin SDK key.",
  "code": "UNAUTHORIZED"
}

{
  "error": "Key is valid but not allowed to act on this project.",
  "code": "FORBIDDEN"
}

{
  "error": "The resource does not exist or is not visible to the caller.",
  "code": "NOT_FOUND"
}

{
  "error": "A resource with this name already exists in the project.",
  "code": "ALREADY_EXISTS"
}

{
  "error": "The request body failed structural (schema) validation.",
  "code": "VALIDATION"
}

Was this page helpful?