Open App

Organisations

API endpoints for organisations

List organisations

GET /api/v1/organisations

Example request

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

Example response

Status: 200

{
  "data": [
    {
      "_id": "string",
      "id": "string",
      "name": "string",
      "members": [
        {}
      ],
      "plan": {
        "customerId": "string",
        "productId": "string",
        "productName": "string",
        "status": "string",
        "startsAt": "string",
        "endsAt": "string",
        "canceledAt": "string"
      }
    }
  ]
}

Other statuses: 401, 403.

Response body type

{ data: Organisation[] }


Create organisation

POST /api/v1/organisations

Example request

curl -X POST \
"https://api.usemonoid.com/api/v1/organisations" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"
-d '{"id":"string","name":"string"}'

Example response

Status: 201

{
  "data": {
    "_id": "string",
    "id": "string",
    "name": "string",
    "members": [
      {
        "userId": "string",
        "role": "string",
        "email": "string",
        "name": "string",
        "imageUrl": "string"
      }
    ],
    "plan": {
      "customerId": "string",
      "productId": "string",
      "productName": "string",
      "status": "string",
      "startsAt": "string",
      "endsAt": "string",
      "canceledAt": "string"
    }
  }
}

Other statuses: 400, 401, 403, 500.

Response body type

{ data: Organisation }


Get organisation by id

GET /api/v1/organisations/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesPath parameter.
includeMembersquerybooleanNoInclude organisation members in response.
includePlanquerybooleanNoInclude organisation billing plan summary in response.

Example request

curl -X GET \
"https://api.usemonoid.com/api/v1/organisations/<id>?includeMembers=<includeMembers>&includePlan=<includePlan>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"

Example response

Status: 200

{
  "data": {
    "_id": "string",
    "id": "string",
    "name": "string",
    "members": [
      {
        "userId": "string",
        "role": "string",
        "email": "string",
        "name": "string",
        "imageUrl": "string"
      }
    ],
    "plan": {
      "customerId": "string",
      "productId": "string",
      "productName": "string",
      "status": "string",
      "startsAt": "string",
      "endsAt": "string",
      "canceledAt": "string"
    }
  }
}

Other statuses: 401, 403, 404.

Response body type

{ data: Organisation }


Update organisation

PATCH /api/v1/organisations/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesPath parameter.

Example request

curl -X PATCH \
"https://api.usemonoid.com/api/v1/organisations/<id>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"
-d '{"name":"string"}'

Example response

Status: 200

{
  "data": {
    "_id": "string",
    "id": "string",
    "name": "string",
    "members": [
      {
        "userId": "string",
        "role": "string",
        "email": "string",
        "name": "string",
        "imageUrl": "string"
      }
    ],
    "plan": {
      "customerId": "string",
      "productId": "string",
      "productName": "string",
      "status": "string",
      "startsAt": "string",
      "endsAt": "string",
      "canceledAt": "string"
    }
  }
}

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

Response body type

{ data: Organisation }


Delete organisation

DELETE /api/v1/organisations/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesPath parameter.

Example request

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

Other statuses: 401, 403, 404, 500.

Response body type