Skip to content

Users & Organizations Endpoints

User account and organization management.


Overview

Users

Method Endpoint Description
GET /users/ List users
POST /users/ Create user
GET /users/me Get current user
PATCH /users/me Update current user
GET /users/{id} Get user by ID
PATCH /users/{id} Update user
DELETE /users/{id} Delete user

Organizations

Method Endpoint Description
GET /organizations/ List organizations
POST /organizations/ Create organization
GET /organizations/{id} Get organization

API Reference

Sartiq Backend Server - Users 0.1.0

users


GET /api/v1/users/

Read Users

Description

Retrieve users.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
limit query integer 100 No
search query No
skip query integer 0 No

Responses

{
    "id": "92927eb1-0634-47c0-bcb9-5746163094d9",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "data": [
        {
            "id": "a9208af9-e0aa-41dc-a4b0-f497d05ae93a",
            "created_at": "2022-04-13T15:42:05.901Z",
            "updated_at": "2022-04-13T15:42:05.901Z",
            "email": "derp@meme.org",
            "full_name": null,
            "is_active": true,
            "is_superuser": true,
            "rework_available": 0,
            "role": null,
            "deleted_at": null
        }
    ],
    "count": 0
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "data": {
            "items": {
                "$ref": "#/components/schemas/UserPublic"
            },
            "type": "array",
            "title": "Data"
        },
        "count": {
            "type": "integer",
            "title": "Count"
        }
    },
    "type": "object",
    "required": [
        "data",
        "count"
    ],
    "title": "UsersPublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

POST /api/v1/users/

Create User

Description

Create new user.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No

Request body

{
    "email": "derp@meme.org",
    "password": "string",
    "full_name": null,
    "is_superuser": true,
    "role_id": null,
    "rework_available": 0,
    "is_active": true
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
        },
        "password": {
            "type": "string",
            "maxLength": 40,
            "minLength": 8,
            "title": "Password"
        },
        "full_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Full Name"
        },
        "is_superuser": {
            "type": "boolean",
            "title": "Is Superuser",
            "default": false
        },
        "role_id": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "uuid"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Role Id"
        },
        "rework_available": {
            "type": "integer",
            "title": "Rework Available",
            "default": 2
        },
        "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
        }
    },
    "type": "object",
    "required": [
        "email",
        "password"
    ],
    "title": "UserCreate"
}

Responses

{
    "id": "46f3dbbd-5ceb-4a05-9194-5a7f3ab956e6",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "email": "derp@meme.org",
    "full_name": null,
    "is_active": true,
    "is_superuser": true,
    "rework_available": 0,
    "role": null,
    "deleted_at": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
        },
        "full_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Full Name"
        },
        "is_active": {
            "type": "boolean",
            "title": "Is Active"
        },
        "is_superuser": {
            "type": "boolean",
            "title": "Is Superuser",
            "default": false
        },
        "rework_available": {
            "type": "integer",
            "title": "Rework Available"
        },
        "role": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/RolePublic"
                },
                {
                    "type": "null"
                }
            ]
        },
        "deleted_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Deleted At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "email",
        "full_name",
        "is_active",
        "rework_available"
    ],
    "title": "UserPublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/users/me

Read User Me

Description

Get current user.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No

Responses

{
    "id": "65377554-3481-483f-8ac3-e6feab12a57a",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "email": "derp@meme.org",
    "full_name": null,
    "is_active": true,
    "is_superuser": true,
    "rework_available": 0,
    "role": null,
    "deleted_at": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
        },
        "full_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Full Name"
        },
        "is_active": {
            "type": "boolean",
            "title": "Is Active"
        },
        "is_superuser": {
            "type": "boolean",
            "title": "Is Superuser",
            "default": false
        },
        "rework_available": {
            "type": "integer",
            "title": "Rework Available"
        },
        "role": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/RolePublic"
                },
                {
                    "type": "null"
                }
            ]
        },
        "deleted_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Deleted At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "email",
        "full_name",
        "is_active",
        "rework_available"
    ],
    "title": "UserPublic"
}

PATCH /api/v1/users/me

Update User Me

Description

Update own user.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No

Request body

{
    "full_name": null,
    "email": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "full_name": {
            "anyOf": [
                {
                    "type": "string",
                    "maxLength": 255
                },
                {
                    "type": "null"
                }
            ],
            "title": "Full Name"
        },
        "email": {
            "anyOf": [
                {
                    "type": "string",
                    "maxLength": 255,
                    "format": "email"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Email"
        }
    },
    "type": "object",
    "title": "UserUpdateMe"
}

Responses

{
    "id": "dba145e8-4736-4411-85be-0dd3f33e72c6",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "email": "derp@meme.org",
    "full_name": null,
    "is_active": true,
    "is_superuser": true,
    "rework_available": 0,
    "role": null,
    "deleted_at": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
        },
        "full_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Full Name"
        },
        "is_active": {
            "type": "boolean",
            "title": "Is Active"
        },
        "is_superuser": {
            "type": "boolean",
            "title": "Is Superuser",
            "default": false
        },
        "rework_available": {
            "type": "integer",
            "title": "Rework Available"
        },
        "role": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/RolePublic"
                },
                {
                    "type": "null"
                }
            ]
        },
        "deleted_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Deleted At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "email",
        "full_name",
        "is_active",
        "rework_available"
    ],
    "title": "UserPublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

PATCH /api/v1/users/me/password

Update Password Me

Description

Update own password.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No

Request body

{
    "current_password": "string",
    "new_password": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "current_password": {
            "type": "string",
            "maxLength": 40,
            "minLength": 8,
            "title": "Current Password"
        },
        "new_password": {
            "type": "string",
            "maxLength": 40,
            "minLength": 8,
            "title": "New Password"
        }
    },
    "type": "object",
    "required": [
        "current_password",
        "new_password"
    ],
    "title": "UpdatePassword"
}

Responses

{
    "message": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "message": {
            "type": "string",
            "title": "Message"
        }
    },
    "type": "object",
    "required": [
        "message"
    ],
    "title": "Message"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

POST /api/v1/users/signup

Register User

Description

Create new user without the need to be logged in.

Request body

{
    "id": "ce434195-24eb-4391-aa12-c0ffd7bb6b51",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "email": "derp@meme.org",
    "password": "string",
    "full_name": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "email": {
            "type": "string",
            "maxLength": 255,
            "format": "email",
            "title": "Email"
        },
        "password": {
            "type": "string",
            "maxLength": 40,
            "minLength": 8,
            "title": "Password"
        },
        "full_name": {
            "anyOf": [
                {
                    "type": "string",
                    "maxLength": 255
                },
                {
                    "type": "null"
                }
            ],
            "title": "Full Name"
        }
    },
    "type": "object",
    "required": [
        "email",
        "password"
    ],
    "title": "UserRegister"
}

Responses

{
    "id": "cd1c9f23-2906-455b-9a4e-31b7660d1f53",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "email": "derp@meme.org",
    "full_name": null,
    "is_active": true,
    "is_superuser": true,
    "rework_available": 0,
    "role": null,
    "deleted_at": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
        },
        "full_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Full Name"
        },
        "is_active": {
            "type": "boolean",
            "title": "Is Active"
        },
        "is_superuser": {
            "type": "boolean",
            "title": "Is Superuser",
            "default": false
        },
        "rework_available": {
            "type": "integer",
            "title": "Rework Available"
        },
        "role": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/RolePublic"
                },
                {
                    "type": "null"
                }
            ]
        },
        "deleted_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Deleted At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "email",
        "full_name",
        "is_active",
        "rework_available"
    ],
    "title": "UserPublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/users/{user_id}

Read User By Id

Description

Get a specific user by id.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
user_id path string No

Responses

{
    "id": "9f89b6d3-30e0-4a87-a520-9c933639e5f9",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "email": "derp@meme.org",
    "full_name": null,
    "is_active": true,
    "is_superuser": true,
    "rework_available": 0,
    "role": null,
    "deleted_at": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
        },
        "full_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Full Name"
        },
        "is_active": {
            "type": "boolean",
            "title": "Is Active"
        },
        "is_superuser": {
            "type": "boolean",
            "title": "Is Superuser",
            "default": false
        },
        "rework_available": {
            "type": "integer",
            "title": "Rework Available"
        },
        "role": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/RolePublic"
                },
                {
                    "type": "null"
                }
            ]
        },
        "deleted_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Deleted At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "email",
        "full_name",
        "is_active",
        "rework_available"
    ],
    "title": "UserPublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

PATCH /api/v1/users/{user_id}

Update User

Description

Update a user.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
user_id path string No

Request body

{
    "email": null,
    "full_name": null,
    "password": null,
    "is_superuser": null,
    "role_id": null,
    "is_active": null,
    "rework_available": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "email": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "email"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Email"
        },
        "full_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Full Name"
        },
        "password": {
            "anyOf": [
                {
                    "type": "string",
                    "maxLength": 40,
                    "minLength": 8
                },
                {
                    "type": "null"
                }
            ],
            "title": "Password"
        },
        "is_superuser": {
            "anyOf": [
                {
                    "type": "boolean"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Is Superuser"
        },
        "role_id": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "uuid"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Role Id"
        },
        "is_active": {
            "anyOf": [
                {
                    "type": "boolean"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Is Active"
        },
        "rework_available": {
            "anyOf": [
                {
                    "type": "integer"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Rework Available"
        }
    },
    "type": "object",
    "title": "UserUpdate"
}

Responses

{
    "id": "e7855314-adbf-4cf0-886e-900e674b025e",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "email": "derp@meme.org",
    "full_name": null,
    "is_active": true,
    "is_superuser": true,
    "rework_available": 0,
    "role": null,
    "deleted_at": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
        },
        "full_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Full Name"
        },
        "is_active": {
            "type": "boolean",
            "title": "Is Active"
        },
        "is_superuser": {
            "type": "boolean",
            "title": "Is Superuser",
            "default": false
        },
        "rework_available": {
            "type": "integer",
            "title": "Rework Available"
        },
        "role": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/RolePublic"
                },
                {
                    "type": "null"
                }
            ]
        },
        "deleted_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Deleted At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "email",
        "full_name",
        "is_active",
        "rework_available"
    ],
    "title": "UserPublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

DELETE /api/v1/users/{user_id}

Delete User

Description

Soft-delete a user (admin only).

A superuser cannot delete their own account or the bootstrap superuser.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
user_id path string No

Responses

{
    "message": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "message": {
            "type": "string",
            "title": "Message"
        }
    },
    "type": "object",
    "required": [
        "message"
    ],
    "title": "Message"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

POST /api/v1/users/{user_id}/restore

Restore User

Description

Restore a soft-deleted user (admin only).

The email scrubbed on delete is not recovered; reassign it afterwards via the update endpoint.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
user_id path string No

Responses

{
    "id": "c3ba2835-dd8c-4127-8b1e-199e6fce25b6",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "email": "derp@meme.org",
    "full_name": null,
    "is_active": true,
    "is_superuser": true,
    "rework_available": 0,
    "role": null,
    "deleted_at": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
        },
        "full_name": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Full Name"
        },
        "is_active": {
            "type": "boolean",
            "title": "Is Active"
        },
        "is_superuser": {
            "type": "boolean",
            "title": "Is Superuser",
            "default": false
        },
        "rework_available": {
            "type": "integer",
            "title": "Rework Available"
        },
        "role": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/RolePublic"
                },
                {
                    "type": "null"
                }
            ]
        },
        "deleted_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Deleted At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "email",
        "full_name",
        "is_active",
        "rework_available"
    ],
    "title": "UserPublic"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

organizations


POST /api/v1/organizations/

Create Organization

Description

Create a new organization.

The current user becomes the owner and is automatically added as a member. Avatar image should be uploaded via /uploads/presigned-url first.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No

Request body

{
    "name": "string",
    "avatar_image": null,
    "description": null,
    "rework_available": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "name": {
            "type": "string",
            "maxLength": 255,
            "title": "Name"
        },
        "avatar_image": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "$ref": "#/components/schemas/MediaInput"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Avatar Image",
            "description": "Avatar image URL (presigned URL from /uploads/presigned-url)"
        },
        "description": {
            "anyOf": [
                {
                    "type": "string",
                    "maxLength": 1000
                },
                {
                    "type": "null"
                }
            ],
            "title": "Description"
        },
        "rework_available": {
            "anyOf": [
                {
                    "type": "integer"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Rework Available"
        }
    },
    "type": "object",
    "required": [
        "name"
    ],
    "title": "OrganizationCreate",
    "description": "Schema for creating an organization."
}

Responses

{
    "id": "f40fdb45-1590-4631-a8a5-a7af1c606128",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "name": "string",
    "avatar_image_url": null,
    "avatar_image_media": null,
    "description": null,
    "rework_available": 0,
    "owner_id": "c628f7fa-510b-4612-9ded-2c87faf08c6f",
    "deleted_at": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "name": {
            "type": "string",
            "title": "Name"
        },
        "avatar_image_url": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Avatar Image Url"
        },
        "avatar_image_media": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/MediaResourcePublic"
                },
                {
                    "type": "null"
                }
            ]
        },
        "description": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Description"
        },
        "rework_available": {
            "type": "integer",
            "title": "Rework Available"
        },
        "owner_id": {
            "type": "string",
            "format": "uuid",
            "title": "Owner Id"
        },
        "deleted_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Deleted At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "created_at",
        "updated_at",
        "name",
        "description",
        "rework_available",
        "owner_id"
    ],
    "title": "OrganizationPublic",
    "description": "Public response schema for an organization."
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/organizations/

Read Organizations

Description

List organizations the current user is a member of.

Superusers can see all organizations.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
limit query integer 100 No
search query No
skip query integer 0 No

Responses

{
    "id": "19910ef9-1379-421b-8add-eb581c5ab776",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "data": [
        {
            "id": "315a7005-6a38-4cac-a75c-68a0445266b1",
            "created_at": "2022-04-13T15:42:05.901Z",
            "updated_at": "2022-04-13T15:42:05.901Z",
            "name": "string",
            "avatar_image_url": null,
            "avatar_image_media": null,
            "description": null,
            "rework_available": 0,
            "owner_id": "40e9e074-8a25-47b7-ae36-ac23a7b38550",
            "deleted_at": null
        }
    ],
    "count": 0
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "data": {
            "items": {
                "$ref": "#/components/schemas/OrganizationPublic"
            },
            "type": "array",
            "title": "Data"
        },
        "count": {
            "type": "integer",
            "title": "Count"
        }
    },
    "type": "object",
    "required": [
        "data",
        "count"
    ],
    "title": "OrganizationsPublic",
    "description": "Response schema for a list of organizations."
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/organizations/{organization_id}

Read Organization

Description

Get an organization by ID.

Only members or superusers can view the organization.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
organization_id path string No

Responses

{
    "id": "733001ea-39d3-46d5-bc64-2d36a5238dd2",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "name": "string",
    "avatar_image_url": null,
    "avatar_image_media": null,
    "description": null,
    "rework_available": 0,
    "owner_id": "57b211fc-222e-4ed0-a9bb-34dcdcedeec9",
    "deleted_at": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "name": {
            "type": "string",
            "title": "Name"
        },
        "avatar_image_url": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Avatar Image Url"
        },
        "avatar_image_media": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/MediaResourcePublic"
                },
                {
                    "type": "null"
                }
            ]
        },
        "description": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Description"
        },
        "rework_available": {
            "type": "integer",
            "title": "Rework Available"
        },
        "owner_id": {
            "type": "string",
            "format": "uuid",
            "title": "Owner Id"
        },
        "deleted_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Deleted At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "created_at",
        "updated_at",
        "name",
        "description",
        "rework_available",
        "owner_id"
    ],
    "title": "OrganizationPublic",
    "description": "Public response schema for an organization."
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

PUT /api/v1/organizations/{organization_id}

Update Organization

Description

Update an organization.

Only the owner or superusers can update. If avatar_image is provided, it should be a presigned URL from /uploads/presigned-url.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
organization_id path string No

Request body

{
    "name": null,
    "avatar_image": null,
    "description": null,
    "rework_available": null,
    "owner_id": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "name": {
            "anyOf": [
                {
                    "type": "string",
                    "maxLength": 255
                },
                {
                    "type": "null"
                }
            ],
            "title": "Name"
        },
        "avatar_image": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "$ref": "#/components/schemas/MediaInput"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Avatar Image",
            "description": "Avatar image URL (presigned URL from /uploads/presigned-url)"
        },
        "description": {
            "anyOf": [
                {
                    "type": "string",
                    "maxLength": 1000
                },
                {
                    "type": "null"
                }
            ],
            "title": "Description"
        },
        "rework_available": {
            "anyOf": [
                {
                    "type": "integer"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Rework Available"
        },
        "owner_id": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "uuid"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Owner Id",
            "description": "New owner user ID for ownership transfer"
        }
    },
    "type": "object",
    "title": "OrganizationUpdate",
    "description": "Schema for updating an organization. All fields are optional."
}

Responses

{
    "id": "47737bea-7be8-4083-9104-b1bb524eceed",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "name": "string",
    "avatar_image_url": null,
    "avatar_image_media": null,
    "description": null,
    "rework_available": 0,
    "owner_id": "29acac69-3a43-4fd5-8f11-87a623af17cc",
    "deleted_at": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "name": {
            "type": "string",
            "title": "Name"
        },
        "avatar_image_url": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Avatar Image Url"
        },
        "avatar_image_media": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/MediaResourcePublic"
                },
                {
                    "type": "null"
                }
            ]
        },
        "description": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Description"
        },
        "rework_available": {
            "type": "integer",
            "title": "Rework Available"
        },
        "owner_id": {
            "type": "string",
            "format": "uuid",
            "title": "Owner Id"
        },
        "deleted_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Deleted At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "created_at",
        "updated_at",
        "name",
        "description",
        "rework_available",
        "owner_id"
    ],
    "title": "OrganizationPublic",
    "description": "Public response schema for an organization."
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

DELETE /api/v1/organizations/{organization_id}

Delete Organization

Description

Soft-delete an organization. Only the owner or superusers can delete.

Memberships and org-scoped resources are intentionally retained (soft-delete hides the org; it does not cascade). The avatar media is detached later by the soft-delete cleanup job, not here.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
organization_id path string No

Responses

{
    "message": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "message": {
            "type": "string",
            "title": "Message"
        }
    },
    "type": "object",
    "required": [
        "message"
    ],
    "title": "Message"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

POST /api/v1/organizations/{organization_id}/restore

Restore Organization

Description

Restore a soft-deleted organization. Only the owner or superusers can restore.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
organization_id path string No

Responses

{
    "id": "af7ce8bf-9531-4d29-8b5a-109e7d76e1c5",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "name": "string",
    "avatar_image_url": null,
    "avatar_image_media": null,
    "description": null,
    "rework_available": 0,
    "owner_id": "ebfa12aa-1d75-47be-b701-c2e3b6a5a9d8",
    "deleted_at": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "name": {
            "type": "string",
            "title": "Name"
        },
        "avatar_image_url": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Avatar Image Url"
        },
        "avatar_image_media": {
            "anyOf": [
                {
                    "$ref": "#/components/schemas/MediaResourcePublic"
                },
                {
                    "type": "null"
                }
            ]
        },
        "description": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Description"
        },
        "rework_available": {
            "type": "integer",
            "title": "Rework Available"
        },
        "owner_id": {
            "type": "string",
            "format": "uuid",
            "title": "Owner Id"
        },
        "deleted_at": {
            "anyOf": [
                {
                    "type": "string",
                    "format": "date-time"
                },
                {
                    "type": "null"
                }
            ],
            "title": "Deleted At"
        }
    },
    "type": "object",
    "required": [
        "id",
        "created_at",
        "updated_at",
        "name",
        "description",
        "rework_available",
        "owner_id"
    ],
    "title": "OrganizationPublic",
    "description": "Public response schema for an organization."
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

GET /api/v1/organizations/{organization_id}/members

Read Organization Members

Description

List all members of an organization.

Only members can view the member list.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
limit query integer 100 No
organization_id path string No
skip query integer 0 No

Responses

{
    "id": "56ca5f9f-abd3-4399-a166-b61a711e2d01",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "data": [
        {
            "user_id": "ee62ed21-ba02-453b-96f8-899ab5ca38c0",
            "joined_at": "2022-04-13T15:42:05.901Z",
            "email": "derp@meme.org",
            "full_name": null
        }
    ],
    "count": 0
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "data": {
            "items": {
                "$ref": "#/components/schemas/OrganizationMemberPublic"
            },
            "type": "array",
            "title": "Data"
        },
        "count": {
            "type": "integer",
            "title": "Count"
        }
    },
    "type": "object",
    "required": [
        "data",
        "count"
    ],
    "title": "OrganizationMembersPublic",
    "description": "Response schema for a list of organization members."
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

POST /api/v1/organizations/{organization_id}/members

Add Organization Member

Description

Add a member to an organization.

Only the owner or superusers can add members.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
organization_id path string No

Request body

{
    "user_id": "e7200dbc-14a3-4a0d-b64a-13a9400606af"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "user_id": {
            "type": "string",
            "format": "uuid",
            "title": "User Id"
        }
    },
    "type": "object",
    "required": [
        "user_id"
    ],
    "title": "AddMemberRequest",
    "description": "Request schema for adding a member to an organization."
}

Responses

{
    "id": "4cab1a35-81ad-4dbf-bb37-aa08e79333ff",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "data": [
        {
            "user_id": "4a53ae40-0b0c-4844-ba64-ed21730f4677",
            "joined_at": "2022-04-13T15:42:05.901Z",
            "email": "derp@meme.org",
            "full_name": null
        }
    ],
    "count": 0
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "data": {
            "items": {
                "$ref": "#/components/schemas/OrganizationMemberPublic"
            },
            "type": "array",
            "title": "Data"
        },
        "count": {
            "type": "integer",
            "title": "Count"
        }
    },
    "type": "object",
    "required": [
        "data",
        "count"
    ],
    "title": "OrganizationMembersPublic",
    "description": "Response schema for a list of organization members."
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

DELETE /api/v1/organizations/{organization_id}/members/{user_id}

Remove Organization Member

Description

Remove a member from an organization.

  • Owner or superusers can remove any member
  • Users can remove themselves from an organization

The owner cannot be removed from the organization.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
organization_id path string No
user_id path string No

Responses

{
    "message": "string"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "message": {
            "type": "string",
            "title": "Message"
        }
    },
    "type": "object",
    "required": [
        "message"
    ],
    "title": "Message"
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

POST /api/v1/organizations/{organization_id}/migrate-resources

Migrate User Resources Endpoint

Description

Migrate user's personal resources to organization.

Migrates resources owned by the specified source user from personal (organization_id = NULL) to the specified organization. All selected resources are migrated atomically (all-or-nothing) in a single transaction.

Requirements: - Only superusers can perform migrations (admin-only operation) - Source user must be a member of the target organization - Only personal resources (organization_id IS NULL) are migrated - Only resources owned by the source user are migrated

Use Cases: - One-time production migration from single-user accounts to multi-user organizations - Admin-initiated resource transfers between user accounts and organizations

Security: - Restricted to superusers only (production data migration tool) - Source user must be organization member (prevents accidental cross-org transfers) - Transaction ensures atomicity (no partial migrations on failure)

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
organization_id path string No

Request body

{
    "user_id": "c1945542-74ca-403f-b40f-227b7b2f6928",
    "migrate_products": true,
    "migrate_subjects": true,
    "migrate_styles": true,
    "migrate_generations": true,
    "migrate_shootings": true,
    "migrate_shot_types": true,
    "migrate_stylists": true,
    "migrate_background_presets": true,
    "migrate_resolution_presets": true,
    "migrate_product_type_shot_types": true,
    "migrate_external_integrations": true,
    "migrate_shooting_guidelines": true,
    "migrate_export_configurations": true
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "properties": {
        "user_id": {
            "type": "string",
            "format": "uuid",
            "title": "User Id",
            "description": "Source user whose resources will be migrated"
        },
        "migrate_products": {
            "type": "boolean",
            "title": "Migrate Products",
            "description": "Migrate personal products",
            "default": false
        },
        "migrate_subjects": {
            "type": "boolean",
            "title": "Migrate Subjects",
            "description": "Migrate personal subjects",
            "default": false
        },
        "migrate_styles": {
            "type": "boolean",
            "title": "Migrate Styles",
            "description": "Migrate personal styles",
            "default": false
        },
        "migrate_generations": {
            "type": "boolean",
            "title": "Migrate Generations",
            "description": "Migrate personal generations",
            "default": false
        },
        "migrate_shootings": {
            "type": "boolean",
            "title": "Migrate Shootings",
            "description": "Migrate personal shootings",
            "default": false
        },
        "migrate_shot_types": {
            "type": "boolean",
            "title": "Migrate Shot Types",
            "description": "Migrate personal shot types",
            "default": false
        },
        "migrate_stylists": {
            "type": "boolean",
            "title": "Migrate Stylists",
            "description": "Migrate personal stylists",
            "default": false
        },
        "migrate_background_presets": {
            "type": "boolean",
            "title": "Migrate Background Presets",
            "description": "Migrate personal background presets",
            "default": false
        },
        "migrate_resolution_presets": {
            "type": "boolean",
            "title": "Migrate Resolution Presets",
            "description": "Migrate personal resolution presets",
            "default": false
        },
        "migrate_product_type_shot_types": {
            "type": "boolean",
            "title": "Migrate Product Type Shot Types",
            "description": "Migrate personal product type shot type mappings",
            "default": false
        },
        "migrate_external_integrations": {
            "type": "boolean",
            "title": "Migrate External Integrations",
            "description": "Migrate personal external integrations",
            "default": false
        },
        "migrate_shooting_guidelines": {
            "type": "boolean",
            "title": "Migrate Shooting Guidelines",
            "description": "Migrate personal shooting guidelines",
            "default": false
        },
        "migrate_export_configurations": {
            "type": "boolean",
            "title": "Migrate Export Configurations",
            "description": "Migrate export configurations (personal → organization)",
            "default": false
        }
    },
    "type": "object",
    "required": [
        "user_id"
    ],
    "title": "ResourceMigrationRequest",
    "description": "Request schema for migrating personal resources to organization."
}

Responses

{
    "id": "7985aa1a-9c06-46e9-b488-1f14f346bf22",
    "created_at": "2022-04-13T15:42:05.901Z",
    "updated_at": "2022-04-13T15:42:05.901Z",
    "message": "string",
    "organization_id": "594cfc64-b2c8-46ea-838b-d616356cf7f8",
    "migrated_counts": {
        "products": 0,
        "subjects": 0,
        "styles": 0,
        "generations": 0,
        "shootings": 0,
        "shot_types": 0,
        "stylists": 0,
        "background_presets": 0,
        "resolution_presets": 0,
        "product_type_shot_types": 0,
        "external_integrations": 0,
        "shooting_guidelines": 0,
        "export_configurations": 0
    },
    "total_migrated": 0
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
        },
        "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
        },
        "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
        },
        "message": {
            "type": "string",
            "title": "Message",
            "description": "Success message"
        },
        "organization_id": {
            "type": "string",
            "format": "uuid",
            "title": "Organization Id",
            "description": "Target organization ID"
        },
        "migrated_counts": {
            "$ref": "#/components/schemas/ResourceMigrationCounts",
            "description": "Counts of migrated resources per type"
        },
        "total_migrated": {
            "type": "integer",
            "title": "Total Migrated",
            "description": "Total number of resources migrated across all types"
        }
    },
    "type": "object",
    "required": [
        "message",
        "organization_id",
        "migrated_counts",
        "total_migrated"
    ],
    "title": "ResourceMigrationResponse",
    "description": "Response schema for resource migration."
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

Schemas

AddMemberRequest

Name Type Description
user_id string(uuid)

HTTPValidationError

Name Type Description
detail Array<ValidationError>

MediaInput

Name Type Description
alt_text
caption
color_profile
dominant_color
duration
height
media_resource_id
protected boolean
url
width

MediaResourcePublic

Name Type Description
alt_text
aspect_ratio
caption
color_profile
content_hash string
created_at string(date-time)
dominant_color
duration
extension string
file_size integer
height
id string(uuid)
orientation
protected boolean
resource_type MediaResourceType
url string
width

MediaResourceType

Type: string

Message

Name Type Description
message string

OrganizationCreate

Name Type Description
avatar_image Avatar image URL (presigned URL from /uploads/presigned-url)
description
name string
rework_available

OrganizationMemberPublic

Name Type Description
email string()
full_name
joined_at string(date-time)
user_id string(uuid)

OrganizationMembersPublic

Name Type Description
count integer
created_at string(date-time)
data Array<OrganizationMemberPublic>
id string(uuid)
updated_at string(date-time)

OrganizationPublic

Name Type Description
avatar_image_media
avatar_image_url
created_at string(date-time)
deleted_at
description
id string(uuid)
name string
owner_id string(uuid)
rework_available integer
updated_at string(date-time)

OrganizationsPublic

Name Type Description
count integer
created_at string(date-time)
data Array<OrganizationPublic>
id string(uuid)
updated_at string(date-time)

OrganizationUpdate

Name Type Description
avatar_image Avatar image URL (presigned URL from /uploads/presigned-url)
description
name
owner_id New owner user ID for ownership transfer
rework_available

ResourceMigrationCounts

Name Type Description
background_presets integer
export_configurations integer
external_integrations integer
generations integer
product_type_shot_types integer
products integer
resolution_presets integer
shooting_guidelines integer
shootings integer
shot_types integer
styles integer
stylists integer
subjects integer

ResourceMigrationRequest

Name Type Description
migrate_background_presets boolean Migrate personal background presets
migrate_export_configurations boolean Migrate export configurations (personal → organization)
migrate_external_integrations boolean Migrate personal external integrations
migrate_generations boolean Migrate personal generations
migrate_product_type_shot_types boolean Migrate personal product type shot type mappings
migrate_products boolean Migrate personal products
migrate_resolution_presets boolean Migrate personal resolution presets
migrate_shooting_guidelines boolean Migrate personal shooting guidelines
migrate_shootings boolean Migrate personal shootings
migrate_shot_types boolean Migrate personal shot types
migrate_styles boolean Migrate personal styles
migrate_stylists boolean Migrate personal stylists
migrate_subjects boolean Migrate personal subjects
user_id string(uuid) Source user whose resources will be migrated

ResourceMigrationResponse

Name Type Description
created_at string(date-time)
id string(uuid)
message string Success message
migrated_counts ResourceMigrationCounts Counts of migrated resources per type
organization_id string(uuid) Target organization ID
total_migrated integer Total number of resources migrated across all types
updated_at string(date-time)

RoleName

Type: string

RolePublic

Name Type Description
description
id string(uuid)
name RoleName

UpdatePassword

Name Type Description
current_password string
new_password string

UserCreate

Name Type Description
email string()
full_name
is_active boolean
is_superuser boolean
password string
rework_available integer
role_id

UserPublic

Name Type Description
created_at string(date-time)
deleted_at
email string()
full_name
id string(uuid)
is_active boolean
is_superuser boolean
rework_available integer
role
updated_at string(date-time)

UserRegister

Name Type Description
created_at string(date-time)
email string()
full_name
id string(uuid)
password string
updated_at string(date-time)

UsersPublic

Name Type Description
count integer
created_at string(date-time)
data Array<UserPublic>
id string(uuid)
updated_at string(date-time)

UserUpdate

Name Type Description
email
full_name
is_active
is_superuser
password
rework_available
role_id

UserUpdateMe

Name Type Description
email
full_name

ValidationError

Name Type Description
ctx
input
loc Array<>
msg string
type string

Security schemes

Name Type Scheme Description
OAuth2PasswordBearer oauth2