Open App

Routine Blocks

API endpoints for routine blocks

List routine blocks

GET /api/v1/routine_blocks

Parameters

NameInTypeRequiredDescription
datequerystringNoYYYY-MM-DD
templateIdquerystringNo
categoryIdquerystringNo

Example request

curl -X GET \
"https://api.usemonoid.com/api/v1/routine_blocks?date=<date>&templateId=<templateId>&categoryId=<categoryId>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"

Example response

Status: 200

{
  "data": [
    {
      "_id": "string",
      "userId": "string",
      "organisationId": "string",
      "templateId": "string",
      "dayOfWeek": 0,
      "date": "string",
      "startTime": "string",
      "endTime": "string",
      "name": "string",
      "categoryId": "string",
      "content": "string",
      "blockType": "routine",
      "color": "string",
      "updatedAt": 0
    }
  ]
}

Other statuses: 401, 403.

Response body type

{ data: RoutineBlock[] }


Create routine block

POST /api/v1/routine_blocks

Example request

curl -X POST \
"https://api.usemonoid.com/api/v1/routine_blocks" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"
-d '{"name":"string","startTime":"string","endTime":"string","organisationId":"string","templateId":"string","dayOfWeek":0,"date":"string","categoryId":"string","content":"string","blockType":"routine","color":"string"}'

Example response

Status: 201

{
  "data": {
    "_id": "string",
    "userId": "string",
    "organisationId": "string",
    "templateId": "string",
    "dayOfWeek": 0,
    "date": "string",
    "startTime": "string",
    "endTime": "string",
    "name": "string",
    "categoryId": "string",
    "content": "string",
    "blockType": "routine",
    "color": "string",
    "updatedAt": 0
  }
}

Other statuses: 400, 401, 403, 500.

Response body type

{ data: RoutineBlock }


Get routine block by id

GET /api/v1/routine_blocks/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesPath parameter.

Example request

curl -X GET \
"https://api.usemonoid.com/api/v1/routine_blocks/<id>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"

Example response

Status: 200

{
  "data": {
    "_id": "string",
    "userId": "string",
    "organisationId": "string",
    "templateId": "string",
    "dayOfWeek": 0,
    "date": "string",
    "startTime": "string",
    "endTime": "string",
    "name": "string",
    "categoryId": "string",
    "content": "string",
    "blockType": "routine",
    "color": "string",
    "updatedAt": 0
  }
}

Other statuses: 401, 403, 404.

Response body type

{ data: RoutineBlock }


Update routine block

PATCH /api/v1/routine_blocks/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesPath parameter.

Example request

curl -X PATCH \
"https://api.usemonoid.com/api/v1/routine_blocks/<id>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"
-d '{"name":"string","startTime":"string","endTime":"string","organisationId":"string","templateId":"string","dayOfWeek":0,"date":"string","categoryId":"string","content":"string","blockType":"routine","color":"string"}'

Example response

Status: 200

{
  "data": {
    "_id": "string",
    "userId": "string",
    "organisationId": "string",
    "templateId": "string",
    "dayOfWeek": 0,
    "date": "string",
    "startTime": "string",
    "endTime": "string",
    "name": "string",
    "categoryId": "string",
    "content": "string",
    "blockType": "routine",
    "color": "string",
    "updatedAt": 0
  }
}

Other statuses: 400, 401, 403, 404, 500.

Response body type

{ data: RoutineBlock }


Delete routine block

DELETE /api/v1/routine_blocks/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesPath parameter.

Example request

curl -X DELETE \
"https://api.usemonoid.com/api/v1/routine_blocks/<id>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"

Other statuses: 401, 403, 404, 500.

Response body type