---
title: "Cancel Repository Subscription"
method: POST
path: "/v1/graphs/{graph_id}/subscriptions/cancel"
tags: ["Subscriptions"]
---

# Cancel Repository Subscription

`POST /v1/graphs/{graph_id}/subscriptions/cancel`

## Request

- Base URL: `https://api.robosystems.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.robosystems.ai/v1/graphs/{graph_id}/subscriptions/cancel`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Cancel a shared repository subscription. Two modes via the `immediate` flag: omit it (default `false`) to cancel at period end (access stays until the period closes); pass `true` with `confirm=<repo_id>` to stop access right away. Members cancel their own subscription; org owners and admins can cancel any member's by passing `user_id`. For user graphs, use `POST /v1/graphs/{graph_id}/operations/delete-graph` — this endpoint rejects user graphs.

## Path parameters

- `graph_id` string, required: Repository name (e.g., 'sec', 'industry')

## Request body

- CancelSubscriptionRequest: Request to cancel a subscription. Default behavior cancels at period end (soft cancel). Pass `immediate=True` to terminate the subscription right away — this requires `confirm` to equal the subscription's `resource_id` (e.g. the graph_id) as a guard against accidental destructive calls.
  - `immediate` boolean: If true, cancel immediately and trigger fast-path deprovisioning of the underlying resource (within ~10 minutes). If false (default), cancel at the end of the current billing period.
  - `confirm` string, nullable: Required when immediate=True. Must equal the subscription's resource_id (e.g. graph_id) to confirm intent.
  - `user_id` string, nullable: Organization member whose subscription to cancel. Defaults to the caller; canceling another member's requires org owner or admin.

## Response `200`

Successful Response

- GraphSubscriptionResponse: Response for graph or repository subscription details.
  - `id` string, required: Subscription ID
  - `resource_type` string, required: Resource type (graph or repository)
  - `resource_id` string, required: Resource identifier
  - `user_id` string, nullable: Organization member the subscription belongs to. Set for repository subscriptions, which are billed to the org but granted per user.
  - `plan_name` string, required: Current plan name
  - `plan_display_name` string, required: Human-readable plan name for UI display
  - `billing_interval` string, required: Billing interval
  - `status` string, required: Subscription status
  - `base_price_cents` integer, required: Base price in cents
  - `current_period_start` string, nullable: Current billing period start
  - `current_period_end` string, nullable: Current billing period end
  - `started_at` string, nullable: Subscription start date
  - `canceled_at` string, nullable: Cancellation date
  - `ends_at` string, nullable: Subscription end date (when access will be revoked, especially relevant for cancelled subscriptions)
  - `created_at` string, required: Creation timestamp
  - `operation_id` string, nullable: Operation ID for tracking async tier changes via SSE

## Other responses

- `400`: Invalid request
- `401`: Authentication required
- `403`: Access denied
- `404`: Resource not found
- `422`: Validation Error
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/robosystems/apis/robosystems-api.md) · [All operations](https://skmtc.dev/robosystems/apis/robosystems-api/llms.txt) · [OpenAPI document](https://skmtc.dev/robosystems/apis/robosystems-api/revisions/e661e2d5ca6a?raw)
