# Create new record

`POST /api/organization-sprint`

Authentication (security requirement alternatives):

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

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

Request body: application/json (required)

Type: object

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

- `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"
  ```

- `tenantId` (optional)
  Type: string

- `organizationId` (optional)
  Type: string

- `name` (required)
  Type: string

- `goal` (required)
  Type: string

- `length` (required)
  Type: number

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

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

- `status` (optional)
  Type: string
  
  enum: ["active","completed","draft","upcoming"]

- `dayStart` (optional)
  Type: number
  
  enum: [1,2,3,4,5,6,7]

- `sprintProgress` (optional)
  Type: object

- `project` (required)
  Reference: [OrganizationProject](https://sourcey-gauzy.pages.dev/api-reference/models/organizationproject/index.md); Type: object

- `projectId` (required)
  Type: string

- `tasks` (required)
  Reference: [Task](https://sourcey-gauzy.pages.dev/api-reference/models/task/index.md); Type: object

- `tenant` (optional)
  Type: object

- `organization` (required)
  Type: object

- `sentTo` (optional)
  Type: string

- `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-sprint' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "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",
  "goal": "string",
  "length": 0,
  "startDate": "2024-01-15T09:30:00Z",
  "endDate": "2024-01-15T09:30:00Z",
  "status": "active",
  "dayStart": 1,
  "sprintProgress": {},
  "project": {
    "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",
    "startDate": "string",
    "endDate": "string",
    "billing": "FLAT_FEE",
    "currency": "USD",
    "public": true,
    "owner": "CLIENT",
    "taskListType": "GRID",
    "code": "string",
    "description": "string",
    "color": "string",
    "billable": true,
    "billingFlat": true,
    "openSource": true,
    "projectUrl": "string",
    "openSourceProjectUrl": "string",
    "budget": 0,
    "budgetType": "hours",
    "imageUrl": "string",
    "icon": "string",
    "status": "open",
    "isTasksAutoSync": true,
    "isTasksAutoSyncOnLabel": true,
    "syncTag": "string",
    "archiveTasksIn": 0,
    "closeTasksIn": 0,
    "organizationContactId": "string",
    "imageId": "string",
    "defaultAssigneeId": "string"
  },
  "projectId": "string",
  "tasks": {
    "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",
    "title": "string",
    "description": "string",
    "status": "string",
    "priority": "string",
    "size": "string",
    "issueType": "string",
    "estimate": 0,
    "dueDate": "2024-01-15T09:30:00Z",
    "public": true,
    "startDate": "2024-01-15T09:30:00Z",
    "resolvedAt": "2024-01-15T09:30:00Z",
    "version": "string",
    "isDraft": true,
    "isScreeningTask": true,
    "parentId": "string",
    "project": {},
    "projectId": "string",
    "organizationSprint": {},
    "organizationSprintId": "string",
    "taskStatus": {},
    "taskStatusId": "string",
    "taskSize": {},
    "taskSizeId": "string",
    "taskPriority": {},
    "taskPriorityId": "string",
    "taskType": {
      "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",
      "value": "string",
      "description": "string",
      "icon": "string",
      "color": "string",
      "isDefault": false,
      "isSystem": false,
      "imageId": "string",
      "projectId": "string",
      "organizationTeamId": "string"
    },
    "taskTypeId": "string",
    "tags": [
      []
    ],
    "members": [
      []
    ],
    "teams": [
      []
    ],
    "modules": [
      []
    ]
  },
  "tenant": {},
  "organization": {},
  "sentTo": "string",
  "memberIds": [
    "string"
  ],
  "managerIds": [
    "string"
  ]
}'
```

### JavaScript

```javascript
const body = `{
  "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",
  "goal": "string",
  "length": 0,
  "startDate": "2024-01-15T09:30:00Z",
  "endDate": "2024-01-15T09:30:00Z",
  "status": "active",
  "dayStart": 1,
  "sprintProgress": {},
  "project": {
    "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",
    "startDate": "string",
    "endDate": "string",
    "billing": "FLAT_FEE",
    "currency": "USD",
    "public": true,
    "owner": "CLIENT",
    "taskListType": "GRID",
    "code": "string",
    "description": "string",
    "color": "string",
    "billable": true,
    "billingFlat": true,
    "openSource": true,
    "projectUrl": "string",
    "openSourceProjectUrl": "string",
    "budget": 0,
    "budgetType": "hours",
    "imageUrl": "string",
    "icon": "string",
    "status": "open",
    "isTasksAutoSync": true,
    "isTasksAutoSyncOnLabel": true,
    "syncTag": "string",
    "archiveTasksIn": 0,
    "closeTasksIn": 0,
    "organizationContactId": "string",
    "imageId": "string",
    "defaultAssigneeId": "string"
  },
  "projectId": "string",
  "tasks": {
    "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",
    "title": "string",
    "description": "string",
    "status": "string",
    "priority": "string",
    "size": "string",
    "issueType": "string",
    "estimate": 0,
    "dueDate": "2024-01-15T09:30:00Z",
    "public": true,
    "startDate": "2024-01-15T09:30:00Z",
    "resolvedAt": "2024-01-15T09:30:00Z",
    "version": "string",
    "isDraft": true,
    "isScreeningTask": true,
    "parentId": "string",
    "project": {},
    "projectId": "string",
    "organizationSprint": {},
    "organizationSprintId": "string",
    "taskStatus": {},
    "taskStatusId": "string",
    "taskSize": {},
    "taskSizeId": "string",
    "taskPriority": {},
    "taskPriorityId": "string",
    "taskType": {
      "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",
      "value": "string",
      "description": "string",
      "icon": "string",
      "color": "string",
      "isDefault": false,
      "isSystem": false,
      "imageId": "string",
      "projectId": "string",
      "organizationTeamId": "string"
    },
    "taskTypeId": "string",
    "tags": [
      []
    ],
    "members": [
      []
    ],
    "teams": [
      []
    ],
    "modules": [
      []
    ]
  },
  "tenant": {},
  "organization": {},
  "sentTo": "string",
  "memberIds": [
    "string"
  ],
  "managerIds": [
    "string"
  ]
}`;

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

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

### Python

```python
import requests

body = '''{
  "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",
  "goal": "string",
  "length": 0,
  "startDate": "2024-01-15T09:30:00Z",
  "endDate": "2024-01-15T09:30:00Z",
  "status": "active",
  "dayStart": 1,
  "sprintProgress": {},
  "project": {
    "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",
    "startDate": "string",
    "endDate": "string",
    "billing": "FLAT_FEE",
    "currency": "USD",
    "public": true,
    "owner": "CLIENT",
    "taskListType": "GRID",
    "code": "string",
    "description": "string",
    "color": "string",
    "billable": true,
    "billingFlat": true,
    "openSource": true,
    "projectUrl": "string",
    "openSourceProjectUrl": "string",
    "budget": 0,
    "budgetType": "hours",
    "imageUrl": "string",
    "icon": "string",
    "status": "open",
    "isTasksAutoSync": true,
    "isTasksAutoSyncOnLabel": true,
    "syncTag": "string",
    "archiveTasksIn": 0,
    "closeTasksIn": 0,
    "organizationContactId": "string",
    "imageId": "string",
    "defaultAssigneeId": "string"
  },
  "projectId": "string",
  "tasks": {
    "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",
    "title": "string",
    "description": "string",
    "status": "string",
    "priority": "string",
    "size": "string",
    "issueType": "string",
    "estimate": 0,
    "dueDate": "2024-01-15T09:30:00Z",
    "public": true,
    "startDate": "2024-01-15T09:30:00Z",
    "resolvedAt": "2024-01-15T09:30:00Z",
    "version": "string",
    "isDraft": true,
    "isScreeningTask": true,
    "parentId": "string",
    "project": {},
    "projectId": "string",
    "organizationSprint": {},
    "organizationSprintId": "string",
    "taskStatus": {},
    "taskStatusId": "string",
    "taskSize": {},
    "taskSizeId": "string",
    "taskPriority": {},
    "taskPriorityId": "string",
    "taskType": {
      "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",
      "value": "string",
      "description": "string",
      "icon": "string",
      "color": "string",
      "isDefault": false,
      "isSystem": false,
      "imageId": "string",
      "projectId": "string",
      "organizationTeamId": "string"
    },
    "taskTypeId": "string",
    "tags": [
      []
    ],
    "members": [
      []
    ],
    "teams": [
      []
    ],
    "modules": [
      []
    ]
  },
  "tenant": {},
  "organization": {},
  "sentTo": "string",
  "memberIds": [
    "string"
  ],
  "managerIds": [
    "string"
  ]
}'''

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