Create a company member
curl --request POST \
--url https://api.lighton.ai/api/v2/companies/{id}/users/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"email": "jsmith@example.com"
}
'import requests
url = "https://api.lighton.ai/api/v2/companies/{id}/users/"
payload = {
"username": "<string>",
"email": "jsmith@example.com"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({username: '<string>', email: 'jsmith@example.com'})
};
fetch('https://api.lighton.ai/api/v2/companies/{id}/users/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 123,
"username": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"is_active": true,
"date_joined": "2023-11-07T05:31:56Z",
"account_expiration_date": "2023-11-07T05:31:56Z",
"last_login": "2023-11-07T05:31:56Z",
"invitation_status": "<string>",
"language": "<string>",
"company": {
"id": 123,
"name": "<string>"
},
"roles": [
{
"id": 123,
"name": "<string>"
}
],
"groups": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"role": "<string>",
"category": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]
}Users
Create a company member
This endpoint allows to create a company member.
It is restricted to admin and company admin users.
POST
/
api
/
v2
/
companies
/
{id}
/
users
/
Create a company member
curl --request POST \
--url https://api.lighton.ai/api/v2/companies/{id}/users/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"email": "jsmith@example.com"
}
'import requests
url = "https://api.lighton.ai/api/v2/companies/{id}/users/"
payload = {
"username": "<string>",
"email": "jsmith@example.com"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({username: '<string>', email: 'jsmith@example.com'})
};
fetch('https://api.lighton.ai/api/v2/companies/{id}/users/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 123,
"username": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"is_active": true,
"date_joined": "2023-11-07T05:31:56Z",
"account_expiration_date": "2023-11-07T05:31:56Z",
"last_login": "2023-11-07T05:31:56Z",
"invitation_status": "<string>",
"language": "<string>",
"company": {
"id": 123,
"name": "<string>"
},
"roles": [
{
"id": 123,
"name": "<string>"
}
],
"groups": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"role": "<string>",
"category": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the company.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Pattern:
^[\w.@+-]+$ar- Arabicen- Englishfr- Frenchde- German
Available options:
ar, en, fr, de Response
201 - application/json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes