OpenLDAP REST API
If you want to manage users through the REST API, this document allows you to send API commands to manage user accounts.
If you want to manage users through the REST API, this document allows you to send API commands to manage user accounts.
This feature is available Artica v4.50 Service Pack 7 or Artica v4.50 Service Pack 6 Hotfix 20260618-00
Standard response envelope:
- Read success
"Status": true, "Data": { /* ... */ } } - Write success
{ "Status": true, "Info": "", "Error": "", "Version": "6.4.99" } - Error
{ "Status": false, "Error": "message" }
HTTP status codes
- 200 Success
- 400 Invalid JSON body, missing required field, or invalid gid
- 404 Member not found (LDAP code 32 on lookup)
- 500 LDAP/transport error (connect, bind, modify failure)
Manage OpenLDAP service:
GET /openldap/install: Install the service (async)GET /openldap/uninstall: Uninstall the service (async)GET /openldap/restart: Restart slapd (async)GET /openldap/status: Service stateGET /openldap/backup/now: Trigger a backupGET /openldap/backup/instant: Last backup metadataGET /openldap/backup/import/[filename]: Restore a backup container (async)GET /openldap/set/schedule: Apply the backup schedule
Examples:
curl -s --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock http://localhost/openldap/status | jqcurl -s --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock http://localhost/openldap/restart | jqcurl -s --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock http://localhost/openldap/backup/now | jqcurl -s --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock "http://localhost/openldap/backup/import/Save-2026-06-17.gz" | jq
Members
Modifiable-attribute whitelist: givenName, sn, mail, title, telephoneNumber, mobile.
-
Empty value ⇒ the optional attribute is removed;
-
non-empty value ⇒ replaced.
-
POST /openldap/members: Create user -
GET /openldap/members/[uid]: get user data -
PUT /openldap/members/[uid]: Save user data -
DELETE /openldap/members/[uid]: Delete member -
POST /openldap/members/[uid]/password: change password -
GET /openldap/members/[uid]/groups: List group
Example create a member
curl -s -X POST --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock -H "Content-Type: application/json" -d '{"login":"jdupont","password":"S3cr3t!","firstname":"Jean","lastname":"Dupont", "email":"jean.dupont@example.com","ou":"example.com","gpid":0}' http://localhost/openldap/members
Example update profile
curl -s -X PUT --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock -H "Content-Type: application/json" -d '{"givenName":"Jean","sn":"Dupont","mail":"j.dupont@example.com","title":"Director","telephoneNumber":"+33123456789","mobile":""}' http://localhost/openldap/members/jdupont | jq
Example delete an user
curl -s -X DELETE --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock http://localhost/openldap/members/jdupont | jq
Example change password
curl -s -X POST --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock -H "Content-Type: application/json" -d '{"password":"N3wPass!"}' http://localhost/openldap/members/jdupont/password | jq
Groups
GET /openldap/groups?ou=[ou]: List groupsPOST /openldap/groups: Add a new groupPOST /openldap/groups/[gid]/members/[uid]: Link user to a groupDELETE /openldap/groups/[gid]/members/[uid]: Unlink an user from a group
Example: List groups
curl -s --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock "http://localhost/openldap/groups?ou=example.com" | jq
Example — create a group (+ optionally link a member)
curl -s -X POST --unix-socket $SOCK -H "Content-Type: application/json" -d '{"name":"accountants","ou":"example.com","uid":"jdupont"}' http://localhost/openldap/groups | jq
Example: Link / unlink a member from/to a group
curl -s -X POST --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock http://localhost/openldap/groups/5005/members/jdupont | jq
curl -s -X DELETE --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock http://localhost/openldap/groups/5005/members/jdupont | jq
GET /openldap/ous: List organizations (single OU when Enable Multiple Organizations is disabled )