> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.confirm.global/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.confirm.global/_mcp/server.

# Delete a development workspace

DELETE https://api.confirm.global/partner/v1/organizations/{external_ref}

Tears down a workspace you created, so a development environment can be
reset and rebuilt. Built for exactly one job: letting your developers
create and destroy throwaway registries while they build against us.

**Sandbox only.** This endpoint is not enabled in production and answers
`403 delete_disabled` there. Production workspaces hold real candidates;
removing one is a support request, not an API call.

Three conditions must all hold or nothing is touched:

1. The workspace is linked to your partner account.
2. **You created it through `POST /organizations`.** A workspace CONFIRM
   linked to your account by hand — a real registry — can never be
   deleted here, and answers `403 not_partner_created`.
3. Deletion is enabled in the environment you are calling.

The workspace and everything in it (candidates, locations, the screening
agent) is soft-deleted and can be restored by CONFIRM support. Nothing
shared between registries is affected.

**The `external_ref` is released.** Calling `POST /organizations` again
with the same reference provisions a *new* workspace rather than
returning the deleted one, so teardown-and-recreate works as many times
as you need it to.


Reference: https://docs.confirm.global/partner-api/organizations/delete-organization

## Authentication

- `Authorization` header (bearer token, required) — Partner API key sent as `Authorization: Bearer cfk_...`. Keys are partner-level — one key reaches every registry linked to your partner account and nothing else. CONFIRM issues and revokes them; a key is shown exactly once at creation because only its hash is stored, and revocation takes effect on the next request. Develop against the sandbox base URL with a sandbox key, where telephony is restricted to an allowlist you provide.

## Request

### Path parameters

- `external_ref` (string, required) — The registry reference you provisioned the workspace with.

## Response

### 200

Workspace deleted.

- `organization_id` (string, optional)
- `external_ref` (string, optional)
- `name` (string, optional)
- `deleted` (boolean, optional)
- `deleted_items` (OrganizationsExternalRefDeleteResponsesContentApplicationJsonSchemaDeletedItems, optional) — What the teardown removed, for your logs.

## Errors

### 401 Unauthorized Error

Missing, malformed, or revoked API key (`error.type: authentication_error`).

- `error` (ErrorError, required)

### 403 Forbidden Error

Deletion refused. `code` says which condition failed: `delete_disabled` (not available in this environment) or `not_partner_created` (the workspace was not created through this API).

- `error` (ErrorError, required)

### 404 Not Found Error

No workspace with that reference belongs to your partner account.

- `error` (ErrorError, required)

### 429 Too Many Requests Error

Rate limit exceeded (`error.type: rate_limit_error`). Design target: 600 requests/min per key, burst 100/10s. Honor the `Retry-After` header.

- `error` (ErrorError, required)

## Types

### OrganizationsExternalRefDeleteResponsesContentApplicationJsonSchemaDeletedItems

What the teardown removed, for your logs.

- `candidates` (integer, optional)
- `jobs` (integer, optional)
- `users` (integer, optional)
- `agent_configs` (integer, optional)
- `queued_calls_cancelled` (integer, optional) — Screening calls that were queued for this workspace's applicants and are now cancelled, so a deleted workspace never dials anyone. Calls already in progress are left to finish.

### ErrorError

- `type` (enum, required) — Broad error category.
  - Allowed values: `authentication_error`, `invalid_request_error`, `not_found_error`, `conflict_error`, `rate_limit_error`, `api_error`
- `code` (string, required) — Machine-readable error code, e.g. `invalid_request`, `unknown_location_ref` or `wrong_environment`. Branch on this; the strings are contract.
- `message` (string, required) — Human-readable explanation.
- `request_id` (string, required) — Identifier for this request — the same value as the response's `X-Request-Id` header. Include it when contacting CONFIRM support.
- `details` (list of ErrorErrorDetailsItems, optional) — Present on `invalid_request` (400): one entry per field that failed validation.
- `location_ref` (string, optional) — Present on `unknown_location_ref` (404) — the reference that wasn't found.
- `organization_ref` (string, optional) — Present on `unknown_organization_ref` (404) — the reference that wasn't found — and on `email_has_account` (409) — the registry the invitation was for.
- `external_ref` (string, optional) — Present on workspace-teardown refusals (403) — the workspace you asked to delete — and on applicant errors (`unknown_candidate_ref`, `no_application_at_location`, `outcome_conflict`) — the applicant ref.
- `organization_refs` (list of string, optional) — Present on `ambiguous_location_ref` (409) — the registries the ref exists in.
- `locations` (list of ErrorErrorLocationsItems, optional) — Present on `location_refs_span_organizations` (400) — each ref you sent with the registry it belongs to.

### ErrorErrorDetailsItems

- `field` (string, required) — Dotted path to the offending field, e.g. `address.postal_code`.
- `message` (string, required) — Why that field was rejected.

### ErrorErrorLocationsItems

- `location_ref` (string, optional)
- `organization_ref` (string, optional, nullable)

## Examples

**Response**

```json
{
  "organization_id": "9f4c2e81-6d3a-4b7e-a1c2-8e5f0d743b16",
  "external_ref": "cl_biz_dev_kyle",
  "name": "Kyle Dev Registry",
  "deleted": true,
  "deleted_items": {
    "candidates": 0,
    "jobs": 2,
    "users": 0,
    "agent_configs": 3,
    "queued_calls_cancelled": 1
  }
}
```

**SDK Code**

```python deleted
import requests

url = "https://api.confirm.global/partner/v1/organizations/cl_biz_dev_kyle"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript deleted
const url = 'https://api.confirm.global/partner/v1/organizations/cl_biz_dev_kyle';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go deleted
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.confirm.global/partner/v1/organizations/cl_biz_dev_kyle"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby deleted
require 'uri'
require 'net/http'

url = URI("https://api.confirm.global/partner/v1/organizations/cl_biz_dev_kyle")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java deleted
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.confirm.global/partner/v1/organizations/cl_biz_dev_kyle")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php deleted
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.confirm.global/partner/v1/organizations/cl_biz_dev_kyle', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp deleted
using RestSharp;

var client = new RestClient("https://api.confirm.global/partner/v1/organizations/cl_biz_dev_kyle");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift deleted
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.confirm.global/partner/v1/organizations/cl_biz_dev_kyle")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```