NAV Navbar
Logo

Introduction

Welcome to the Vaishnava Calendar API.

Health check

GET /api/health-check HTTP/1.1

If the API is running and ready to handle requests

HTTP/1.1 200 OK

Check the API is operating correctly.

HTTP Request

GET /api/health-check

Authentication

Most API endpoints require a valid authorisation token before they can be requested. Retrieve an authorisation token from the Login endpoint before attempting to request other endpoints.

The API expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: Bearer <token>

Login

POST /api/auth/login HTTP/1.1
Content-Type: application/json
{
  "username": "test@test.com",
  "password": "test"
}

If the authentication credentials are valid, the user resource and an authentication token will be returned

HTTP/1.1 200 OK
Content-Type: application/json
{
  "username": "matt@mattstone.com.au",
  "active": true,
  "permissions": [
    "admin",
    "user"
  ],
  "settings": {
    "locationId": "59090a18efec9b0ca76e2d9a",
    "notifications": true,
    "notificationsAdvancePeriod": "1_WEEK"
  },
  "profile": {
    "name": "Matt Stone"
  },
  "id": "59090a18efec9b0ca76e2e18",
  "token": "xxxx"
}

Retrieve an authorization token for a matching user.

HTTP Request

POST /api/auth/login

Request password reset

POST /api/auth/password_reset HTTP/1.1
Content-Type: application/json
{
  "email": "test@test.com"
}

If a matching user is found for the email address

HTTP/1.1 200 OK
Content-Type: application/json
{
  "token": "ba55d53ace8f41413954cd9f57a9f9363b27a23a"
}

Trigger the password reset process for a user with matching email address. If a valid user is found, they will receive an email detailing the password reset process.

HTTP Request

POST /api/auth/password_reset

Confirm password reset

POST /api/auth/password_reset/confirm HTTP/1.1
Content-Type: application/json
{
  "token": "ba55d53ace8f41413954cd9f57a9f9363b27a23a",
  "newPassword": "password2"
}

If a user is found with a matching password reset token

HTTP/1.1 200 OK

Update an existing User’s password if the reset token is correct. This will trigger a password change notification email.

HTTP Request

POST /api/auth/password_reset/confirm

Subjects

Subjects are the content related to personalities, festivals, Ekadasi, etc.

A Subject may have associated Events, which refer to a specific date related to that Subject. For example, the “Padmini Ekadasi” Subject has an Event on the 26th of June.

Get all Subjects

GET /api/subjects HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

Responds with JSON data

HTTP/1.1 200 OK
Content
[
  {
    "id": "59012eb71a345f3ac62927eb",
    "type": "PERSONALITIES",
    "name": "Bhaktivinode Thakur",
    "slug": "bhaktivinode-thakur",
    "content": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
    "excerpt": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "media": {
      "full": "https://s3-us-west-2.amazonaws.com/vcal-handbook/subjects/bhaktivinode-thakur.jpg",
      "thumb": "https://s3-us-west-2.amazonaws.com/vcal-handbook/subjects/bhaktivinode-thakur-thumb.jpg"
    },
    "meta": {
      "disciplicLine": true
    }
  },
  {
    "id": "59012eb71a345f3ac62927ec",
    "type": "PERSONALITIES",
    "name": "Gopala Bhatta Gosvami",
    "slug": "gopala-bhatta-goswami",
    "content": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
    "excerpt": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
    "media": {
      "full": "https://s3-us-west-2.amazonaws.com/vcal-handbook/subjects/bhaktivinode-thakur.jpg",
      "thumb": "https://s3-us-west-2.amazonaws.com/vcal-handbook/subjects/bhaktivinode-thakur-thumb.jpg"
    }
  }
]

Retrieves all Subjects.

HTTP Request

GET /api/subjects

Query Parameters

Parameter Default Description
slug null Filter Subjects to match the passed slug.
skip 0 Number of records to skip.
limit 50 Limit the number of records.

Search Subjects

GET /api/subjects?q=pandavas HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

Responds with JSON data (subset of regular Subject record)

HTTP/1.1 200 OK
Content
[
  {
      "id": "5976a779a6f77634a1ef1eba",
      "name": "Bhagavad-gita, Advent of",
      "slug": "bhagavad-gita-advent-of",
      "type": "CELEBRATIONS"
  },
  {
      "id": "5976a779a6f77634a1ef1f14",
      "name": "Nirjala Ekadasi",
      "slug": "nirjala-ekadasi",
      "type": "EKADASI"
  }
]

Search for Subjects in Elastisearch based on query string.

HTTP Request

GET /api/subjects/search

Query Parameters

Parameter Default Description
q null Elastisearch query.

Get a specific Subject

GET /api/subjects/<subjectId> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

Responds with JSON data

HTTP/1.1 200 OK
Content
{
  "id": "59012eb71a345f3ac62927eb",
  "type": "PERSONALITIES",
  "name": "Bhaktivinode Thakur",
  "slug": "bhaktivinode-thakur",
  "content": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
  "excerpt": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  "media": {
    "full": "https://s3-us-west-2.amazonaws.com/vcal-handbook/subjects/bhaktivinode-thakur.jpg",
    "thumb": "https://s3-us-west-2.amazonaws.com/vcal-handbook/subjects/bhaktivinode-thakur-thumb.jpg"
  },
  "meta": {
    "disciplicLine": true
  }
}

This endpoint retrieves a specific Subject.

HTTP Request

GET /api/subjects/<subjectId>

URL Parameters

Parameter Description
subjectId The ID of the Subject to retrieve

Create a Subject

POST /api/subjects HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>
{
  "type": "EKADASI",
  "name": "Padmini Ekadasi",
  "content": "<p>Lorem ipsum dolor sit amet.</p>",
  "media": {
    "full": "https://s3-us-west-2.amazonaws.com/vcal-handbook/subjects/bhaktivinode-thakur.jpg",
    "thumb": "https://s3-us-west-2.amazonaws.com/vcal-handbook/subjects/bhaktivinode-thakur-thumb.jpg"
  },
  "meta": {
    "key": "value"
  }
}

Returns the newly created Subject

HTTP/1.1 200 OK
Content
{
  "id": "59012eb71a345f3ac62927e7",
  "type": "EKADASI",
  "name": "Padmini Ekadasi",
  "slug": "padmini-ekadasi",
  "content": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
  "media": {
    "full": "https://s3-us-west-2.amazonaws.com/vcal-handbook/subjects/bhaktivinode-thakur.jpg",
    "thumb": "https://s3-us-west-2.amazonaws.com/vcal-handbook/subjects/bhaktivinode-thakur-thumb.jpg"
  },
  "meta": {
    "key": "value"
  }
}

This creates and saves a new Subject. The slug key is optional, if not provided the API will automatically generate it.

This endpoint is limited to users with admin permissions.

HTTP Request

POST /api/subjects

Update a specific Subject

PUT /api/subjects/<subjectId> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>
{
  "name": "Padmini Ekadasi v2"
}

Returns the updated Subject

HTTP/1.1 200 OK
Content
{
  "id": "59012eb71a345f3ac62927e7",
  "type": "EKADASI",
  "name": "Padmini Ekadasi v2",
  "slug": "padmini-ekadasi",
  "content": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
  "media": {
    "full": "https://s3-us-west-2.amazonaws.com/vcal-handbook/subjects/bhaktivinode-thakur.jpg",
    "thumb": "https://s3-us-west-2.amazonaws.com/vcal-handbook/subjects/bhaktivinode-thakur-thumb.jpg"
  }
}

This updates an existing Subject. Not the slug does NOT update, it should be unique and static over the entire life of the record to provide an alternative unique key to the id.

This endpoint is limited to users with admin permissions.

HTTP Request

PUT /api/subjects/<subjectId>

Delete a specific Subject

DELETE /api/subjects/<subjectId> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

If the Subject is deleted successfuly

HTTP/1.1 200 OK
Content

This deletes an existing Subject.

This endpoint is limited to users with admin permissions.

HTTP Request

DELETE /api/subjects/<subjectId>

Events

Events are dates for Events, based on the Vedic astrologically calculated dates for a particular Location.

For example the “Bhaktivinode Thakur” Subject may have a “Bhaktivinode Thakur – Appearance” and “Bhaktivinode Thakur – Disappearance” Events, whose exact dates are determined by a specific geographical Location.

Generally you will be looking up events for a User by their linked Location.

Event dates come in two formats:

Generally the rawDate is perfectly safe to use - an Ekadasi for a Location is the same day regardless of the timezone or DST. The full date is included for future or edge case use.

Get all Events

GET /api/events HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

Responds with JSON data

HTTP/1.1 200 OK
Content
[
  {
    "id": "59012eb71a345f3ac62927f4",
    "locationId": "59012eb71a345f3ac62927de",
    "subjectId": "59012eb71a345f3ac62927eb",
    "name": {
      "title": "Bhaktivinode Thakur",
      "subtitle": "Disappearance"
    },
    "date": "2017-05-17T00:00:00+10:00",
    "rawDate": "2019-07-02"
  },
  {
    "id": "59012eb71a345f3ac62927f5",
    "locationId": "59012eb71a345f3ac62927de",
    "subjectId": "59012eb71a345f3ac62927ec",
    "name": {
      "title": "Gopala Bhatta Gosvami",
      "subtitle": "Disappearance"
    },
    "date": "2017-08-12T00:00:00+10:00",
    "rawDate": "2018-01-05"
  }
]

Another request, this time limited to a specific location

GET /api/events?locationId=<locationId> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

Retrieves all Events. By default all Events across all Locations will be returned, but limiting the results by locationId will give you more useful results.

Events are ordered by ascending date.

HTTP Request

GET /api/events

Query Parameters

Parameter Default Description
locationId null Limit events to a specific location.
startDate null Limit events to after an ISO UTC date.
endDate null Limit events to before an ISO UTC date.
skip 0 Number of records to skip.
limit 50 Limit the number of records.

Search Events

GET /api/events/search?q=chaitanya HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

Responds with JSON data

HTTP/1.1 200 OK
Content
[
  {
      "location": "5976a779a6f77634a1ef1eac",
      "subject": "5976a779a6f77634a1ef1ebf",
      "date": "2017-03-11T14:00:00.000Z",
      "rawDate": "2017-03-12",
      "name": {
          "title": "Chaitanya Mahaprabhu, Lord",
          "subtitle": "Appearance"
      },
      "id": "5976a78a5cda2330c4a2f8fe"
  },
  {
      "location": "5976a779a6f77634a1ef1eac",
      "subject": "5976a779a6f77634a1ef1ebf",
      "date": "2018-03-01T14:00:00.000Z",
      "rawDate": "2018-03-02",
      "name": {
          "title": "Chaitanya Mahaprabhu, Lord",
          "subtitle": "Appearance"
      },
      "id": "5976a7935cda2330c4a2f97f"
  }
]

Search for Events in Elastisearch based on query string.

HTTP Request

GET /api/events/search

Query Parameters

Parameter Default Description
q null Elastisearch query.
locationId null Limit events to a specific location.
startDate null Limit events to after an ISO UTC date.
endDate null Limit events to before an ISO UTC date.
skip 0 Number of records to skip.

Get a specific Event

GET /api/events/<eventId> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

Responds with JSON data

HTTP/1.1 200 OK
Content
{
  "id": "59012eb71a345f3ac62927f4",
  "locationId": "59012eb71a345f3ac62927de",
  "subjectId": "59012eb71a345f3ac62927eb",
  "name": {
    "title": "Bhaktivinode Thakur",
    "subtitle": "Disappearance"
  },
  "date": "2019-07-02T00:00:00+10:00",
  "rawDate": "2019-07-02"
}

This endpoint retrieves a specific Event.

HTTP Request

GET /api/events/<eventId>

URL Parameters

Parameter Description
eventId The ID of the Event to retrieve

Create a Event

POST /api/events HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>
{
  "locationId": "58fd9332045410175707e322",
  "subjectId": "58fd85099cccc115624b35c4",
  "name": {
    "title": "Nrsimhadev, Lord",
    "subtitle": "Appearance"
  },
  "date": "2017-06-17T00:00:00+10:00",
  "rawDate": "2017-06-17"
}

Returns the newly created Event

HTTP/1.1 200 OK
Content
{
  "id": "59012eb71a345f3ac62927ee",
  "locationId": "58fd9332045410175707e322",
  "subjectId": "58fd85099cccc115624b35c4",
  "name": {
    "title": "Nrsimhadev, Lord",
    "subtitle": "Appearance"
  },
  "date": "2017-06-17T00:00:00+10:00",
  "rawDate": "2017-06-17"
}

This creates and saves a new Event.

This endpoint is limited to users with admin permissions.

HTTP Request

POST /api/events

Update a specific Event

PUT /api/events/<eventId> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>
{
  "name": {
    "title": "Padmini Ekadasi"
  },
  "date": "2017-08-17T00:00:00+10:00",
  "rawDate": "2017-08-17"
}

Returns the updated Event

HTTP/1.1 200 OK
Content
{
  "id": "59012eb71a345f3ac62927ef",
  "locationId": "59012eb71a345f3ac62927de",
  "subjectId": "59012eb71a345f3ac62927e7",
  "name": {
    "title": "Padmini Ekadasi"
  },
  "date": "2017-08-17T00:00:00+10:00",
  "rawDate": "2017-08-17"
}

This updates an existing Event.

This endpoint is limited to users with admin permissions.

HTTP Request

PUT /api/events/<eventId>

Delete a specific Event

DELETE /api/events/<eventId> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

If the Event is deleted successfuly

HTTP/1.1 200 OK
Content

This deletes an existing Event.

This endpoint is limited to users with admin permissions.

HTTP Request

DELETE /api/events/<eventId>

Locations

Locations are geographical areas with associated Vedic calendar information about Events.

For example “Brisbane/Australia” will have a different list of Events than “Sydney/Australia” based on the Vedic astrological calculations.

Get all Locations

GET /api/locations HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

Responds with JSON data

HTTP/1.1 200 OK
Content
[
  {
    "id": "59012eb71a345f3ac62927e1",
    "name": "Auckland/New Zealand",
    "timezone": "Pacific/Auckland"
  },
  {
    "id": "59012eb71a345f3ac62927de",
    "name": "Brisbane/Australia",
    "timezone": "Brisbane/Australia"
  }
]

Retrieves all Locations.

HTTP Request

GET /api/locations

Query Parameters

Parameter Default Description
name null Filter Locations to match the passed name.
skip 0 Number of records to skip.
limit 50 Limit the number of records.

Search Locations

GET /api/locations/search?q=new HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

Responds with JSON data

HTTP/1.1 200 OK
Content
[
  {
      "name": "Auckland, New Zealand",
      "timezone": "Pacific/Auckland",
      "keywords": "nz",
      "id": "59012eb71a345f3ac62927e1"
  },
  {
      "name": "New York, USA",
      "timezone": "US/Eastern",
      "keywords": "ny",
      "id": "59012eb71a345f3ac62927de"
  }
]

Search for Locations in Elastisearch based on query string.

HTTP Request

GET /api/locations/search

Query Parameters

Parameter Default Description
q null Elastisearch query.

Get a specific Location

GET /api/locations/<locationId> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

Responds with JSON data

HTTP/1.1 200 OK
Content
{
  "id": "59012eb71a345f3ac62927e1",
  "name": "Auckland/New Zealand",
  "timezone": "Pacific/Auckland"
}

This endpoint retrieves a specific Location.

HTTP Request

GET /api/locations/<locationId>

URL Parameters

Parameter Description
locationId The ID of the Location to retrieve

Create a Location

POST /api/locations HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>
{
  "name": "Timbuktu, Mali",
  "keywords": "timbo tuktuk",
  "timezone": "Africa/Timbuktu"
}

Returns the newly created Location

HTTP/1.1 200 OK
Content
{
  "id": "59012eb71a345f3ac62927e4",
  "name": "Timbuktu, Mali",
  "keywords": "timbo tuktuk",
  "timezone": "Africa/Timbuktu"
}

This creates and saves a new Location.

This endpoint is limited to users with admin permissions.

HTTP Request

POST /api/locations

Update a specific Location

PUT /api/locations/<locationId> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>
{
  "name": "Timbuktu, Mali v2"
}

Returns the updated Location

HTTP/1.1 200 OK
Content
{
  "id": "59012eb71a345f3ac62927e4",
  "name": "Timbuktu, Mali v2",
  "timezone": "Africa/Timbuktu"
}

This updates an existing Location.

This endpoint is limited to users with admin permissions.

HTTP Request

PUT /api/locations/<locationId>

Delete a specific Location

DELETE /api/locations/<locationId> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

If the Location is deleted successfuly

HTTP/1.1 200 OK
Content

This deletes an existing Location.

This endpoint is limited to users with admin permissions.

HTTP Request

DELETE /api/locations/<locationId>

Users

User accounts may belong to application clients (web app, mobile app, etc), or the management team. User accounts will have permissions that limit their access to API endpoints.

Users must retrieve a valid authorisation token before attempting to request data from other API endpoints.

Get all Users

GET /api/users HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

Responds with JSON data

HTTP/1.1 200 OK
Content
[
  {
    "id": "59012eb71a345f3ac62927f7",
    "username": "matt@mattstone.com.au",
    "active": true,
    "permissions": [
      "admin",
      "user"
    ],
    "settings": {
      "location": {
        "id": "590959d831fc9a14f01d5132",
        "name": "Brisbane, Australia",
        "timezone": "Australia/Brisbane"
      },
      "reminders": {
        "enabled": false,
        "schedule": "3_DAYS"
      },
      "notifications": {
        "enabled": true,
        "time": "06:30"
      }
    },
    "profile": {
      "name": "Matt Stone"
    }
  },
  {
    "id": "59012eb71a345f3ac62927f8",
    "username": "bhavani_dasi@hotmail.com",
    "active": true,
    "permissions": [
      "user"
    ],
    "settings": {
      "location": {
        "id": "590959d831fc9a14f01d5132",
        "name": "Brisbane, Australia",
        "timezone": "Australia/Brisbane"
      },
      "reminders": {
        "enabled": true,
        "schedule": "1_WEEK"
      },
      "notifications": {
        "enabled": true,
        "time": "09:30"
      }
    },
    "profile": {
      "name": "Bhavani Stone"
    }
  }
]

Retrieves all Users.

This endpoint is limited to users with admin permissions.

HTTP Request

GET /api/users

Query Parameters

Parameter Default Description
skip 0 Number of records to skip.
limit 50 Limit the number of records.

Get a specific User

GET /api/users/<userId> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

Responds with JSON data

HTTP/1.1 200 OK
Content
{
  "id": "59012eb71a345f3ac62927f8",
  "username": "bhavani_dasi@hotmail.com",
  "active": true,
  "permissions": [
    "user"
  ],
  "settings": {
    "location": {
      "id": "590959d831fc9a14f01d5132",
      "name": "Brisbane, Australia",
      "timezone": "Australia/Brisbane"
    },
    "reminders": {
      "enabled": false,
      "schedule": "3_DAYS"
    },
    "notifications": {
      "enabled": true,
      "time": "06:30"
    }
  },
  "profile": {
    "name": "Bhavani Stone"
  }
}

This endpoint retrieves a specific User.

This endpoint is limited to users with admin permissions, or user records that match the authentication token passed in the headers.

HTTP Request

GET /api/users/<userId>

URL Parameters

Parameter Description
userId The ID of the User to retrieve

Get the current User

GET /api/users/current HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

Responds with JSON data

HTTP/1.1 200 OK
Content
{
  "id": "59090a18efec9b0ca76e2e18",
  "username": "matt@mattstone.com.au",
  "active": true,
  "permissions": [
    "admin",
    "user"
  ],
  "settings": {
    "location": {
      "id": "590959d831fc9a14f01d5132",
      "name": "Brisbane, Australia",
      "timezone": "Australia/Brisbane"
    },
    "reminders": {
      "enabled": false,
      "schedule": "3_DAYS"
    },
    "notifications": {
      "enabled": true,
      "time": "06:30"
    }
  },
  "profile": {
    "name": "Matt Stone"
  }
}

This endpoint retrieves the user associated with the passed authentication token.

HTTP Request

GET /api/users/current

Create a User

POST /api/users HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>
{
  "username": "test@test.com",
  "password": "javascript",
  "permissions": [
    "user"
  ],
  "settings": {
    "location": "590959d831fc9a14f01d5132",
    "reminders": {
      "enabled": true
    },
    "notifications": {
      "enabled": true,
      "time": "11:30"
    }
  },
  "profile": {
    "name": "Test Stone"
  }
}

Returns the newly created User

HTTP/1.1 200 OK
Content
{
  "id": "59016f67424b22420f470631",
  "username": "test@test.com",
  "password": "javascript",
  "permissions": [
    "user"
  ],
  "settings": {
    "location": {
      "id": "590959d831fc9a14f01d5132",
      "name": "Brisbane, Australia",
      "timezone": "Australia/Brisbane"
    },
    "reminders": {
      "enabled": true,
      "schedule": "3_DAYS"
    },
    "notifications": {
      "enabled": true,
      "time": "11:30"
    }
  },
  "profile": {
    "name": "Test Stone"
  }
}

This creates and saves a new User. The user will receive an email with their new account details.

This endpoint is limited to users with admin permissions.

HTTP Request

POST /api/users

Update a specific User

PUT /api/users/<userId> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>
{
  "profile": {
    "name": "Roger Stone"
  }
}

Returns the updated User

HTTP/1.1 200 OK
Content
{
  "id": "59012eb71a345f3ac62927f8",
  "username": "bhavani_dasi@hotmail.com",
  "active": true,
  "permissions": [
    "user"
  ],
  "settings": {
    "location": {
      "id": "590959d831fc9a14f01d5132",
      "name": "Brisbane, Australia",
      "timezone": "Australia/Brisbane"
    },
    "reminders": {
      "enabled": true,
      "schedule": "3_DAYS"
    },
    "notifications": {
      "enabled": true,
      "time": "11:30"
    }
  },
  "profile": {
    "name": "Roger Stone"
  }
}

This updates an existing User. This endpoint does not allow for updating the User’s email address (username), or password. Updating those settings requires usage of the Update a specific User’s email address and Update specific User’s password endpoints.

This endpoint is limited to users with admin permissions, or user records that match the authentication token passed in the headers.

HTTP Request

PUT /api/users/<userId>

Update a specific User’s email address

PUT /api/users/<userId>/email_update HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>
{
  "currentPassword": "password1",
  "email": "nitchy.s@gmail.com"
}

Returns the updated User

HTTP/1.1 200 OK
Content
{
  "id": "59012eb71a345f3ac62927f7",
  "username": "nitchy.s@gmail.com",
  "active": true,
  "permissions": [
    "admin",
    "user"
  ],
  "settings": {
    "location": {
      "id": "590959d831fc9a14f01d5132",
      "name": "Brisbane, Australia",
      "timezone": "Australia/Brisbane"
    },
    "reminders": {
      "enabled": true,
      "schedule": "3_DAYS"
    },
    "notifications": {
      "enabled": true,
      "time": "11:30"
    }
  },
  "profile": {
    "name": "Matt Stone"
  }
}

This updates an existing User’s email address, which is also their username. This will trigger an email to begin the new email confirmation process.

This endpoint is limited to users with admin permissions, or user records that match the authentication token passed in the headers.

HTTP Request

PUT /api/users/<userId>/email_update

Update a specific User’s password

PUT /api/users/<userId>/password_update HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>
{
  "currentPassword": "password1",
  "newPassword": "password2"
}

Returns the updated User

HTTP/1.1 200 OK
Content
{
  "id": "59012eb71a345f3ac62927f7",
  "username": "nitchy.s@gmail.com",
  "active": true,
  "permissions": [
    "admin",
    "user"
  ],
  "settings": {
    "location": {
      "id": "590959d831fc9a14f01d5132",
      "name": "Brisbane, Australia",
      "timezone": "Australia/Brisbane"
    },
    "reminders": {
      "enabled": true,
      "schedule": "3_DAYS"
    },
    "notifications": {
      "enabled": true,
      "time": "11:30"
    }
  },
  "profile": {
    "name": "Matt Stone"
  }
}

Update an existing User’s password if the current password is correct. This will trigger a password change notification email.

This endpoint is limited to users with admin permissions, or user records that match the authentication token passed in the headers.

HTTP Request

PUT /api/users/<userId>/password_update

Delete a specific User

DELETE /api/users/<userId> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <token>

If the User is deleted successfuly

HTTP/1.1 200 OK
Content

This deletes an existing User.

This endpoint is limited to users with admin permissions.

HTTP Request

DELETE /api/users/<userId>

Errors

Error Code Meaning
400 Bad Request – Your request sucks
401 Unauthorized – Your API key is wrong
403 Forbidden – The resource requested is hidden for administrators only
404 Not Found – The specified resource could not be found
405 Method Not Allowed – You tried to access a resource with an invalid method
406 Not Acceptable – You requested a format that isn’t json
410 Gone – The resource requested has been removed from our servers
418 I’m a teapot
429 Too Many Requests – You’re requesting too many resources! Slow down!
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarily offline for maintenance. Please try again later.