# Stop a project

`POST https://api-vod-express.syncwords.com/v1/projects/{id}/stop`

Stop a project

Stops the processing service, and answers once it is gone, so a start straight after never runs two. Files are left as they are; those not processed yet wait for the next start.

**Guide:** [The processing service](/vod-express/concepts/projects#the-processing-service)

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | The project id, a lowercase ULID. |

## Responses

### 200

OK

Example:

```json
{
  "data": {
    "status": "NOT_RUNNING",
    "orchestratorStatus": null,
    "serviceId": null,
    "launchedAt": null,
    "version": null,
    "projectStatus": "stopped",
    "lastError": null,
    "pod": null
  }
}
```

Schema:

```json
{
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "$ref": "#/components/schemas/ServiceStatus"
    }
  }
}
```

### 401

No token, or an expired or unknown one: `unauthenticated`.

Example:

```json
{
  "message": "Unauthenticated.",
  "code": "unauthenticated"
}
```

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 403

VOD Express is not available to the account: switched off for it (`vod_express_not_enabled`), or the account is restricted — its access revoked, its trial expired or used up (`account_restricted`, with the reason in `message`).

Example:

```json
{
  "message": [
    "VOD Express is not enabled for your account."
  ],
  "code": "vod_express_not_enabled"
}
```

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 404

No such project in your account: `project_not_found`.

Example:

```json
{
  "message": "Project not found.",
  "code": "project_not_found"
}
```

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 429

Rate limited: `too_many_requests`. Wait the seconds `Retry-After` says, then repeat the call.

Example:

```json
{
  "message": [
    "Too Many Attempts."
  ],
  "code": "too_many_requests"
}
```

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 502

The running processing service could not be stopped: `service_stop_failed`. Nothing was changed; repeat the call.

Example:

```json
{
  "message": [
    "Failed to stop the running processing service"
  ],
  "code": "service_stop_failed"
}
```

Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```

## Schemas

### ServiceStatus

`#/components/schemas/ServiceStatus`

```json
{
  "type": "object",
  "required": [
    "status",
    "orchestratorStatus",
    "serviceId",
    "launchedAt",
    "version",
    "projectStatus",
    "lastError",
    "pod"
  ],
  "properties": {
    "status": {
      "enum": [
        "ACTIVE",
        "ERROR",
        "NOT_RUNNING"
      ],
      "description": "`ACTIVE`: up. `NOT_RUNNING`: stopped. `ERROR`: it did not start, or started and stopped working (see `pod`); `POST …/start` replaces it."
    },
    "orchestratorStatus": {
      "type": [
        "string",
        "null"
      ],
      "description": "The processing platform’s own word for the service’s state. Informational: branch on `status`."
    },
    "serviceId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The running service’s id; a new one at every start."
    },
    "launchedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "version": {
      "type": [
        "string",
        "null"
      ],
      "description": "The build the running service runs."
    },
    "projectStatus": {
      "enum": [
        "running",
        "stopped",
        "error"
      ]
    },
    "lastError": {
      "type": [
        "string",
        "null"
      ],
      "description": "Set while `projectStatus` is `error` because the last start failed; `POST …/start` retries it. Null when the service started and then stopped working: `pod` says so."
    },
    "pod": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "status",
        "message",
        "at"
      ],
      "description": "The last state reported by the service’s process: `ready`, `notready`, or `failed` (not running 15 minutes after the start). Null until one is known.",
      "properties": {
        "status": {
          "type": "string"
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "Reserved; null."
        },
        "at": {
          "type": "string",
          "format": "date-time",
          "description": "When the status was reported; for `failed`, when it first failed. A service that has read `failed` for two hours is stopped."
        }
      }
    }
  }
}
```

### Error

`#/components/schemas/Error`

```json
{
  "type": "object",
  "required": [
    "message",
    "code"
  ],
  "properties": {
    "message": {
      "description": "For people. A string, or an array of one string on some statuses: read it as `Array.isArray(m) ? m[0] : m`.",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    "code": {
      "description": "For programs: stable, one per situation. See the Errors guide.",
      "enum": [
        "bad_request",
        "invalid_output_path",
        "invalid_idempotency_key",
        "unauthenticated",
        "invalid_credentials",
        "forbidden",
        "vod_express_not_enabled",
        "account_restricted",
        "not_found",
        "project_not_found",
        "file_not_found",
        "file_meta_not_found",
        "output_not_found",
        "feed_not_found",
        "upload_not_found",
        "webhook_not_found",
        "webhook_delivery_not_found",
        "aws_access_not_provisioned",
        "storage_connection_not_found",
        "method_not_allowed",
        "conflict",
        "file_exists",
        "project_reads_feed",
        "project_reads_folder",
        "file_processing",
        "project_config_locked",
        "idempotency_in_progress",
        "storage_connection_in_use",
        "payload_too_large",
        "unsupported_media_type",
        "validation_failed",
        "service_start_failed",
        "idempotency_key_reused",
        "webhook_limit_reached",
        "storage_failed",
        "storage_connection_check_failed",
        "storage_connection_folder_only",
        "storage_prefix_taken",
        "build_without_storage_connections",
        "build_has_no_schema",
        "too_many_requests",
        "internal_error",
        "bad_gateway",
        "service_stop_failed",
        "aws_access_failed",
        "platform_unavailable",
        "service_unavailable",
        "build_list_unavailable"
      ]
    },
    "errors": {
      "type": "object",
      "description": "On a 422: each field’s messages, keyed by field name, or by JSON pointer inside `config`.",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    }
  }
}
```
