# Create a project

`POST /v1/orgs/{org_id}/projects`

Requires role admin or higher. Counts against the plan limit projects.

## Authentication

A session token: `Authorization: Bearer <session token>`, or the session cookie in the browser. Requires role `admin` or higher.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org_id` | path | string | yes |  |

## Request body

`application/json`

```json
{
  "additionalProperties": false,
  "properties": {
    "name": {
      "maxLength": 100,
      "minLength": 1,
      "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u001F\\u007F]+$",
      "type": "string"
    }
  },
  "required": [
    "name"
  ],
  "type": "object"
}
```

## Responses

### 201

A project.

`application/json`

```json
{
  "additionalProperties": false,
  "description": "A project.",
  "properties": {
    "created_at": {
      "format": "date-time",
      "type": "string"
    },
    "id": {
      "pattern": "^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$",
      "type": "string"
    },
    "log_history_enabled": {
      "description": "Whether new redacted log lines are stored for replay. Off, lines already stored stay until their retention ends.",
      "type": "boolean"
    },
    "name": {
      "type": "string"
    },
    "org_id": {
      "pattern": "^org_[0-7][0-9a-hjkmnp-tv-z]{25}$",
      "type": "string"
    }
  },
  "required": [
    "id",
    "org_id",
    "name",
    "log_history_enabled",
    "created_at"
  ],
  "type": "object"
}
```

### 401

unauthorized: no valid session, or the email is not verified.

Problem type: [unauthorized](https://docs.dlogify.com/errors/unauthorized.md).

### 403

csrf-origin-rejected: a cookie-authenticated change from an origin outside the web app. forbidden: the action requires the admin role. plan-limit-reached: the plan's projects limit is reached.

Problem type: [csrf-origin-rejected](https://docs.dlogify.com/errors/csrf-origin-rejected.md).

### 404

not-found: the resource does not exist, or the caller is not a member of its organization.

Problem type: [not-found](https://docs.dlogify.com/errors/not-found.md).

### 422

validation-failed: the request does not match the schema.

Problem type: [validation-failed](https://docs.dlogify.com/errors/validation-failed.md).

### 429

rate-limited: per-user management request limit.

Problem type: [rate-limited](https://docs.dlogify.com/errors/rate-limited.md).

## Example

```bash
curl -X POST "https://api.dlogify.com/v1/orgs/{org_id}/projects" \
  -H "Authorization: Bearer $DLOGIFY_SESSION" \
  -H "Content-Type: application/json" \
  --data-binary @body
```

Source: https://docs.dlogify.com/api/projects/createProject
