User#

Operations related to users

Get current authenticated user#

GET/users/me

Retrieves details for the currently authenticated user.

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Code Examples#

curl -X GET "/api/v1/users/me" \
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "username": "johndoe",
  "permissions": [
    {
      "resource": "orders_table",
      "resource_type": "table",
      "type": "read"
    }
  ]
}

List all users#

GET/users

Retrieves a list of all users in the system. Requires admin permission.

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Code Examples#

curl -X GET "/api/v1/users" \
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

[
  {
    "username": "johndoe"
  }
]

Create a new user#

POST/users/{userName}

Creates a new user with the given username and password. Username in path takes precedence.

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Request Body#

Example:

{
    "username": "johndoe",
    "password": "s3cr3tP@sswOrd",
    "initial_policies": [
        {
            "resource": "orders_table",
            "resource_type": "table",
            "type": "read"
        }
    ]
}

Code Examples#

curl -X POST "/api/v1/users/{userName}" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "username": "johndoe",
    "password": "s3cr3tP@sswOrd",
    "initial_policies": [
        {
            "resource": "orders_table",
            "resource_type": "table",
            "type": "read"
        }
    ]
}'

Responses#

{
  "username": "johndoe",
  "password_hash": "JGFyZ29uMm..."
}

Get user details#

GET/users/{userName}

Retrieves details for a specific user.

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Code Examples#

curl -X GET "/api/v1/users/{userName}" \
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "username": "johndoe",
  "password_hash": "JGFyZ29uMm..."
}

Delete a user#

DELETE/users/{userName}

Deletes a specific user.

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Code Examples#

curl -X DELETE "/api/v1/users/{userName}" \
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

No response body

Update user password#

PUT/users/{userName}/password

Updates the password for a specific user.

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Request Body#

Example:

{
    "new_password": "newS3cr3tP@sswOrd"
}

Code Examples#

curl -X PUT "/api/v1/users/{userName}/password" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "new_password": "newS3cr3tP@sswOrd"
}'

Responses#

{
  "message": "Operation completed successfully"
}