Skip to content

Commit

Permalink
docs: api (#332)
Browse files Browse the repository at this point in the history
Co-authored-by: HonkingGoose <[email protected]>
  • Loading branch information
rarkins and HonkingGoose authored Sep 29, 2023
1 parent 24de147 commit a8fafd5
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ Mend Renovate CE was formerly known as "Mend Renovate On-Premises".
1. Installation ([Helm](./installation-helm.md))
1. Configuration ([GitHub](./configuration-github.md), [GitLab](./configuration-gitlab.md))
1. Migration ([Renovate On-Premises to Renovate Community](./migrating-to-renovate-ce.md))
1. API ([API Documentation](./api.md))
1. [Advanced topics](./advanced.md)
53 changes: 53 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Renovate API

Renovate CE/EE exposes a REST API that you can use to interact programmatically with Renovate.

## Enabling and Authentication

The API can be enabled by setting the `MEND_RNV_ADMIN_API_ENABLED` environment variable to `true`.
You must also configure an API secret by setting the `MEND_RNV_SERVER_API_SECRET` variable.

Authentication is done via HTTP Auth, using the API secret as the password.
For example if the secret is `renovateapi` then you would authenticate with:

```
Authorization: renovateapi
```

## Endpoints

### Health

`GET /health`

Returns 200 if API is healthy.

### Queue status

`GET /api/job/queue`

Returns the current status of the job queue, including number of pending jobs.

`GET /api/task/queue`

Returns the current status of the task queue, including number of pending tasks.
Generally speaking, tasks are internal implementation details, such as syncing.
As end-user you usually do not need to worry about tasks.
This API is exposed primarily to help you troubleshoot if something is going wrong.

### Sync and jobs

`POST /api/sync`

Triggers an immediate repository sync against the platform/server.
Normally you don't need this endpoint.
But it can be useful if you think Renovate's internal state has become out of sync: for example when a new repository is missing.

`POST /api/job/add`

This endpoint allows adding a new job to the queue.
The request body must contain a single repository:

```json
{ "repository": "some-org/some-repo" }
```

0 comments on commit a8fafd5

Please sign in to comment.