Delete a custom OAuth client

Deletes one of this space's custom clients by id (an org-level client id is a 404 here), with the connections it minted. If it was the default, the cascade re-resolves (org default, else system client) with no auto-promotion. Refused with 409 connection_pinned while an admin pin or an org default (enforced or soft) names one of the connections it minted; a member pin does not block it. Each deleted connection is dropped from its owner's member pins (a pin left empty is removed) and from its owner's schedules' connection_overrides (a schedule whose set for an integration is left empty is disabled); another member's pin keeps the id, and that member's next run fails with pinned_connection_unavailable. Another actor's enabled schedules naming a deleted connection are disabled (disabled_reason: connection_deleted), their overrides kept. Requires integrations:configure, which is never granted to an API key.

DELETE/api/integrations/{packageId}/oauth-clients/{clientId}

Authorization

better-auth.session_token<token>

Cookie session from Better Auth. Requires X-Org-Id header for org-scoped routes.

In: cookie

Path Parameters

packageId*string

Integration package id (e.g. @official/gmail).

Match^@[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$
clientId*string

Custom OAuth client id (integration_oauth_clients.id, UUID).

Formatuuid

Header Parameters

X-Org-Id?string

Organization ID. Required for cookie auth. Not needed for API key auth (org resolved from key).

Formatuuid
X-Space-Id?string

Space ID. Required for space-scoped routes (agents, runs, schedules, and space-scoped module routes). Not needed for API key auth (space resolved from key).

curl -X DELETE "https://your-instance/api/integrations/string/oauth-clients/497f6eca-6276-4993-bfeb-53cbbbba6f08"
Empty
{
  "type": "https://docs.appstrate.dev/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "Insufficient permissions",
  "code": "forbidden",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/not-found",
  "title": "Not Found",
  "status": 404,
  "detail": "Resource not found",
  "code": "not_found",
  "request_id": "req_abc123"
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "code": "string",
  "request_id": "string",
  "param": "string",
  "retry_after": 0,
  "errors": [
    {
      "field": "string",
      "code": "string",
      "message": "string",
      "title": "string",
      "candidate_connections": [
        {
          "id": "string",
          "label": "string",
          "account_id": "string",
          "owned_by_actor": true,
          "needs_reconnection": true
        }
      ],
      "connection_id": "string",
      "missing_scopes": [
        "string"
      ],
      "owned_by_actor": true,
      "required_scopes": [
        "string"
      ],
      "auth_key": "string",
      "required_auth_key": "string",
      "available_auth_keys": [
        "string"
      ],
      "connect_url": "http://example.com",
      "expiresAt": "2019-08-24T14:15:22Z",
      "packageId": "string"
    }
  ]
}