# strider v1.0.0 Strider API # Table of contents - [Account](#Account) - [Change Email](#Change-Email) - [Change jobs quantity on page](#Change-jobs-quantity-on-page) - [Change Password](#Change-Password) - [Delete Provider Account](#Delete-Provider-Account) - [Update Provider Account](#Update-Provider-Account) - [Admin](#Admin) - [Get All Users](#Get-All-Users) - [Revoke Invite](#Revoke-Invite) - [Send Invite](#Send-Invite) - [Branch](#Branch) - [Add Branch](#Add-Branch) - [Delete Branch](#Delete-Branch) - [Reorder Branches](#Reorder-Branches) - [Collaborators](#Collaborators) - [Add Collaborator](#Add-Collaborator) - [Delete Collaborator](#Delete-Collaborator) - [Get Collaborators](#Get-Collaborators) - [Job](#Job) - [Get Latest Jobs](#Get-Latest-Jobs) - [Start Job](#Start-Job) - [Provider](#Provider) - [Get Project Provider](#Get-Project-Provider) - [Update Project Provider](#Update-Project-Provider) - [Repo](#Repo) - [Clear Cache](#Clear-Cache) - [Create Repo](#Create-Repo) - [Delete Repo](#Delete-Repo) - [Session](#Session) - [Create New Session](#Create-New-Session) - [Get Session](#Get-Session) ___ # Account ## Change Email [Back to top](#top)

Changes the email address for the active user (the API user).

``` POST /account/email ``` ### Parameters - `Request Body Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | email | `String` |

The new email address. This must be a VALID email address.

| ## Change jobs quantity on page [Back to top](#top)

Changes the jobs quantity on page for the active user (the API user).

``` POST /account/jobsQuantityOnPage ``` ### Parameters - `Request Body Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | quantity | `Number` |

The new value.

| ## Change Password [Back to top](#top)

Changes the password for the active user (the API user).

``` POST /account/password ``` ### Parameters - `Request Body Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | password | `String` |

The new password, which must be at least 6 characters long.

_Size range: 6.._
| ## Delete Provider Account [Back to top](#top)

Deletes a provider account for the active user (the API user).

``` DELETE /account/:provider/:id ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | provider | `String` |

Type of provider, e.g. github

| | id | `Number` |

Unique provider identification

| ## Update Provider Account [Back to top](#top)

Updates a provider account for the active user (the API user).

``` PUT /account/:provider/:id ``` ### Parameters - `Parameter` | Name | Type | Description | |----------|------------|---------------------------------------| | provider | `String` |

Type of provider, e.g. github

| | id | `Number` |

Unique provider identification

| # Admin ## Get All Users [Back to top](#top)

Retrieves a list of all Strider users.

``` GET /admin/users ``` ### Examples CURL Example: ```curl curl -X GET http://localhost/admin/users ``` ## Revoke Invite [Back to top](#top)

Revokes a previously sent Strider invitation.

``` POST /admin/invite/revoke ``` ### Parameters - `Request Body Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | invite_code | `String` |

The invite code/token of the invite being revoked.

| ### Examples CURL Example: ```curl curl -X POST -d invite_code=xoxox http://localhost/invite/revoke ``` ## Send Invite [Back to top](#top)

Create & email a new Strider invite.

``` POST /admin/invite/new ``` ### Parameters - `Request Body Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | invite_code | `String` |

The invite code/token to use in the invitation

| | email | `String` |

The email address of the new user being invited

| ### Examples CURL Example: ```curl curl -X POST -d invite_code=xoxox -d email=new_guy@strider-cd.com http://localhost/invite/new ``` # Branch ## Add Branch [Back to top](#top)

Add a new branch for a project.

``` POST /:org/:repo/branches ``` ### Parameters - `Request Body Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | name | `String` |

The name of the new branch

| | cloneName | `String` |

The name of the cloned branch

| ### Parameters - `Request URL Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | org | `String` |

The organization name for the project. This is usually a GitHub user or organization name (e.g. "strider" in "strider-cd/strider") but may vary from one project provider to another. (as another example, in GitLab this refers to the repository's "group").

| | repo | `String` |

The project's repository name.

| ### Examples CURL Example: ```curl curl -X POST -d name=newbranch http://localhost/api/strider-cd/strider/branches ``` ## Delete Branch [Back to top](#top)

Deletes a branch from a project

``` DELETE /:org/:repo/branches ``` ### Parameters - `Request Body Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | name | `String` |

The name of the branch to delete

| ### Parameters - `Request URL Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | org | `String` |

The organization name for the project. This is usually a GitHub user or organization name (e.g. "strider" in "strider-cd/strider") but may vary from one project provider to another. (as another example, in GitLab this refers to the repository's "group").

| | repo | `String` |

The project's repository name.

| ### Examples CURL Example: ```curl curl -X DELETE -d name=mybranch http://localhost/api/strider-cd/strider/branches ``` ## Reorder Branches [Back to top](#top)

Updates the branch order for a project.

``` PUT /:org/:repo/branches ``` ### Parameters - `Request Body Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | branches | `String` |

The new branch order, comma delimited

| ### Parameters - `Request URL Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | org | `String` |

The organization name for the project. This is usually a GitHub user or organization name (e.g. "strider" in "strider-cd/strider") but may vary from one project provider to another. (as another example, in GitLab this refers to the repository's "group").

| | repo | `String` |

The project's repository name.

| ### Examples CURL Example: ```curl curl -X PUT -d branches=master,testing http://localhost/api/strider-cd/strider/branches ``` # Collaborators ## Add Collaborator [Back to top](#top)

Add a new collaborator to a repository/project.

``` POST /:org/:repo/collaborators ``` ### Parameters - `Request Body Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | email | `String` |

Email address to add. If the user is not registered with Strider, we will send them an invite. If they are already registered, they will receive a notification of access.

| | access | `Number` |

Access level to grant to the new collaborator. This can be 0, for read only access, or 2 for admin access.

_Default value: 0_
| ### Parameters - `Request URL Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | org | `String` |

The organization name for the project. This is usually a GitHub user or organization name (e.g. "strider" in "strider-cd/strider") but may vary from one project provider to another. (as another example, in GitLab this refers to the repository's "group").

| | repo | `String` |

The project's repository name.

| ### Examples CURL Example: ```curl curl -X GET -d '{"email":"new_guy@strider-cd.com", "access":2}' http://localhost/api/strider-cd/strider/collaborators ``` ## Delete Collaborator [Back to top](#top)

Remove a collaborator from a repository/project.

``` DELETE /:org/:repo/collaborators ``` ### Parameters - `Request Body Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | email | `String` |

Email address to remove from the repo/project.

| ### Parameters - `Request URL Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | org | `String` |

The organization name for the project. This is usually a GitHub user or organization name (e.g. "strider" in "strider-cd/strider") but may vary from one project provider to another. (as another example, in GitLab this refers to the repository's "group").

| | repo | `String` |

The project's repository name.

| ### Examples CURL Example: ```curl curl -X DELETE -d '{"email":"old_guy@strider-cd.com"}' http://localhost/api/strider-cd/strider/collaborators ``` ## Get Collaborators [Back to top](#top)

Gets a list of collaborators for a project

``` GET /:org/:repo/collaborators ``` ### Parameters - `Request URL Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | org | `String` |

The organization name for the project. This is usually a GitHub user or organization name (e.g. "strider" in "strider-cd/strider") but may vary from one project provider to another. (as another example, in GitLab this refers to the repository's "group").

| | repo | `String` |

The project's repository name.

| ### Examples CURL Example: ```curl curl -X GET http://localhost/api/strider-cd/strider/collaborators ``` # Job ## Get Latest Jobs [Back to top](#top)

Return JSON object containing the most recent build status for each configured repo This function is used to build the main dashboard status page. The result is separated into {public: [], yours: []}.

Note: the private ones are just ones that the current user is a collaborator on and are not necessarily private

``` GET /api/jobs ``` ### Examples CURL Example: ```curl curl -X GET http://localhost/api/jobs ``` ## Start Job [Back to top](#top)

Executes a strider test and, optionally, deployment.

``` POST /:org/:repo/start ``` ### Parameters - `Request Body Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | type | `String` |

Denotes the type of job to run. This can be "TEST_ONLY", which indicates that only the test stages of the job should be executed or "TEST_AND_DEPLOY", which indicates that all stages should be executed.

_Default value: TEST_ONLY_
| | branch | `String` |

Indicates which branch configuration should be executed.

_Default value: master_
| | message | `String` |

An optional message to include as the title of the execution.

_Default value: Manually Retesting/Redeploying_
| ### Parameters - `Request URL Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | org | `String` |

The organization name for the project. This is usually a GitHub user or organization name (e.g. "strider" in "strider-cd/strider") but may vary from one project provider to another. (as another example, in GitLab this refers to the repository's "group").

| | repo | `String` |

The project's repository name.

| ### Examples CURL Example: ```curl curl -X POST http://localhost/api/strider-cd/strider/start ``` # Provider ## Get Project Provider [Back to top](#top)

Get the provider config for the specified project

``` GET /:org/:repo/provider ``` ### Parameters - `Request URL Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | org | `String` |

The organization name for the project. This is usually a GitHub user or organization name (e.g. "strider" in "strider-cd/strider") but may vary from one project provider to another. (as another example, in GitLab this refers to the repository's "group").

| | repo | `String` |

The project's repository name.

| ### Examples CURL Example: ```curl curl -X GET http://localhost:3000/strider-cd/strider/provider ``` ## Update Project Provider [Back to top](#top)

Update a project's provider

``` POST /:org/:repo/provider ``` ### Parameters - `Request URL Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | org | `String` |

The organization name for the project. This is usually a GitHub user or organization name (e.g. "strider" in "strider-cd/strider") but may vary from one project provider to another. (as another example, in GitLab this refers to the repository's "group").

| | repo | `String` |

The project's repository name.

| ### Examples CURL Example: ```curl curl -X POST http://localhost:3000/strider-cd/strider/provider ``` # Repo ## Clear Cache [Back to top](#top)

Clears/invalidates the cache for a project.

``` DELETE /:org/:repo/cache ``` ### Parameters - `Request URL Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | org | `String` |

The organization name for the project. This is usually a GitHub user or organization name (e.g. "strider" in "strider-cd/strider") but may vary from one project provider to another. (as another example, in GitLab this refers to the repository's "group").

| | repo | `String` |

The project's repository name.

| ### Examples CURL Example: ```curl curl -X DELETE http://localhost/api/strider-cd/strider/cache ``` ## Create Repo [Back to top](#top)

Create a new project for a repo.

``` PUT /:org ``` ### Parameters - `Request Body Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | name | `String` |

The name of the new branch

| | display_name | `String` |

Human-readable project name

| | display_url | `String` |

The URL for the repo (e.g. Github homepage)

| | public | `Boolean` |

Whether this project is public or not.

_Default value: false_
| | prefetch_config | `Boolean` |

Whether the strider.json should be fetched in advance.

_Default value: true_
| | account | `String` |

The ID of provider account

| | repo_id | `String` |

The ID of the repo

| | provider | `Object` |

A json object with 'id' and 'config' properties.

| ## Delete Repo [Back to top](#top)

Deletes a repository/project. Also archives all jobs (marks as archived in DB which makes them hidden).

``` DELETE /:org/:repo ``` ### Parameters - `Request URL Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | org | `String` |

The organization name for the project. This is usually a GitHub user or organization name (e.g. "strider" in "strider-cd/strider") but may vary from one project provider to another. (as another example, in GitLab this refers to the repository's "group").

| | repo | `String` |

The project's repository name.

| ### Examples CURL Example: ```curl curl -X DELETE http://localhost/api/strider-cd/strider ``` # Session ## Create New Session [Back to top](#top)

Creates a new user session after validating an email address and password pair.

``` POST /api/session ``` ### Parameters - `Request Body Parameters` | Name | Type | Description | |----------|------------|---------------------------------------| | email | `String` |

The email address to login as (which is used as the username).

| | password | `String` |

The user's password.

| ### Examples CURL Example: ```curl curl -X POST -d email=me@me.com -d password=mypass http://localhost/api/session ``` ## Get Session [Back to top](#top)

Gets the current session information

``` GET /api/session ``` ### Examples CURL Example: ```curl curl -X GET http://localhost/api/session ```