Legacy API Docs. These docs are for Virtool 4.3.3.

Account

These endpoints allow management of the user account associated with the current session or API key.

Unauthorized clients will receive 401 Unauthorized for calls to all account endpoints.

Get

Get the complete respresentation for the account associated with the current session or API key.

GET
/api/account

Example

GET /api/account

Response

Status: 200 OK

{
  "administrator": true,
  "groups": [],
  "identicon": "6be6d0a72a16cb633144ec03cdaef77804c6f94770184f83e0899fe6bdcb77ee",
  "settings": {
    "skip_quick_analyze_dialog": true,
    "show_ids": false,
    "show_versions": false,
    "quick_analyze_algorithm": "pathoscope_bowtie"
  },
  "permissions": {
    "cancel_job": true,
    "create_ref": true,
    "create_sample": true,
    "modify_hmm": true,
    "modify_subtraction": true,
    "remove_file": true,
    "remove_job": true,
    "upload_file": true
  },
  "primary_group": "",
  "last_password_change": "2018-04-27T22:49:11.654000Z",
  "email": "[email protected]",
  "id": "igboyes"
}

Errors

StatusMessageReason
401Requires authorizationrequest is not associated with an authorized session or API key

Update

Change the email address associated with the account associated with the current session or API key.

PATCH
/account

Input

NameTypeRequiredDescription
emailstringfalsean email address
old_passwordstringfalsethe old password for verification
new_passwordstringfalsethe new password

Example

PATCH /api/account

{
  "email": "[email protected]"
}

Response

Status:

{
  "administrator": true,
  "groups": [],
  "identicon": "6be6d0a72a16cb633144ec03cdaef77804c6f94770184f83e0899fe6bdcb77ee",
  "settings": {
    "skip_quick_analyze_dialog": true,
    "show_ids": false,
    "show_versions": false,
    "quick_analyze_algorithm": "pathoscope_bowtie"
  },
  "permissions": {
    "cancel_job": true,
    "create_ref": true,
    "create_sample": true,
    "modify_hmm": true,
    "modify_subtraction": true,
    "remove_file": true,
    "remove_job": true,
    "upload_file": true
  },
  "primary_group": "",
  "last_password_change": "2018-04-27T22:49:11.654000Z",
  "email": "[email protected]",
  "id": "igboyes"
}

Errors

StatusMessageReason
400Invalid old passwordsupplied old password is invalid
401Requires authorizationrequest is not associated with an authorized session or API key
422Invalid inputemail address is invalid or password fields are missing or invalid
401Requires authorizationrequest is not associated with an authorized session or API key

Get Settings

Get the settings for the account associated with the current session or API key.

GET
/api/account/settings

Example

GET /api/account/settings

Response

Status: 200 OK

{
  "skip_quick_analyze_dialog": true,
  "show_ids": false,
  "show_versions": false,
  "quick_analyze_algorithm": "pathoscope_bowtie"
}

Errors

StatusMessageReason
401Requires authorizationrequest is not associated with an authorized session or API key

Edit Settings

Update the settings for the account associated with the current session or API key. All fields are optional.

PATCH
/api/account/settings

Input

NameTypeDescription
quick_analyze_algorithmstringalgorithm to use for quick analysis
skip_quick_analyze_dialogbooleandon’t show the quick analysis dialog
show_idsbooleanshow document ids in client in where possible
show_versionsbooleanshow document versions in client where possible

Example

PATCH /api/account/settings

{
  "show_ids": true
}

Response

Status: 200 OK

{
  "skip_quick_analyze_dialog": true,
  "show_ids": true,
  "show_versions": false,
  "quick_analyze_algorithm": "pathoscope_bowtie"
}

Errors

StatusMessageReason
401Requires authorizationrequest is not associated with an authorized session or API key
422Invalid inputinvalid settings key or value

List API Keys

List all API keys for the active account. The keys themselves are not returned.

GET
/api/account/keys

Example

GET /api/account/keys

Response

Status: 200 OK

[
  {
    "id": "test_0",
    "name": "Test",
    "administrator": true,
    "groups": [],
    "permissions": {
      "cancel_job": true,
      "create_ref": true,
      "create_sample": true,
      "modify_hmm": true,
      "modify_subtraction": true,
      "remove_file": true,
      "remove_job": true,
      "upload_file": true
    },
    "created_at": "2018-05-01T19:47:03.334000Z"
  }
]

Errors

StatusMessageReason
401Requires authorizationrequest is not associated with an authorized session or API key

Update API Key

Change the permissions of an existing API key.

PATCH
/api/account/keys/:id

Input

NameTypeRequiredDescription
administratorbooleanfalsesets administrative rights on the API key
permissionsobjectfalsean object describing updates to the key’s permissions

Example

PATCH /api/account/keys/test%202_0

{
  "administrator": true,
  "permissions": {
    "modify_subtraction": true
  }
}

Response

Status: 200 OK

{
  "id": "test 2_0",
  "name": "Test 2",
  "administrator": true,
  "groups": [],
  "permissions": {
    "cancel_job": false,
    "create_ref": false,
    "create_sample": true,
    "modify_hmm": false,
    "modify_subtraction": true,
    "remove_file": false,
    "remove_job": false,
    "upload_file": false
  },
  "created_at": "2018-05-01T21:34:21.271000Z"
}

Errors

StatusMessageReason
401Requires authorizationrequest is not associated with an authorized session or API key
404Not foundAPI key identified by :id does not exist
422Invalid inputmissing or invalid permissions object

Delete API Key

Delete an existing API key.

DELETE
/api/account/keys/:id

Example

DELETE /api/account/keys/test_1

Response

Status: 204 No content

 

Errors

StatusMessageReason
401Requires authorizationrequest is not associated with an authorized session or API key
404Not foundAPI key identified by :id does not exist

Logout

Logout by invalidating the current session. It will have no effect for connections authenticated with an API key.

GET
/api/account/logout

Response

Status: 204 No content

 

Errors

None