https://github.com/hoodiehq/account-json-api
REST-API Blueprint for all things user accounts and sesions
https://github.com/hoodiehq/account-json-api
Last synced: 5 months ago
JSON representation
REST-API Blueprint for all things user accounts and sesions
- Host: GitHub
- URL: https://github.com/hoodiehq/account-json-api
- Owner: hoodiehq
- License: apache-2.0
- Created: 2015-07-15T21:46:40.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-05-22T00:54:16.000Z (about 8 years ago)
- Last Synced: 2025-10-20T21:47:34.967Z (8 months ago)
- Language: API Blueprint
- Homepage: http://docs.accountjsonapi.apiary.io
- Size: 35.2 KB
- Stars: 35
- Watchers: 32
- Forks: 17
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-projects - account-json-api - REST-API Blueprint for all things user accounts and sesions ⭐36 `API Blueprint` (📦 Legacy & Inactive Projects)
README
# account-json-api
> RESTful JSON API-blueprint for all things user accounts
[](https://www.npmjs.com/package/account-json-api)
[](https://travis-ci.org/hoodiehq/account-json-api)
This is a [JSON API v1.0](http://jsonapi.org/format/) compliant specification
for a generic REST API for all things user accounts.
## Summary
```
PUT /session
GET /session
DELETE /session
PUT /session/account
GET /session/account
PATCH /session/account
DELETE /session/account
GET /session/account/profile
PATCH /session/account/profile
# Password resets, upgrades, etc.
GET /requests
POST /requests
GET /requests/{id}
DELETE /requests/{id}
# Admin only
POST /accounts
GET /accounts
GET /accounts/{id}
PATCH /accounts/{id}
DELETE /accounts/{id}
GET /accounts/{id}/profile
PATCH /accounts/{id}/profile
POST /accounts/{id}/sessions
```
Find the full spec at http://docs.accountjsonapi.apiary.io
## Example
Request
```
PUT /session
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
"data": {
"type": "session",
"attributes": {
"username": "john-doe",
"password": "secret"
}
}
}
```
Response
```
{
"links": {
"self": "https://example.com/session"
},
"data": {
"id": "sessionid123",
"type": "session",
"relationships": {
"account": {
"links": {
"related": "https://example.com/session/account"
},
"data": {
"id": "abc1234",
"type": "account"
}
}
}
},
"included": [{
"id": "abc1234",
"type": "account",
"attributes": {
"username": "jane-doe"
},
"relationships": {
"profile": {
"links": {
"related": "https://example.com/session/account/profile"
},
"data": {
"id": "abc1234-profile",
"type": "accountProfile"
}
}
}
}]
}
```
## Implementations
The `account-json-api` is currently being implemented by [Hoodie](http://hood.ie)
in the [hoodie-server-account](https://github.com/hoodiehq/hoodie-server-account)
module.
## License
MIT