# create a project module

`POST /api/organization-project-modules`

Authentication (security requirement alternatives):

```json
[
  {
    "bearer": []
  }
]
```

- bearer: http (bearer), header JWT. Enter JWT token

Request body: application/json (required)

Type: object

Schema: [CreateOrganizationProjectModuleDTO](https://sourcey-gauzy.pages.dev/api-reference/models/createorganizationprojectmoduledto/index.md)

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `organization` (required)
  Type: object

- `organizationId` (required)
  Type: string

- `sentTo` (optional)
  Type: string

- `deletedAt` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `createdAt` (optional)
  Type: string, date-time
  
  The creation timestamp of the entity.
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `updatedAt` (optional)
  Type: string, date-time
  
  The last update timestamp of the entity.
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `id` (optional)
  Type: string

- `isActive` (optional)
  Type: boolean
  
  default: true

- `isArchived` (optional)
  Type: boolean
  
  default: false

- `archivedAt` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `name` (required)
  Type: string

- `description` (optional)
  Type: string

- `status` (optional)
  Type: string

- `startDate` (optional)
  Type: string, date-time

- `endDate` (optional)
  Type: string, date-time

- `public` (optional)
  Type: boolean

- `isFavorite` (optional)
  Type: boolean

- `parent` (optional)
  Reference: [OrganizationProjectModule](https://sourcey-gauzy.pages.dev/api-reference/models/organizationprojectmodule/index.md); Type: object

- `parentId` (optional)
  Type: string

- `project` (optional)
  Type: object

- `projectId` (optional)
  Type: string

- `children` (optional)
  Type: array
  
  Items:
    Type: array

- `views` (optional)
  Type: array
  
  Items:
    Type: array

- `members` (optional)
  Type: array
  
  Items:
    Type: array

- `tasks` (optional)
  Type: array
  
  List of task IDs
  
  Items:
    Type: array

- `organizationSprints` (optional)
  Type: array
  
  Items:
    Type: array

- `teams` (optional)
  Type: array
  
  Items:
    Type: array

- `memberIds` (optional)
  Type: array
  
  Items:
    Type: string

- `managerIds` (optional)
  Type: array
  
  Items:
    Type: string

Responses:

- 201: The record has been successfully created.

- 400: Invalid input, The response body may contain clues as to what went wrong

- 401: Unauthorized

- 403: Forbidden

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/organization-project-modules' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "deletedAt": "2018-11-21T06:20:32.232Z",
  "createdAt": "2018-11-21T06:20:32.232Z",
  "updatedAt": "2018-11-21T06:20:32.232Z",
  "id": "string",
  "isActive": true,
  "isArchived": false,
  "archivedAt": "2018-11-21T06:20:32.232Z",
  "name": "string",
  "description": "string",
  "status": "string",
  "startDate": "2024-01-15T09:30:00Z",
  "endDate": "2024-01-15T09:30:00Z",
  "public": true,
  "isFavorite": true,
  "parent": {
    "deletedAt": "2018-11-21T06:20:32.232Z",
    "createdAt": "2018-11-21T06:20:32.232Z",
    "updatedAt": "2018-11-21T06:20:32.232Z",
    "id": "string",
    "isActive": true,
    "isArchived": false,
    "archivedAt": "2018-11-21T06:20:32.232Z",
    "tenantId": "string",
    "organizationId": "string",
    "name": "string",
    "description": "string",
    "status": "string",
    "startDate": "2024-01-15T09:30:00Z",
    "endDate": "2024-01-15T09:30:00Z",
    "public": true,
    "isFavorite": true,
    "parentId": "string",
    "project": {},
    "projectId": "string",
    "children": [
      []
    ],
    "views": [
      []
    ],
    "members": [
      []
    ],
    "tasks": [
      []
    ],
    "organizationSprints": [
      []
    ],
    "teams": [
      []
    ]
  },
  "parentId": "string",
  "project": {},
  "projectId": "string",
  "children": [
    []
  ],
  "views": [
    []
  ],
  "members": [
    []
  ],
  "tasks": [
    []
  ],
  "organizationSprints": [
    []
  ],
  "teams": [
    []
  ],
  "memberIds": [
    "string"
  ],
  "managerIds": [
    "string"
  ]
}'
```

### JavaScript

```javascript
const body = `{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "deletedAt": "2018-11-21T06:20:32.232Z",
  "createdAt": "2018-11-21T06:20:32.232Z",
  "updatedAt": "2018-11-21T06:20:32.232Z",
  "id": "string",
  "isActive": true,
  "isArchived": false,
  "archivedAt": "2018-11-21T06:20:32.232Z",
  "name": "string",
  "description": "string",
  "status": "string",
  "startDate": "2024-01-15T09:30:00Z",
  "endDate": "2024-01-15T09:30:00Z",
  "public": true,
  "isFavorite": true,
  "parent": {
    "deletedAt": "2018-11-21T06:20:32.232Z",
    "createdAt": "2018-11-21T06:20:32.232Z",
    "updatedAt": "2018-11-21T06:20:32.232Z",
    "id": "string",
    "isActive": true,
    "isArchived": false,
    "archivedAt": "2018-11-21T06:20:32.232Z",
    "tenantId": "string",
    "organizationId": "string",
    "name": "string",
    "description": "string",
    "status": "string",
    "startDate": "2024-01-15T09:30:00Z",
    "endDate": "2024-01-15T09:30:00Z",
    "public": true,
    "isFavorite": true,
    "parentId": "string",
    "project": {},
    "projectId": "string",
    "children": [
      []
    ],
    "views": [
      []
    ],
    "members": [
      []
    ],
    "tasks": [
      []
    ],
    "organizationSprints": [
      []
    ],
    "teams": [
      []
    ]
  },
  "parentId": "string",
  "project": {},
  "projectId": "string",
  "children": [
    []
  ],
  "views": [
    []
  ],
  "members": [
    []
  ],
  "tasks": [
    []
  ],
  "organizationSprints": [
    []
  ],
  "teams": [
    []
  ],
  "memberIds": [
    "string"
  ],
  "managerIds": [
    "string"
  ]
}`;

const response = await fetch('http://localhost:3000/api/organization-project-modules', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "tenant": {},
  "tenantId": "string",
  "organization": {},
  "organizationId": "string",
  "sentTo": "string",
  "deletedAt": "2018-11-21T06:20:32.232Z",
  "createdAt": "2018-11-21T06:20:32.232Z",
  "updatedAt": "2018-11-21T06:20:32.232Z",
  "id": "string",
  "isActive": true,
  "isArchived": false,
  "archivedAt": "2018-11-21T06:20:32.232Z",
  "name": "string",
  "description": "string",
  "status": "string",
  "startDate": "2024-01-15T09:30:00Z",
  "endDate": "2024-01-15T09:30:00Z",
  "public": true,
  "isFavorite": true,
  "parent": {
    "deletedAt": "2018-11-21T06:20:32.232Z",
    "createdAt": "2018-11-21T06:20:32.232Z",
    "updatedAt": "2018-11-21T06:20:32.232Z",
    "id": "string",
    "isActive": true,
    "isArchived": false,
    "archivedAt": "2018-11-21T06:20:32.232Z",
    "tenantId": "string",
    "organizationId": "string",
    "name": "string",
    "description": "string",
    "status": "string",
    "startDate": "2024-01-15T09:30:00Z",
    "endDate": "2024-01-15T09:30:00Z",
    "public": true,
    "isFavorite": true,
    "parentId": "string",
    "project": {},
    "projectId": "string",
    "children": [
      []
    ],
    "views": [
      []
    ],
    "members": [
      []
    ],
    "tasks": [
      []
    ],
    "organizationSprints": [
      []
    ],
    "teams": [
      []
    ]
  },
  "parentId": "string",
  "project": {},
  "projectId": "string",
  "children": [
    []
  ],
  "views": [
    []
  ],
  "members": [
    []
  ],
  "tasks": [
    []
  ],
  "organizationSprints": [
    []
  ],
  "teams": [
    []
  ],
  "memberIds": [
    "string"
  ],
  "managerIds": [
    "string"
  ]
}'''

response = requests.post(
    'http://localhost:3000/api/organization-project-modules',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
