diff --git a/doc/api/license.md b/doc/api/license.md index dc95f9fcebfc17b71d9045b8f1ae76d0d8089746..fe4513919b7c692f29b518b7e95baefc14813671 100644 --- a/doc/api/license.md +++ b/doc/api/license.md @@ -1,10 +1,10 @@ # License -## Retrieve information about the current license - -In order to retrieve the license information, you need to authenticate yourself +In order to interact with license endpoints, you need to authenticate yourself as an admin. +## Retrieve information about the current license + ``` GET /license ``` @@ -21,4 +21,37 @@ GET /license "user_limit": 100, "active_users": 60 } -``` \ No newline at end of file +``` + +## Add a new license + +``` +POST /license +``` + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `license` | string | yes | The license string | + +```bash +curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/license?license=eyJkYXRhIjoiMHM5Q...S01Udz09XG4ifQ==" +``` + +Example response: + +```json +{ + "starts_at": "2015-10-24", + "expires_at": "2016-10-24", + "licensee": { + "Name": "John Doe", + "Company": "Doe, Inc.", + "Email": "john@doe.com" + }, + "user_limit": 100, + "active_users": 60 +} +``` + +It returns `201` if it succeeds or `400` if failed with an error message +explaining the reason. diff --git a/doc/api/licenses.md b/doc/api/license_templates.md similarity index 99% rename from doc/api/licenses.md rename to doc/api/license_templates.md index 855b0eab56fe265fdad31585f8ed8e4dade28bd0..7f589b3d01b357c37d45820658e6111a36f248be 100644 --- a/doc/api/licenses.md +++ b/doc/api/license_templates.md @@ -1,4 +1,4 @@ -# Licenses +# License Templates ## List license templates