users/register
POST
Register a user and send registration email.
- Auth. Required:
Yes
- Roles Required:
“admin” or “operations”
- Permissions Required:
USER:CREATE, USER:READ
- Response Type:
undefined
Request Structure
- email:
Email address of the new user The given email is validated (circuitously) by GitHub user asaskevich’s regular expression . Note that it can’t actually distinguish a valid, deliverable, email address but merely ensure the email is in a commonly-found format.
- role:
The name of the Role which will be afforded to the new user. It restricts the allowed values to identifiers for Roles with only Permissions the requesting user has.
- tenantId:
A field containing the integral, unique identifier of the Tenant to which the new user will belong. It restricts the allowed values to identifiers for Tenants within the requesting user’s Tenant’s permissions.
POST /api/4.0/users/register HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Content-Length: 59
Content-Type: application/json
{
"email": "test@example.com",
"role": "admin",
"tenantId": 1
}
Response Structure
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin: *
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json
Date: Thu, 13 Dec 2018 22:03:22 GMT
X-Server-Name: traffic_ops_golang/
Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
Vary: Accept-Encoding
Whole-Content-Sha512: yvf++Oqxvu3uOIAYbWLUgJKxZ4T60Mi5H9eGTxrKLxnRsHw0PdDIrThbTnWtATBkak4vU/dPHLLXKW85LUTEWg==
Content-Length: 160
{ "alerts": [
{
"level": "success",
"text": "Sent user registration to test@example.com with the following permissions [ role: read-only | tenant: root ]"
}
]}