Treeship
Hub API

POST /v1/artifacts

Push a signed artifact to Hub. DPoP authenticated.

Request

POST /v1/artifacts
Authorization: DPoP hub_9f8e7d6c
DPoP: eyJhbGciOiJFZERTQSIsInR5cCI6ImRwb3Arand0In0...
Content-Type: application/json
{
  "artifact_id": "art_f7e6d5c4b3a2f7e6",
  "payload_type": "application/vnd.treeship.action.v1+json",
  "envelope_json": "{\"payload\":\"...\",\"payloadType\":\"...\",\"signatures\":[...]}",
  "digest": "sha256:abc123...",
  "signed_at": 1711500000,
  "parent_id": null
}
FieldTypeRequiredDescription
artifact_idstringYesContent-addressed artifact ID
payload_typestringYesDSSE payload type MIME string
envelope_jsonstringYesThe complete DSSE envelope as a JSON string
digeststringYesSHA-256 digest of the PAE bytes, prefixed with sha256:
signed_atintegerYesUnix timestamp of when the artifact was signed
parent_idstring or nullNoParent artifact ID for chain linking

Authentication

This endpoint requires DPoP authentication. The Authorization header must be DPoP {hub_id}, and the DPoP header must be a valid JWT signed by the hub private key with:

  • htm: "POST" matching the HTTP method
  • htu: "https://api.treeship.dev/v1/artifacts" matching the endpoint URL

See the Hub API overview for full DPoP details.

Response

{
  "artifact_id": "art_f7e6d5c4b3a2f7e6",
  "hub_url": "https://treeship.dev/verify/art_f7e6d5c4b3a2f7e6",
  "rekor_index": 12345
}
FieldTypeDescription
artifact_idstringEchoed artifact ID
hub_urlstringPublic verification URL
rekor_indexinteger or nullSigstore Rekor log index (null if anchoring was skipped or failed)

Errors

StatusBodyCause
401{"error": "invalid DPoP proof"}DPoP JWT invalid or expired
401{"error": "hub not found"}Unknown hub ID
400{"error": "missing required field: artifact_id"}Incomplete request body

Rekor anchoring

Hub automatically anchors each pushed artifact to Sigstore Rekor. This creates a permanent, publicly auditable record in the transparency log. If Rekor is unavailable, the push succeeds but rekor_index returns null.

Example

curl -X POST https://api.treeship.dev/v1/artifacts \
  -H "Authorization: DPoP hub_9f8e7d6c" \
  -H "DPoP: eyJhbGciOiJFZERTQSJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "artifact_id": "art_f7e6d5c4b3a2f7e6",
    "payload_type": "application/vnd.treeship.action.v1+json",
    "envelope_json": "{...}",
    "digest": "sha256:abc123...",
    "signed_at": 1711500000,
    "parent_id": null
  }'

In practice, you do not call this endpoint directly. The CLI handles artifact construction, signing, and pushing when you run treeship hub push.