Skip to content

Commit a73d6f6

Browse files
committed
dev/rest: Document bearer tokens (ref syncthing/syncthing#9002)
1 parent 6597d24 commit a73d6f6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dev/rest.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ API Key
1212
To use the REST API an API key must be set and used. The API key can be
1313
generated in the GUI, or set in the ``configuration/gui/apikey`` element in
1414
the configuration file. To use an API key, set the request header
15-
``X-API-Key`` to the API key value. For example, ``curl -X POST -H
16-
"X-API-Key: abc123" http://localhost:8384/rest/...`` can be used to invoke
17-
with ``curl`` (add ``-k`` flag when using HTTPS with a Syncthing generated or self signed certificate).
15+
``X-API-Key`` to the API key value, or set it as a ``Bearer`` token in the
16+
``Authorization`` header. For example, ``curl -X POST -H "X-API-Key: abc123"
17+
http://localhost:8384/rest/...`` or ``curl -X POST -H "Authorization: Bearer
18+
abc123" http://localhost:8384/rest/...`` can be used to invoke with ``curl``
19+
(add ``-k`` flag when using HTTPS with a Syncthing generated or self signed
20+
certificate).
1821

1922
One exception to this requirement is ``/rest/noauth``, you do not need an API
2023
key to use those endpoints. This way third-party devices and services can do

0 commit comments

Comments
 (0)