Skip to content

Users

APIs for managing users within a project. Create, update, and delete users; manage authentication and account status.

Login User POST

Authenticates a user with username and password. Returns an access token for API requests.

POST /{project}/users/login

Path Parameters

NameTypeRequiredDescription
projectstringYes-

Request Body

json
{
  "username": "string",
  "password": "string"
}

Response (200 OK)

json
{
  "id": "string",
  "access_token": "string",
  "expires_at": 0,
  "type": "string",
  "refresh": "string",
  "auth_type": "user"
}

cURL Example

bash
curl -X POST "https://my-project.atlascms.io/{project}/users/login" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"username":"string","password":"string"}'

Get Users GET

Lists all users in the project with pagination.

GET /{project}/users

Path Parameters

NameTypeRequiredDescription
projectstringYes-

Query Parameters

NameTypeRequiredDescription
usernamestringNo-
searchstringNo-
roleIdstringNo-
resolvestringNoAccept: media, mediagallery, references
pageintegerNo-
sizeintegerNo-
sortstringNo-

Response (200 OK)

json
{
  "data": [
    {
      "id": "string",
      "firstName": "string",
      "lastName": "string",
      "username": "string",
      "email": "string",
      "mobilePhone": "string",
      "roles": [],
      "isActive": true,
      "createdAt": "2024-01-15T12:00:00Z",
      "createdBy": "string",
      "modifiedAt": "2024-01-15T12:00:00Z",
      "modifiedBy": "string",
      "notes": "string",
      "attributes": {
        "key": "value"
      }
    }
  ],
  "metadata": {
    "currentPage": 0,
    "pageSize": 0,
    "hasPreviousPage": true,
    "hasNextPage": true,
    "totalPages": 0,
    "count": 0
  }
}

cURL Example

bash
curl -X GET "https://my-project.atlascms.io/{project}/users" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"

Count Users GET

Returns the total count of users in the project.

GET /{project}/users/count

Path Parameters

NameTypeRequiredDescription
projectstringYes-

Query Parameters

NameTypeRequiredDescription
usernamestringNo-
searchstringNo-
roleIdstringNo-

Response (200 OK)

json
{
  "result": 0
}

cURL Example

bash
curl -X GET "https://my-project.atlascms.io/{project}/users/count" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"

Get User GET

Retrieves a single user by ID.

GET /{project}/users/{id}

Path Parameters

NameTypeRequiredDescription
idstringYes-
projectstringYes-

Query Parameters

NameTypeRequiredDescription
resolvestringNoAccept: media, mediagallery, references

Response (200 OK)

json
{
  "id": "string",
  "firstName": "string",
  "lastName": "string",
  "username": "string",
  "email": "string",
  "mobilePhone": "string",
  "roles": [
    "string"
  ],
  "isActive": true,
  "createdAt": "2024-01-15T12:00:00Z",
  "createdBy": "string",
  "modifiedAt": "2024-01-15T12:00:00Z",
  "modifiedBy": "string",
  "notes": "string",
  "attributes": {
    "key": "value"
  }
}

cURL Example

bash
curl -X GET "https://my-project.atlascms.io/{project}/users/item-id" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"

Update User PUT

Updates user attributes such as name or status.

PUT /{project}/users/{id}

Path Parameters

NameTypeRequiredDescription
idstringYes-
projectstringYes-

Request Body

json
{
  "firstName": "string",
  "lastName": "string",
  "username": "string",
  "email": "string",
  "mobilePhone": "string",
  "roles": [
    "string"
  ],
  "notes": "string",
  "attributes": {
    "key": "value"
  }
}

cURL Example

bash
curl -X PUT "https://my-project.atlascms.io/{project}/users/item-id" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"firstName":"string","lastName":"string","username":"string","email":"string","mobilePhone":"string","roles":["string"],"notes":"string","attributes":{"key":"value"}}'

Delete User DELETE

Removes a user from the project.

DELETE /{project}/users/{id}

Path Parameters

NameTypeRequiredDescription
idstringYes-
projectstringYes-

cURL Example

bash
curl -X DELETE "https://my-project.atlascms.io/{project}/users/item-id" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"

Create User POST

Creates a new user in the project.

POST /{project}/users/register

Path Parameters

NameTypeRequiredDescription
projectstringYes-

Request Body

json
{
  "firstName": "string",
  "lastName": "string",
  "username": "string",
  "email": "string",
  "mobilePhone": "string",
  "roles": [
    "string"
  ],
  "password": "string",
  "isActive": true,
  "attributes": {
    "key": "value"
  }
}

Response (200 OK)

json
{
  "result": "string"
}

cURL Example

bash
curl -X POST "https://my-project.atlascms.io/{project}/users/register" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"firstName":"string","lastName":"string","username":"string","email":"string","mobilePhone":"string","roles":["string"],"password":"string","isActive":true,"attributes":{"key":"value"}}'

Change the user status active/inactive POST

Enables or disables a user account. Inactive users cannot log in.

POST /{project}/users/{id}/status

Path Parameters

NameTypeRequiredDescription
idstringYes-
projectstringYes-

Request Body

json
{
  "isActive": true
}

cURL Example

bash
curl -X POST "https://my-project.atlascms.io/{project}/users/item-id/status" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"isActive":true}'

Change Password POST

Changes the password for a user. Requires admin privileges.

POST /{project}/users/{id}/change-password

Path Parameters

NameTypeRequiredDescription
idstringYes-
projectstringYes-

Request Body

json
{
  "password": "string"
}

cURL Example

bash
curl -X POST "https://my-project.atlascms.io/{project}/users/item-id/change-password" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"password":"string"}'

Atlas CMS Documentation