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 --request POST --header"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
"description":"The GNU GPL is the most widely used free software license and has a strong copyleft requirement. When distributing derived works, the source code of the work must be made available under the same license.",
"conditions":[
"include-copyright",
"document-changes",
"disclose-source",
"same-license"
],
"permissions":[
"commercial-use",
"modifications",
"distribution",
"patent-use",
"private-use"
],
"limitations":[
"no-liability"
],
"content":" GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n [...]"
"description":"A permissive license that is short and to the point. It lets people do anything with your code with proper attribution and without warranty.",
"conditions":[
"include-copyright"
],
"permissions":[
"commercial-use",
"modifications",
"distribution",
"private-use"
],
"limitations":[
"no-liability"
],
"content":"The MIT License (MIT)\n\nCopyright (c) [year] [fullname]\n [...]"
}
]
```
## Single license template
Get a single license template. You can pass parameters to replace the license
placeholder.
```
GET /licenses/:key
```
| Attribute | Type | Required | Description |
| ---------- | ------ | -------- | ----------- |
| `key` | string | yes | The key of the license template |
| `project` | string | no | The copyrighted project name |
| `fullname` | string | no | The full-name of the copyright holder |
>**Note:**
If you omit the `fullname` parameter but authenticate your request, the name of
the authenticated user will be used to replace the copyright holder placeholder.
"description":"A permissive license that is short and to the point. It lets people do anything with your code with proper attribution and without warranty.",
"conditions":[
"include-copyright"
],
"permissions":[
"commercial-use",
"modifications",
"distribution",
"private-use"
],
"limitations":[
"no-liability"
],
"content":"The MIT License (MIT)\n\nCopyright (c) 2016 John Doe\n [...]"