# Restore a deleted project

POST

/v1/projects/{projectId}/restore

```sh
curl --request POST \
  --url https://example.com/v1/projects/example/restore \
  --header 'Authorization: Bearer <token>'
```

Brings a deleted project back as it was: its members, team grants, keys, own service account and slugs, and its triggers’ next fires run. Fires and deliveries that came due while it was deleted were skipped, and runs cancelled at the delete stay cancelled. Its `updatedAt` moves to the restore. A live project answers 200, unchanged. A deleted project doesn’t count against the workspace’s limit on projects in production, so restoring one that’s in production counts it again: at the limit, the restore is refused (`403 production-limit-reached`) and the project stays deleted. Needs `admin` on the workspace: roles on a deleted project reach nothing, its own admins’ included. Restoring a deleted project is recorded in the audit log, `project-restored`.

## Authorizations

- **[bearerAuth](https://docs.kindgi.com/reference/api.md#bearerauth)**

## Parameters

### Path Parameters

**projectId**

required

string

ProjectId — opaque branded string.

### Header Parameters

**Idempotency-Key**

string

\>= 1 characters

Caller-supplied idempotency key, scoped to the caller: the same key from someone else in the workspace is their own request (from 0.1.5). Retries with the same key return the original response byte-identical (per `docs/API-ROUTE-CONVENTIONS.md` §3.1). A retry sent while the first request still runs is answered `409 idempotency-key-in-flight` with `Retry-After`, on a runtime whose store holds keys (from 0.1.5); retry after it, and you get the first request’s answer. An answer that carries a secret (a new API key or public run token, a session token, a generated signing secret) isn’t kept: a retry gets `409 idempotency-key-replay-withheld`, with the first request’s status and when it succeeded (from 0.1.5). A request whose key store can’t be read before it runs is answered `503 idempotency-store-unavailable` with `Retry-After`: nothing ran, so retry with the same key (from 0.3.0).

## Responses

### 200

The project, live again.

application/json

object

**id**

required

ProjectId — opaque branded string.

string

**tenantId**

required

string

**orgId**

string

**name**

required

string

**slug**

required

string

**isDefault**

required

boolean

**description**

string

**productionSince**

When the project was put in production; absent while it isn’t. A run in a project in production is a production run, and a run anywhere else is staging.

string format: date-time

**formerSlugs**

The slugs this project had before it was renamed, newest first, and empty when it never was. No other project of the workspace can take them, in any org, while this project exists, deleted or not. Absent from a runtime that doesn’t keep them.

Array\<string>

**sortEndUserCorrections**

`true`: end users’ corrections (an app’s, with a `participantId`, and not an expert’s) are sorted like the others when they’re saved, and a schedule counting everyone’s corrections counts them. `false` (the default): they’re listed and become test cases, but stay open and unsorted, and never start Improve.

boolean

**everyoneCanRun**

`true`: everyone in the project’s workspace can run this project’s agents and flows without a role of their own; service accounts aren’t included. That reads nothing more than running takes: the project, its agents and flows with their versions (an agent’s owner by id alone), and each person’s own runs, conversations and schedules. `false`: only people given a role. A new project has it unless its creator turns it off; existing projects and workspaces keep it `false` until a project admin turns it on. Absent from an older server.

boolean

**repoConnectionId**

The company-wide GitHub connection the project opens its block changes’ pull requests through; absent while none is set. A connection removed since reads as none.

string

**createdAt**

required

string

**updatedAt**

required

string

##### Examplegenerated

```json
{
  "id": "example",
  "tenantId": "example",
  "orgId": "example",
  "name": "example",
  "slug": "example",
  "isDefault": true,
  "description": "example",
  "productionSince": "2026-04-15T12:00:00Z",
  "formerSlugs": [
    "example"
  ],
  "sortEndUserCorrections": true,
  "everyoneCanRun": true,
  "repoConnectionId": "example",
  "createdAt": "example",
  "updatedAt": "example"
}
```

### 401

Missing / malformed / expired / revoked bearer token.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 403

No `admin` on the workspace (`permission-denied`); or the project is in production and the workspace’s projects in production are at its limit (`production-limit-reached`, `details.limit` `projects-in-production`, `details.projectsInProduction` the limit, `details.inProduction` the count, `details.projectId`): it stays deleted until one is taken out of production. Without an authorization store, `key-project-mismatch` (`details.keyProjectId`): the API key or session is limited to a project, and this writes above it, to the workspace, an org or a team (with a store, that is `permission-denied`).

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 404

`project-not-found`: no project, live or deleted, with that id under this workspace.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 409

`idempotency-key-in-flight` (with `Retry-After`): a request with the same `Idempotency-Key` still runs, so this one wasn’t run; send it again after `Retry-After` to get that request’s answer.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

#### Headers

**Retry-After**

integer

\>= 1

Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.

### 429

`rate-limit-exceeded` with `details.limit: "api-requests"`, on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; `Retry-After` says when to send it again.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

#### Headers

**Retry-After**

integer

\>= 1

Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.

### 501

`project-restore-unsupported`: this runtime’s project binding can’t restore a deleted project.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 503

The `Idempotency-Key` store (`idempotency-store-unavailable`) or the authorization store (`authz-backend-unavailable`) couldn’t be reached before the request ran, or the database was too busy for its authorization check (`database-busy`), so nothing was changed; `Retry-After` (whole seconds) says when to try again with the same key. Or `tenant-state-unavailable` (with `Retry-After`), on a runtime serving many workspaces: the workspace’s state couldn’t be read, so nothing was changed.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

#### Headers

**Retry-After**

integer

\>= 1

Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.

## See also

- [`GET /v1/projects/{projectId}`: Fetch a project by id](https://docs.kindgi.com/reference/api/operations/projectsget.md)
- [`PATCH /v1/projects/{projectId}`: Partially update a project](https://docs.kindgi.com/reference/api/operations/projectsupdate.md)
- [`DELETE /v1/projects/{projectId}`: Delete a project (idempotent)](https://docs.kindgi.com/reference/api/operations/projectsdelete.md)
- [`GET /v1/projects/{projectId}/queue-rules`: List a project's queue rules](https://docs.kindgi.com/reference/api/operations/projectsqueueruleslist.md)
- [Organize work by org and project](https://docs.kindgi.com/guides/projects/organize-by-org-and-project.md)
- [Kindgi 0.7.0](https://docs.kindgi.com/releases/0.7.0.md)
- [Error code `authz-backend-unavailable`](https://docs.kindgi.com/reference/errors.md#authz-backend-unavailable)
- [Error code `database-busy`](https://docs.kindgi.com/reference/errors.md#database-busy)
- [Error code `idempotency-key-in-flight`](https://docs.kindgi.com/reference/errors.md#idempotency-key-in-flight)
- [Error code `idempotency-store-unavailable`](https://docs.kindgi.com/reference/errors.md#idempotency-store-unavailable)
- [Error code `key-project-mismatch`](https://docs.kindgi.com/reference/errors.md#key-project-mismatch)
- [Error code `permission-denied`](https://docs.kindgi.com/reference/errors.md#permission-denied)
- [Error code `production-limit-reached`](https://docs.kindgi.com/reference/errors.md#production-limit-reached)
- [Error code `project-not-found`](https://docs.kindgi.com/reference/errors.md#project-not-found)
- [Error code `project-restore-unsupported`](https://docs.kindgi.com/reference/errors.md#project-restore-unsupported)
- [Error code `rate-limit-exceeded`](https://docs.kindgi.com/reference/errors.md#rate-limit-exceeded)
- [Error code `tenant-state-unavailable`](https://docs.kindgi.com/reference/errors.md#tenant-state-unavailable)
- [Every error code](https://docs.kindgi.com/reference/errors.md)
