OpenAPI definition (v0)

Download OpenAPI specification:

User Avatars

The avatars displayed for a user.

Get User's Avatar

Gets specified user's avatar.

path Parameters
userId
required
integer <int32>

Responses

Response samples

Content type
No sample

Update User's Avatar

Updates specified user's avatar.

path Parameters
userId
required
integer <int32>
Request Body schema: multipart/form-data
file
required
string <binary>

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Delete User's Avatar

Deletes specified user's avatar.

path Parameters
userId
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Get My Avatar

Gets the current user's avatar.

Responses

Response samples

Content type
No sample

Update My Avatar

Updates the current user's avatar.

Request Body schema: multipart/form-data
file
required
string <binary>

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Delete My Avatar

Deletes the current user's avatar.

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Authorities

Authorites can be applied to roles and specify what functionality that role has access to.

Get Authorities

Get list of all authorities.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Authority

Get specific authority.

path Parameters
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "authority": "string"
}

User Roles

The roles applied to a specific user.

Get User's Roles

Get list of roles applied to a user.

path Parameters
userId
required
integer <int32>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Add User's Roles

Add list of roles applied to a user.

  • If a role ID is not found in the system, it will not be applied to the user.
  • If a role ID is already applied to the user, it will remain applied.

path Parameters
userId
required
integer <int32>
Request Body schema: application/json
required
Array
integer <int32>

Responses

Request samples

Content type
application/json
[
  • 0
]

Response samples

Content type
application/json
[
  • {
    }
]

Set User's Roles

Set list of roles applied to a user.

  • If a role ID is not found in the system, it will not be applied to the user.

path Parameters
userId
required
integer <int32>
Request Body schema: application/json
required
Array
integer <int32>

Responses

Request samples

Content type
application/json
[
  • 0
]

Response samples

Content type
application/json
[
  • {
    }
]

Remove User's Roles

Remove list of roles applied to a user.

  • If a role ID is not applied to the user, it will remain not applied.

path Parameters
userId
required
integer <int32>
Request Body schema: application/json
required
Array
integer <int32>

Responses

Request samples

Content type
application/json
[
  • 0
]

Response samples

Content type
application/json
[
  • {
    }
]

Roles

Roles contain a set of authorities which athorize users access different functionality.

Get Role

Get specific role's information.

path Parameters
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "authorityIds": [
    ]
}

Update Role

Update a specific role.

  • The name of the role must not be empty.
  • The name of the role must not conflict with an existing role.
  • Ignores id from request body.
  • Any field missing or null from request body will be left unchanged in user information.

path Parameters
id
required
integer <int32>
Request Body schema: application/json
required
id
integer <int32>
name
string [ 1 .. 255 ] characters
authorityIds
Array of integers <int32> [ items <int32 > ]

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "authorityIds": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "authorityIds": [
    ]
}

Delete Role

Delete a specific role.

path Parameters
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Get Roles

Get list of all role's information.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create Role

Create a new role.

  • The name of the role must not be empty.
  • The name of the role must not conflict with an existing role.

Request Body schema: application/json
required
id
integer <int32>
name
string [ 1 .. 255 ] characters
authorityIds
Array of integers <int32> [ items <int32 > ]

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "authorityIds": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "authorityIds": [
    ]
}

Authentication

Handles user login and registration.

Register

Register a new user.

Request Body schema: application/json
required
email
required
string <email> [ 3 .. 255 ] characters
username
required
string [ 3 .. 20 ] characters ^[a-zA-Z0-9_-]*$
password
required
string [ 8 .. 72 ] characters

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "username": "string",
  • "password": "stringst"
}

Response samples

Content type
application/json
{
  • "accessToken": "string",
  • "tokenType": "string",
  • "expires": "2019-08-24T14:15:22Z"
}

Login

Login to an existing user.

Request Body schema: application/json
required
email
string <email> [ 3 .. 255 ] characters
username
string
password
required
string

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "username": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "accessToken": "string",
  • "tokenType": "string",
  • "expires": "2019-08-24T14:15:22Z"
}

Refresh

Refresh a user.

cookie Parameters
refresh_token
string

Responses

Response samples

Content type
application/json
{
  • "accessToken": "string",
  • "tokenType": "string",
  • "expires": "2019-08-24T14:15:22Z"
}

Logout

Logout a user.

cookie Parameters
refresh_token
string

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Torrents

Torrents represent a repository stored in the system.

Get Torrent

Get torrent metadata by ID.

path Parameters
id
required
integer <int64>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "repoId": "stringstringstringstringstringstringstri",
  • "fileSize": 0,
  • "uploaderId": 0,
  • "uploaderUsername": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Update Torrent Metadata

Update torrent name and/or description.

path Parameters
id
required
integer <int64>
Request Body schema: application/json
required
id
integer <int64>
name
string [ 3 .. 255 ] characters ^[a-zA-Z0-9_-]*$
description
string [ 3 .. 255 ] characters
repoId
string = 40 characters ^[a-fA-F0-9]{40}$
fileSize
integer <int64>
uploaderId
integer <int32>
uploaderUsername
string
createdAt
string <date-time>
updatedAt
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "repoId": "stringstringstringstringstringstringstri",
  • "fileSize": 0,
  • "uploaderId": 0,
  • "uploaderUsername": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "repoId": "stringstringstringstringstringstringstri",
  • "fileSize": 0,
  • "uploaderId": 0,
  • "uploaderUsername": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Delete Torrent

Delete a torrent and its file.

path Parameters
id
required
integer <int64>

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Download Torrent File

Download the actual .torrent file.

path Parameters
id
required
integer <int64>

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Update Torrent File

Replace the torrent file.

path Parameters
id
required
integer <int64>
Request Body schema: application/json
file
required
string <binary>

Responses

Request samples

Content type
application/json
{
  • "file": "string"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

List Torrents

Get all torrents with pagination.

query Parameters
page
integer <int32>
Default: 0
size
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "repoId": "stringstringstringstringstringstringstri",
  • "fileSize": 0,
  • "uploaderId": 0,
  • "uploaderUsername": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Upload Torrent

Upload a new torrent file with metadata.

Request Body schema: multipart/form-data
required
object (TorrentDto)
file
required
string <binary>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "repoId": "stringstringstringstringstringstringstri",
  • "fileSize": 0,
  • "uploaderId": 0,
  • "uploaderUsername": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Get Torrent by Repository ID

Get torrent metadata by the repository's root commit hash.

path Parameters
repoId
required
string[0-9a-fA-F]{40}

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "repoId": "stringstringstringstringstringstringstri",
  • "fileSize": 0,
  • "uploaderId": 0,
  • "uploaderUsername": "string",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Users

System users.

Get User

Get specific user's information.

path Parameters
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "email": "user@example.com",
  • "username": "string",
  • "firstname": "string",
  • "lastname": "string"
}

Update User

Update specific user's information.

  • Ignores id and password from request body.
  • Any field missing or null from request body will be left unchanged in user information.

path Parameters
id
required
integer <int32>
Request Body schema: application/json
required
id
integer <int32>
email
string <email> [ 3 .. 255 ] characters
username
string [ 3 .. 20 ] characters ^[a-zA-Z0-9_-]*$
firstname
string [ 1 .. 35 ] characters
lastname
string [ 1 .. 35 ] characters

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "email": "user@example.com",
  • "username": "string",
  • "firstname": "string",
  • "lastname": "string"
}

Response samples

Content type
application/json
[
  • 0
]

Delete User

Deletes specific user.

path Parameters
id
required
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Get Me

Get the current user's information.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "email": "user@example.com",
  • "username": "string",
  • "firstname": "string",
  • "lastname": "string"
}

Update Me

Update the current user's information.

  • Ignores id and password from request body.
  • Any field missing or null from request body will be left unchanged in user information.

Request Body schema: application/json
required
id
integer <int32>
email
string <email> [ 3 .. 255 ] characters
username
string [ 3 .. 20 ] characters ^[a-zA-Z0-9_-]*$
firstname
string [ 1 .. 35 ] characters
lastname
string [ 1 .. 35 ] characters

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "email": "user@example.com",
  • "username": "string",
  • "firstname": "string",
  • "lastname": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "email": "user@example.com",
  • "username": "string",
  • "firstname": "string",
  • "lastname": "string"
}

Delete Me

Deletes the current user.

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Update My Password

Updates the current user's password.

Request Body schema: application/json
required
string

Responses

Request samples

Content type
application/json
"string"

Response samples

Content type
application/json
{
  • "message": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Get Users

Get paginated list of user's information.

  • If size excedes limit, response will contain up to limit.

query Parameters
page
integer <int32>
Default: 0
size
integer <int32>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get User Torrents

Get a paginated list of torrents uploaded by a specific user.

  • If size excedes limit, response will contain up to limit.

path Parameters
id
required
integer <int32>
query Parameters
page
integer <int32>
Default: 0
size
integer <int32>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get My Torrents

Get a paginated list of torrents uploaded by the current user.

  • If size excedes limit, response will contain up to limit.

query Parameters
page
integer <int32>
Default: 0
size
integer <int32>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get My Authorities

Get a list of the current user's authorities.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Heartbeat

Verify the backend is running.

Heartbeat

Always returns true.

Responses

Response samples

Content type
application/json
true