# Check the Stripe connection for one mode

`POST /api/v1/gateway-credentials/stripe/{mode}/check`

Requires `gateway.manage`. Re-verifies the stored key with Stripe and repairs the webhook endpoint GlobalyMint created, the same check a worker runs every 15 minutes. A rejected key is flagged (`status: needs_attention`) and never deleted. `503 stripe_unavailable` when Stripe cannot be reached.

Needs a full-access key (`*`). No narrower scope opens this route.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `mode` | `test` or `live` | required |  |

## Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | optional | A unique value for this operation, chosen by you. A retry with the same key and the same body returns the first response instead of running again. The same key with a different body answers 409 `idempotency_key_reused`; a key whose first request is still running answers 409 `idempotency_in_progress`. |

## Responses

### 200

What the check found, and the masked status for both modes.

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "test",
                  "live"
                ]
              },
              "configured": {
                "type": "boolean"
              },
              "secretKeyHint": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Last 4 characters only."
              },
              "publishableKeyHint": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "hasWebhookSecret": {
                "type": "boolean"
              },
              "account_name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Stripe account display name from the last successful check."
              },
              "account_id_hint": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Last 4 characters of the Stripe account id."
              },
              "verified_at": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "When Stripe last accepted the key. Null until first checked."
              },
              "checked_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "webhook_registered": {
                "type": "boolean",
                "description": "True while the endpoint in the Stripe account was created by GlobalyMint."
              },
              "webhook_reason": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Why not: restricted_key, existing_endpoint, manual, manual_quiet, no_public_url, limit_reached or error."
              },
              "last_event_at": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Last signature-verified inbound Stripe event."
              },
              "last_event_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "connected",
                  "needs_attention",
                  "not_connected"
                ]
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "One short sentence when status is needs_attention."
              },
              "reason_code": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "not_verified",
                  "key_rejected",
                  "webhook_missing",
                  "no_events",
                  "webhook_unverified",
                  null
                ]
              }
            },
            "required": [
              "mode",
              "configured",
              "secretKeyHint",
              "publishableKeyHint",
              "hasWebhookSecret",
              "account_name",
              "account_id_hint",
              "verified_at",
              "checked_at",
              "webhook_registered",
              "webhook_reason",
              "last_event_at",
              "last_event_type",
              "status",
              "reason",
              "reason_code"
            ]
          }
        },
        "check": {
          "type": "object",
          "properties": {
            "outcome": {
              "type": "string",
              "enum": [
                "checked",
                "key_rejected",
                "not_connected"
              ]
            },
            "mode": {
              "type": "string",
              "enum": [
                "test",
                "live"
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "connected",
                "needs_attention",
                "not_connected"
              ]
            },
            "reason_code": {
              "type": [
                "string",
                "null"
              ]
            },
            "webhook_registered": {
              "type": "boolean"
            },
            "webhook_reason": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "outcome",
            "mode"
          ]
        }
      },
      "required": [
        "items",
        "check"
      ]
    },
    "_agent": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "ok"
          ]
        },
        "next_actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "summary",
        "status",
        "next_actions",
        "warnings"
      ]
    },
    "api_version": {
      "type": "string",
      "example": "2026-07-01"
    }
  },
  "required": [
    "data",
    "_agent",
    "api_version"
  ]
}
```
