Admin Endpoints
Endpoints under https://treeid.io/api/v3/admin. Manages users within an organisation. Requires an ORGANIZATION key.
Auth:
?key=your-org-key
Scope: ORGANIZATION
POST
/api/v3/admin/
ORGANIZATION
Create User
Provisions a new API user under the authenticated organisation.
Request Body
{
"tag": "my-user",
"permissions": "INSERT"
}
Required Fields
tag— unique human-readable label for the user.permissions— one ofINSERT,MATCH,ALL.
Success Response
201 {
"status": "User created successfully",
"user_uuid": "550e8400-e29b-41d4-a716-446655440000"
}
Error Responses
401 { "status": "The provided Permission is invalid" }
409 { "status": "User with such a tag already exists" }
500 { "status": "DB error" }
GET
/api/v3/admin/
ORGANIZATION
List Users
Returns all users belonging to the authenticated organisation.
Request Body
No fields required beyond the key query parameter.
Success Response
200 {
"status": "Fetched 3 users",
"uuids": ["...", "...", "..."],
"tags": ["user-a", "user-b", "user-c"],
"permissions": ["INSERT", "MATCH", "ALL"]
}
Error Responses
500 { "status": "DB error" }
DELETE
/api/v3/admin/
ORGANIZATION
Delete User
Removes a user from the authenticated organisation. The user's logs must be deleted first.
Request Body
{
"user_uuid": "550e8400-e29b-41d4-a716-446655440000"
}
Required Fields
user_uuid
Success Response
201 { "status": "User deleted successfully" }
Error Responses
409 { "status": "Cannot delete user: existing images must be removed first" }
500 { "status": "DB error: ..." }