A general admin API for all SAMLA services.
- Clone the repository
git clone https://github.com/samla-io/samla-admin.git
cd samla-admin
- Create a
.env
file
CLERK_SECRET_KEY=your_clerk_secret_key
AUTHORIZED_ORG_ID=your_authorized_org_id
- Build and run the Docker container
docker build -t samla-admin .
docker run -p 8080:8080 samla-admin
The API will be available at http://localhost:8080
.
Returns all organizations.
Headers:
- Authorization: Bearer
Response:
{
"organizations": [
{
"object": "organization",
"id": "org_123",
"name": "Organization 1",
"slug": "Organization-1",
"image_url": "",
"has_image": true,
"max_allowed_memberships": 1,
"admin_delete_enabled": true,
"public_metadata": {},
"private_metadata": {},
"created_by": "user_1234",
"created_at": 1754520218386,
"updated_at": 1754520219401,
}
]
}
Creates a new organization.
Headers:
- Authorization: Bearer
Request Body:
{
"name": "Organization 1",
"slug": "Organization-1",
"max_allowed_memberships": 1,
"admin_delete_enabled": true,
"public_metadata": {},
"private_metadata": {}
}
Response:
{
"object": "organization",
"id": "org_123",
"name": "Organization 1",
"slug": "Organization-1",
"image_url": "",
"has_image": true,
"max_allowed_memberships": 1,
"admin_delete_enabled": true,
"public_metadata": {},
"private_metadata": {},
"created_by": "user_1234",
"created_at": 1754520218386,
"updated_at": 1754520219401,
}
Updates an organization.
Headers:
- Authorization: Bearer
Query Parameters:
- organization_id: The ID of the organization to update
Request Body:
{
"name": "Organization 1",
"slug": "Organization-1",
"max_allowed_memberships": 1,
"admin_delete_enabled": true,
"public_metadata": {},
"private_metadata": {}
}
Response:
{
"object": "organization",
"id": "org_123",
"name": "Organization 1",
"slug": "Organization-1",
"image_url": "",
"has_image": true,
"max_allowed_memberships": 1,
"admin_delete_enabled": true,
"public_metadata": {},
"private_metadata": {},
"created_by": "user_1234",
"created_at": 1754520218386,
"updated_at": 1754520219401,
}
Deletes an organization.
Query Parameters:
- organization_id: The ID of the organization to delete
Response:
{
"message": "Organization org_123 deleted successfully"
}
This project is licensed under the a proprietary license. See the LICENSE file for details.