Inspect

Report pull request preview

Record the deploy status of a named preview for a pull request, typically from CI. The status is applied to every Inspect session currently linked to the pull request; sessions linked later receive the next reported status. Retries are safe: an update whose `occurred_at` is older than the stored status for the same preview is ignored. A `deploying` or `failed` status keeps the last successful URL.

Base URL
PUT
/api/public/v1/repositories/{owner}/{repo}/pulls/{pull_number}/previews/{name}

Record the deploy status of a named preview for a pull request, typically from CI. The status is applied to every Inspect session currently linked to the pull request; sessions linked later receive the next reported status. Retries are safe: an update whose occurred_at is older than the stored status for the same preview is ignored. A deploying or failed status keeps the last successful URL.

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key authentication. Use your API key as the bearer token.

Path Parameters

owner*string

GitHub repository owner.

Length1 <= length
repo*string

GitHub repository name.

Length1 <= length
pull_number*integer

Pull request number.

Formatint64
Range0 < value
name*string

Preview name chosen by the caller, e.g. default or storybook. Lowercase kebab-case where each segment starts with a letter, at most 64 characters. The default preview is the session's primary preview.

Match^[a-z][a-z0-9]*(?:-[a-z][a-z0-9]*)*$
Lengthlength <= 64

Request Body

application/json
  1. body

Unknown properties are rejected. String values are trimmed before length limits are checked.

status*Previews.PreviewStatus
Value in"deploying""deployed""failed"
url?|

Preview URL (http or https). Required when status is deployed.

commit_sha?|

Commit the preview was built from. Recommended: Inspect uses it to mark previews of older commits as outdated.

Length1 <= length <= 64
label?|

Display name for the preview. Omit to keep the current label.

Length1 <= length <= 100
job_url?|

Link to the CI job or run.

error?|

Failure details, recorded when status is failed.

Lengthlength <= 2000
occurred_at?string

When the status change occurred. Defaults to receipt time.

Formatdate-time

Response Body

The status was accepted

application/json
  1. response
data*
Example Request
curl -X PUT 'https://your-org.inspect.com/api/public/v1/repositories/string/string/pulls/1/previews/string' \  -H 'Content-Type: application/json' \  -d '{  "status": "deploying"}'
Example Response
{  "data": {    "name": "string",    "label": "string",    "status": "deploying",    "url": "http://example.com",    "commit_sha": "string",    "deployed_commit_sha": "string",    "last_succeeded_at": "2019-08-24T14:15:22Z",    "job_url": "http://example.com",    "error": "string",    "occurred_at": "2019-08-24T14:15:22Z",    "session_ids": [      "string"    ]  }}