API v3
Sections: List projects | Show a project | List passwords of a project | List of users who can access a project | Create a project | Update a project | Archive/un-archive a project | Delete a project
List projects
These return the projects that the user has access to. The returned data is the same as in the projects lists (all active, archived, favorite and search) in the web interface.
GET /projects.json GET /projects/archived.json GET /projects/favorite.json GET /projects/search/urlencoded_string.json
The responses from these requests are paginated and /count.json
and /page/num.json
can be used. See the section on pagination for more information. Example: GET /projects/page/2.json
If successful, the response code is 200 OK
with the results of the call in the response body.
Example response body:
[ { "id": 24, "name": "Project created with the API", "tags": "client,seo,website", "managed_by": { "id": 1, "name": "John Boss" }, "archived": false, "favorite": true, "num_files": 0, "updated_on": "2014-07-04 14:02:14" }, { "id": 12, "name": "www.fictionalgadgetsite.com", "tags": "client", "managed_by": { "id": 3, "username": "claire", "email_address": "claire@teampasswordmanager.com", "name": "Claire Wood", "role": "Project manager" }, "archived": false, "favorite": false, "num_files": 0, "updated_on": "2014-07-03 19:13:37" } ]
Show a project
This method returns all the data of a project, identified by its internal id.
GET /projects/ID.json
If successful, the response code is 200 OK
with the results of the call in the response body.
Example response body:
{ "id": 12, "name": "www.fictionalgadgetsite.com", "tags": "client", "notes": "This are the notes of the project", "managed_by": { "id": 3, "username": "claire", "email_address": "claire@teampasswordmanager.com", "name": "Claire Wood", "role": "Project manager" }, "everyone_has_access": false, "users_access": [ { "id": 3, "username": "claire", "email_address": "claire@teampasswordmanager.com", "name": "Claire Wood", "role": "Project manager" }, { "id": 7, "username": "janine@teampasswordmanager.com", "email_address": "janine@teampasswordmanager.com", "name": "Janine Black", "role": "Normal user" }, { "id": 18, "username": "alan", "email_address": "Alan.Hall@teampasswordmanager.com", "name": "Alan Hall", "role": "Normal user" } ], "groups_access": [ { "id": 1, "name": "Web work" }, { "id": 2, "name": "IT works" } ], "num_passwords": 7, "num_files": 0, "user_permission": "manage", "user_can_create_passwords": true, "archived": false, "favorite": true, "created_on": "2014-06-05 16:35:18", "created_by": { "id": 3, "username": "claire", "email_address": "claire@teampasswordmanager.com", "name": "Claire Wood", "role": "Project manager" }, "updated_on": "2014-07-23 18:19:02", "updated_by": { "id": 1, "username": "john", "email_address": "john@teampasswordmanager.com", "name": "John Boss", "role": "Admin" } }
Notes:
- user_permission indicates what permission has the user making the request on the project. It can be "read" or "manage".
- user_can_create_passwords indicates if the user making the request can create passwords on the project. It can be true or false.
List passwords of a project
This method returns the passwords of a project, identified by its internal id. This call shows the same data as the "Passwords" tab of a project.
GET /projects/ID/passwords.json
The response from this request is paginated and /count.json
and /page/num.json
can be used. See the section on pagination for more information. Example: GET /projects/12/passwords/count.json
If successful, the response code is 200 OK
with the results of the call in the response body.
Example response body:
[ { "id": 68, "name": "Wordpress admin", "project": { "id": 12, "name": "www.fictionalgadgetsite.com" }, "notes_snippet": "some notes\nother notes", "tags": "wordpress", "access_info": "http:\/\/www.fictionalgadgetsite.com\/wp-admin", "username": "admin_sg", "email": "", "archived": false, "favorite": true, "num_files": 1, "updated_on": "2014-07-23 18:18:28" }, { "id": 175, "name": "Sample password", "project": { "id": 12, "name": "www.fictionalgadgetsite.com" }, "notes_snippet": "Some notes \nAnother line of the notes", "tags": "tag1,tag2", "access_info": "https:\/\/www.google.com", "username": "thisisausername", "email": "ferran@ferranbarba.com", "archived": false, "favorite": true, "num_files": 0, "updated_on": "2014-07-23 18:18:06" }, ... ]
List users who can access a project
This method returns the users that have access to a project, identified by its internal id. This call shows similar data as the "Security" tab of a project.
GET /projects/ID/security.json
If successful, the response code is 200 OK
with the results of the call in the response body.
Example response body:
[ { "user": { "id": 18, "username": "alan", "email_address": "Alan.Hall@teampasswordmanager.com", "name": "Alan Hall", "role": "Normal user" }, "access_type": "Read" }, { "user": { "id": 3, "username": "claire", "email_address": "claire@teampasswordmanager.com", "name": "Claire Wood", "role": "Project manager" }, "access_type": "Manage" }, ... ]
Create a project
POST /projects.json
The request body must include the data for the project (the only required field is name):
{ "name": "Name of the project", "tags": "tag1,tag2,tag3", ... }
If successful, the response code is 201 Created
with the internal id of the project in the response body:
{ "id": 41 }
The following fields can be used when creating a project: 'name' (the only required field), 'tags' (list of comma separated strings), 'notes', 'managed_by' (user id), 'everyone_has_access' (true/false), 'users_access' (array of user ids), 'groups_access' (array of group ids).
Notes: 'everyone_has_access', if true, has precedence over 'users_access' and 'groups_access'. 'managed_by', if present, cannot be 0. To delete access to users/groups set the corresponding fields to an empty array ([]).
To get the users in your Team Password Manager installation you can use GET /users.json
and the groups GET /groups.json
.
Update a project
PUT /projects/ID.json
The request body must include the data for the project. Only the fields that are included are updated, the other fields are left unchanged:
{ "name": "Name of the project", "tags": "tag1,tag2,tag3", ... }
If successful, the response code is 204 No content
and the response body is empty.
The following fields can be used when updating a project: 'name', 'tags' (list of comma separated strings), 'notes', 'managed_by' (user id), 'everyone_has_access' (true/false), 'users_access' (array of user ids), 'groups_access' (array of group ids).
Notes: the 'name', if present, can't be empty. 'everyone_has_access', if true, has precedence over 'users_access' and 'groups_access'. 'managed_by', if present, cannot be 0. To delete access to users/groups set the corresponding fields to an empty array ([]).
To get the users in your Team Password Manager installation you can use GET /users.json
and the groups GET /groups.json
.
Archive/un-archive a project
PUT /projects/ID/archive.json
PUT /projects/ID/unarchive.json
If successful, the response code is 204 No content
and the response body is empty.
Delete a project
DELETE /projects/ID.json
This deletes the project, its passwords, files, etc.
If successful, the response code is 204 No content
and the response body is empty.