Drafts

List customized and conflicted files on a Draft

GET
/drafts/{draft_id}/files

Lists the Draft's files that differ from the last merged package or need a conflict decision, ordered by path, without file content. Each conflict names its kind, the saved decision, and the sides you can read with getFile. With filter=history, lists files affected by a default-branch history rewrite; the list is empty when none is pending.

Returns 409 resource_changed while Typeship is carrying the Draft's latest commit forward (status working), or when the Draft changes between pages.

AuthorizationBearer <token>

Organization API key from the console (ak_...), or an OAuth access token with user:org:read, the organization selected during consent, and the capability required by the operation.

In: header

Path Parameters

draft_id*string

Unique identifier for a Draft.

Match^drf_[a-z0-9]{16}$

Query Parameters

filter?string

conflicted: conflicts only. customized: files that differ from the last merged package. history: files affected by a default-branch history rewrite. Omit for conflicted and customized files.

Value in

  • "conflicted"
  • "customized"
  • "history"
limit?integer

Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400 invalid_request. List query parameters must appear only once; unrecognized parameters also return 400.

Range1 <= value <= 100
Default20
cursor?string

Opaque cursor from the preceding page's next_cursor. Valid only for the same organization, operation, filters, and ordering that issued it. Omit to start at the first page. Empty, malformed, or repeated cursors return 400 invalid_request. The page limit may change between requests.

Match^[A-Za-z0-9_-]+$
Length1 <= length <= 2048

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/drafts/drf_3q7m1v8k2p5d9h4c/files"
{  "object": "list",  "data": [    {      "object": "draft_file",      "path": "src/helper.ts",      "customization": "added",      "conflict": null,      "history": null,      "sides": null    },    {      "object": "draft_file",      "path": "src/index.ts",      "customization": "edited",      "conflict": {        "type": "overlapping_text",        "source": "generation",        "decision": null      },      "history": null,      "sides": {        "base": "file_2q7m1v8k4p9d5h3c",        "yours": "file_8w3k6q2m9v1p4d7h",        "generated": "file_4k8m2v7q1p9d5h6c"      }    }  ],  "has_more": false,  "next_cursor": null,  "request_id": "req_3k8m1v6q9p2d7h4c"}

Select an exact Draft version or return to automatic versioning PATCH

Checks your version choice against the required version bump, then regenerates the existing Draft pull request. Send the Draft's `ETag` in `If-Match` to reject an intervening change with 412 precondition_failed before saving or regenerating. Omitting `If-Match` applies the selection to the current Draft. version_next is required; null restores automatic selection. A `502` response means the selected version was saved, but regeneration failed. Follow the error's retryable and suggested_action fields. Repeating an unfinished selection resumes generation; repeating a completed selection starts no new work. If using If-Match, retrieve the Draft and confirm the saved selection before retrying with its current ETag. A `409 draft_merged` means the Draft merged; retrieve the Target and select a version on its `draft_id`. A `409 target_busy` means the Target is publishing; wait and retry. A `409 version_occupied` means the version is already released; retrieve the Draft and releases, choose a new version, and retry. See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag and If-Match.

Resolve selected Draft files POST

Resolves conflicts on the Draft's head_sha: keep yours or generated, or supply final content as text or, for binary files, base64. Choosing generated for a customized path replaces it with the generated file, or deletes a Draft-only file. Conflict decisions are saved together and can be replaced until applied. Choosing generated for customized paths commits those changes together on the Draft branch. Returns the Draft. When every conflict has a decision, `conflicts.decided` equals `conflicts.total` and Typeship continues the Draft and runs checks. Paths that already match the Draft change nothing.