Stamphog

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
GET
GET
GET
GET
POST
GET
PATCH
DELETE
POST
GET
GET
POST
GET
POST
GET

List all stamphog digest runs

Read-only history of posted (or attempted) digests, filterable by Slack channel.

Required API key scopes

stamphog:read

Query parameters

  • limit
    integer
  • offset
    integer
  • slack_channel_id
    string

Response


Example request

GET /api/projects/:project_id/stamphog/digest_runs
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/digest_runs/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"audience_key": "string",
"slack_channel_id": "string",
"slack_channel_name": "string",
"resolution_source": "manual",
"status": "pending",
"pr_count": 0,
"summary": {
"headline": "",
"prs": [
{
"pr_number": 0,
"title": "",
"url": "",
"author_login": "",
"summary": "",
"repository": ""
}
]
},
"slack_message_ts": "string",
"error": "string",
"created_at": "2019-08-24T14:15:22Z",
"posted_at": "2019-08-24T14:15:22Z"
}
]
}

Retrieve stamphog digest runs

Read-only history of posted (or attempted) digests, filterable by Slack channel.

Required API key scopes

stamphog:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/stamphog/digest_runs/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/digest_runs/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"audience_key": "string",
"slack_channel_id": "string",
"slack_channel_name": "string",
"resolution_source": "manual",
"status": "pending",
"pr_count": 0,
"summary": {
"headline": "",
"prs": [
{
"pr_number": 0,
"title": "",
"url": "",
"author_login": "",
"summary": "",
"repository": ""
}
]
},
"slack_message_ts": "string",
"error": "string",
"created_at": "2019-08-24T14:15:22Z",
"posted_at": "2019-08-24T14:15:22Z"
}

List all stamphog pull requests

Read-only pull requests stamphog knows about, filterable by PR number and merge state.

Required API key scopes

stamphog:read

Query parameters

  • limit
    integer
  • merged
    boolean
  • offset
    integer
  • pr_number
    integer

Response


Example request

GET /api/projects/:project_id/stamphog/pull_requests
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/pull_requests/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"repository": "string",
"pr_number": 0,
"title": "string",
"author_login": "string",
"pr_url": "string",
"head_branch": "string",
"merged": true,
"merged_at": "2019-08-24T14:15:22Z",
"merge_commit_sha": "string",
"additions": 0,
"deletions": 0,
"changed_files": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
]
}

Retrieve stamphog pull requests

Read-only pull requests stamphog knows about, filterable by PR number and merge state.

Required API key scopes

stamphog:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/stamphog/pull_requests/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/pull_requests/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"repository": "string",
"pr_number": 0,
"title": "string",
"author_login": "string",
"pr_url": "string",
"head_branch": "string",
"merged": true,
"merged_at": "2019-08-24T14:15:22Z",
"merge_commit_sha": "string",
"additions": 0,
"deletions": 0,
"changed_files": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

List all stamphog repo configs

Per-repo stamphog settings — enable/disable review, GitHub App installation, policy overrides.

Required API key scopes

stamphog:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/projects/:project_id/stamphog/repo_configs
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/repo_configs/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"provider": "string",
"repository": "string",
"enabled": true,
"installation_id": "string",
"digest_enabled": true,
"review_mode": "all",
"trigger_label": "string",
"user_access_level": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
]
}

Create stamphog repo configs

Per-repo stamphog settings — enable/disable review, GitHub App installation, policy overrides.

Required API key scopes

stamphog:write

Request parameters

  • provider
    string
  • repository
    string
  • enabled
    boolean
  • digest_enabled
    boolean
  • review_mode
  • trigger_label
    string

Response


Example request

POST /api/projects/:project_id/stamphog/repo_configs
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/repo_configs/\
-d repository="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"provider": "string",
"repository": "string",
"enabled": true,
"installation_id": "string",
"digest_enabled": true,
"review_mode": "all",
"trigger_label": "string",
"user_access_level": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Retrieve stamphog repo configs

Per-repo stamphog settings — enable/disable review, GitHub App installation, policy overrides.

Required API key scopes

stamphog:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/stamphog/repo_configs/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/repo_configs/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"provider": "string",
"repository": "string",
"enabled": true,
"installation_id": "string",
"digest_enabled": true,
"review_mode": "all",
"trigger_label": "string",
"user_access_level": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Update stamphog repo configs

Per-repo stamphog settings — enable/disable review, GitHub App installation, policy overrides.

Required API key scopes

stamphog:write

Path parameters

  • id
    string

Request parameters

  • provider
    string
  • repository
    string
  • enabled
    boolean
  • digest_enabled
    boolean
  • review_mode
  • trigger_label
    string

Response


Example request

PATCH /api/projects/:project_id/stamphog/repo_configs/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/repo_configs/:id/\
-d provider="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"provider": "string",
"repository": "string",
"enabled": true,
"installation_id": "string",
"digest_enabled": true,
"review_mode": "all",
"trigger_label": "string",
"user_access_level": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Delete stamphog repo configs

Per-repo stamphog settings — enable/disable review, GitHub App installation, policy overrides.

Required API key scopes

stamphog:write

Path parameters

  • id
    string

Example request

DELETE /api/projects/:project_id/stamphog/repo_configs/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/repo_configs/:id/

Example response

Status 204 No response body

Create stamphog repo configs add repository

Turn reviews on for a repository from the project's connected GitHub installations. Creates the repo config, or turns an existing one back on. Needs the editor level on stamphog.

Required API key scopes

stamphog:write

Request parameters

  • repository
    string

Response


Example request

POST /api/projects/:project_id/stamphog/repo_configs/add_repository
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/repo_configs/add_repository/\
-d repository="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"provider": "string",
"repository": "string",
"enabled": true,
"installation_id": "string",
"digest_enabled": true,
"review_mode": "all",
"trigger_label": "string",
"user_access_level": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"provider": "string",
"repository": "string",
"enabled": true,
"installation_id": "string",
"digest_enabled": true,
"review_mode": "all",
"trigger_label": "string",
"user_access_level": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Retrieve stamphog repo configs available repositories

List repositories from the project's connected GitHub installations that are not added to stamphog yet, so they can be added with add_repository.

Required API key scopes

stamphog:read

Query parameters

  • limit
    integer
    Default: 50
  • search
    string
    Default:

Response


Example request

GET /api/projects/:project_id/stamphog/repo_configs/available_repositories
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/repo_configs/available_repositories/

Example response

Status 200
RESPONSE
{
"repositories": [
"string"
],
"total_count": 0,
"has_installation": true
}

Retrieve stamphog repo configs install info

Per-repo stamphog settings — enable/disable review, GitHub App installation, policy overrides.

Required API key scopes

stamphog:read

Response


Example request

GET /api/projects/:project_id/stamphog/repo_configs/install_info
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/repo_configs/install_info/

Example response

Status 200
RESPONSE
{
"app_slug": "string",
"install_url": "string",
"authorize_url": "string"
}

Create stamphog repo configs sync installation

Per-repo stamphog settings — enable/disable review, GitHub App installation, policy overrides.

Required API key scopes

stamphog:write

Request parameters

  • installation_id
    string
    Default:
  • code
    string
  • state
    string

Response


Example request

POST /api/projects/:project_id/stamphog/repo_configs/sync_installation
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/repo_configs/sync_installation/\
-d code="string",\
-d state="string"

Example response

Status 200
RESPONSE
{
"synced": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"provider": "string",
"repository": "string",
"enabled": true,
"installation_id": "string",
"digest_enabled": true,
"review_mode": "all",
"trigger_label": "string",
"user_access_level": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"skipped": [
"string"
],
"available_count": 0,
"app_not_installed": true,
"installations": [
{
"id": "string",
"account_login": "string"
}
]
}

List all stamphog review runs

History of stamphog review runs, filterable by repository, PR number, and status, plus manual review requests.

Required API key scopes

stamphog:read

Query parameters

  • limit
    integer
  • offset
    integer
  • pr_number
    integer
  • repository
    string
  • status
    string
  • trigger
    string
    One of: "all""label""manual""self_driving"

Response


Example request

GET /api/projects/:project_id/stamphog/review_runs
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/review_runs/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"pull_request": "d50df585-631f-43d7-9e49-064790feac43",
"repository": "string",
"pr_number": 0,
"pr_url": "string",
"title": "string",
"author_login": "string",
"head_sha": "string",
"head_branch": "string",
"delivery_id": "string",
"trigger": "self_driving",
"status": "queued",
"verdict": "none",
"gate_result": {
"gate_blocked": true,
"final_verdict": "string"
},
"output": {
"stamphog_version": "string",
"reviewer_exit_code": 0
},
"reasoning": {
"reasoning": "string",
"showstoppers": [
"string"
],
"review_body": "string",
"change_summary": "string"
},
"error": "string",
"posted_review_id": 0,
"verdict_posted_at": "2019-08-24T14:15:22Z",
"approval_dismissed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z"
}
]
}

Create stamphog review runs

History of stamphog review runs, filterable by repository, PR number, and status, plus manual review requests.

Required API key scopes

stamphog:write

Request parameters

  • repository
    string
  • pr_number
    integer

Response


Example request

POST /api/projects/:project_id/stamphog/review_runs
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/review_runs/\
-d repository="string",\
-d pr_number="integer"

Example response

Status 200
RESPONSE
{
"run": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"pull_request": "d50df585-631f-43d7-9e49-064790feac43",
"repository": "string",
"pr_number": 0,
"pr_url": "string",
"title": "string",
"author_login": "string",
"head_sha": "string",
"head_branch": "string",
"delivery_id": "string",
"trigger": "self_driving",
"status": "queued",
"verdict": "none",
"gate_result": {
"gate_blocked": true,
"final_verdict": "string"
},
"output": {
"stamphog_version": "string",
"reviewer_exit_code": 0
},
"reasoning": {
"reasoning": "string",
"showstoppers": [
"string"
],
"review_body": "string",
"change_summary": "string"
},
"error": "string",
"posted_review_id": 0,
"verdict_posted_at": "2019-08-24T14:15:22Z",
"approval_dismissed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z"
},
"created": true
}
Status 201
RESPONSE
{
"run": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"pull_request": "d50df585-631f-43d7-9e49-064790feac43",
"repository": "string",
"pr_number": 0,
"pr_url": "string",
"title": "string",
"author_login": "string",
"head_sha": "string",
"head_branch": "string",
"delivery_id": "string",
"trigger": "self_driving",
"status": "queued",
"verdict": "none",
"gate_result": {
"gate_blocked": true,
"final_verdict": "string"
},
"output": {
"stamphog_version": "string",
"reviewer_exit_code": 0
},
"reasoning": {
"reasoning": "string",
"showstoppers": [
"string"
],
"review_body": "string",
"change_summary": "string"
},
"error": "string",
"posted_review_id": 0,
"verdict_posted_at": "2019-08-24T14:15:22Z",
"approval_dismissed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z"
},
"created": true
}

Retrieve stamphog review runs

History of stamphog review runs, filterable by repository, PR number, and status, plus manual review requests.

Required API key scopes

stamphog:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/stamphog/review_runs/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/stamphog/review_runs/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"pull_request": "d50df585-631f-43d7-9e49-064790feac43",
"repository": "string",
"pr_number": 0,
"pr_url": "string",
"title": "string",
"author_login": "string",
"head_sha": "string",
"head_branch": "string",
"delivery_id": "string",
"trigger": "self_driving",
"status": "queued",
"verdict": "none",
"gate_result": {
"gate_blocked": true,
"final_verdict": "string"
},
"output": {
"stamphog_version": "string",
"reviewer_exit_code": 0
},
"reasoning": {
"reasoning": "string",
"showstoppers": [
"string"
],
"review_body": "string",
"change_summary": "string"
},
"error": "string",
"posted_review_id": 0,
"verdict_posted_at": "2019-08-24T14:15:22Z",
"approval_dismissed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"completed_at": "2019-08-24T14:15:22Z"
}