Aleph Alpha Projects API

A Project is an abstraction representing a group of running operations associated with the same task in the Studio. Endpoints under this tag allow you to create, update, delete, and retrieve projects. Projects help in organizing and managing tasks efficiently.

OpenAPI Specification

aleph-alpha-projects-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PhariaStudio Projects API
  version: 0.1.0
  description: A Project is an abstraction representing a group of running operations associated with the same task in the Studio. Endpoints under this tag allow you to create, update, delete, and retrieve projects. Projects help in organizing and managing tasks efficiently.
servers:
- url: '{host}/v1/studio'
  variables:
    host:
      default: https://api.pharia.example.com
security:
- BearerAuth: []
tags:
- name: Projects
  description: A Project is an abstraction representing a group of running operations associated with the same task in the Studio. Endpoints under this tag allow you to create, update, delete, and retrieve projects. Projects help in organizing and managing tasks efficiently.
paths:
  /projects:
    post:
      tags:
      - Projects
      summary: Create Project
      description: Create a new `Project`.
      operationId: create_project_projects_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: string
                format: uuid
                title: Response Create Project Projects Post
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '409':
          description: Prerequisites not met or project name already exists
        '500':
          description: Internal Server Error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Projects
      summary: Get Many Projects
      operationId: get_many_projects_projects_get
      parameters:
      - name: with_user_details
        in: query
        required: false
        schema:
          type: boolean
          description: Whether to include the user details in the response.
          default: false
          title: With User Details
        description: Whether to include the user details in the response.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProjectResponseV2'
                title: Response Get Many Projects Projects Get
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Workspace not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /projects/{project_id}:
    get:
      tags:
      - Projects
      summary: Get Project
      description: Get a `Project` by its id.
      operationId: get_project_projects__project_id__get
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          description: The UUID of the project.
          title: Project Id
        description: The UUID of the project.
      - name: with_user_details
        in: query
        required: false
        schema:
          type: boolean
          description: Whether to include the user details in the response.
          default: false
          title: With User Details
        description: Whether to include the user details in the response.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectResponseV2'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Project not found
        '409':
          description: Prerequisites not met
        '500':
          description: Internal Server Error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Projects
      summary: Delete Project
      description: Delete a `Project` by its id.
      operationId: delete_project_projects__project_id__delete
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          description: The UUID of the project.
          title: Project Id
        description: The UUID of the project.
      responses:
        '204':
          description: No content
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Project not found
        '409':
          description: Prerequisites not met
        '500':
          description: Internal Server Error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - Projects
      summary: Update Project
      description: Update a project's details.
      operationId: update_project_projects__project_id__patch
      parameters:
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          description: The UUID of the project.
          title: Project Id
        description: The UUID of the project.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchProjectRequest'
      responses:
        '204':
          description: No content
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Project not found
        '409':
          description: Prerequisites not met
        '500':
          description: Internal Server Error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /workspaces/{workspace_id}/projects/{project_id}/userlist:
    get:
      tags:
      - Projects
      summary: Get Project Userlist
      description: Get a list of all non-service users of a Project by the `Project` identifier.
      operationId: get_project_userlist_workspaces__workspace_id__projects__project_id__userlist_get
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          anyOf:
          - type: string
            format: uuid
          - const: default
            type: string
          title: Workspace Id
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          description: The UUID of the project.
          title: Project Id
        description: The UUID of the project.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetProjectUserlistResponse'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '404':
          description: List of Project user not found
        '500':
          description: Internal Server Error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - Projects
      summary: Update Project Userlist
      description: Update the list of users of a `Project`
      operationId: update_project_userlist_workspaces__workspace_id__projects__project_id__userlist_patch
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          anyOf:
          - type: string
            format: uuid
          - const: default
            type: string
          title: Workspace Id
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          description: The UUID of the project.
          title: Project Id
        description: The UUID of the project.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProjectUserlistRequest'
      responses:
        '204':
          description: No content
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '409':
          description: Prerequisites not met
        '500':
          description: Internal Server Error
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UpsertOrRemoveProjectUser:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier of the user
          examples:
          - '12345'
        role:
          type: string
          enum:
          - owner
          - member
          title: Role
          description: The role of the user
          examples:
          - owner
          - member
      type: object
      required:
      - id
      - role
      title: UpsertOrRemoveProjectUser
      description: Model for adding or removing users from a project.
    User:
      properties:
        type:
          type: string
          const: user
          title: Type
          default: user
        id:
          type: string
          title: Id
          description: The unique identifier of the user
          examples:
          - '123456789'
        user_name:
          type: string
          title: User Name
          description: The username of the user
          examples:
          - Chuck Norris
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The UTC timestamp of the time the user has been created in ISO 8601 format.
          examples:
          - '2024-08-08T15:09:00Z'
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: The UTC timestamp of the time the user has been updated in ISO 8601 format.
          examples:
          - '2024-08-08T15:09:00Z'
        email:
          type: string
          title: Email
          description: The email of the user
          examples:
          - chuck@norris.com
        profile:
          $ref: '#/components/schemas/UserProfile'
          description: The profile of the user
      type: object
      required:
      - id
      - user_name
      - created_at
      - updated_at
      - email
      - profile
      title: User
    ProjectResponseV2:
      properties:
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: The timestamp when this resource was last updated in UTC.
        updated_by:
          type: string
          title: Updated By
          description: The ID of the user that updated the resource.
          examples:
          - '12345'
        id:
          type: integer
          title: Id
          description: The unique id of the project.
          examples:
          - 1
        name:
          type: string
          title: Name
          description: The unique name of the project.
          examples:
          - Project
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
          description: The description of the project.
          examples:
          - This is a project.
        project_id:
          type: string
          format: uuid
          title: Project Id
          description: The universal unique id of the project.
          examples:
          - 123e4567-e89b-12d3-a456-426614174000
        error:
          anyOf:
          - type: string
          - type: 'null'
          title: Error
          description: The error message if the user details could not be retrieved.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The timestamp when this resource was created in UTC.
        created_by:
          anyOf:
          - type: string
          - $ref: '#/components/schemas/User'
          title: Created By
          description: The ID of the user that created the resource.
          examples:
          - '12345'
          - created_at: '2224-08-08T15:09:00Z'
            email: john.doe@example.com
            id: '12345'
            profile:
              given_name: John
              last_name: Doe
            type: user
            updated_at: '2224-08-08T15:09:00Z'
            user_name: john.doe
      type: object
      required:
      - updated_at
      - updated_by
      - id
      - name
      - project_id
      - created_at
      - created_by
      title: ProjectResponseV2
      description: Response model for project operations (v2) with enhanced user details.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    UpdateProjectUserlistRequest:
      properties:
        upsert:
          items:
            $ref: '#/components/schemas/UpsertOrRemoveProjectUser'
          type: array
          title: Upsert
          description: The list of users to be added to the project and their roles
        remove:
          items:
            $ref: '#/components/schemas/UpsertOrRemoveProjectUser'
          type: array
          title: Remove
          description: The list of users to be removed from the project
      type: object
      required:
      - upsert
      - remove
      title: UpdateProjectUserlistRequest
      description: Request model for updating project user list.
    WPUserRole:
      type: string
      enum:
      - owner
      - member
    UserProfile:
      properties:
        given_name:
          type: string
          title: Given Name
          description: The given name of the profile
          examples:
          - Chuck
        last_name:
          type: string
          title: Last Name
          description: The last name of the profile
          examples:
          - Norris
      type: object
      required:
      - given_name
      - last_name
      title: UserProfile
    PatchProjectRequest:
      properties:
        name:
          anyOf:
          - type: string
            maxLength: 100
          - type: 'null'
          title: Name
          description: The name of the project.
          examples:
          - Project
        description:
          anyOf:
          - type: string
            maxLength: 1000
          - type: 'null'
          title: Description
          description: The description of the project.
          examples:
          - This is a project.
        archived:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Archived
          description: The archival status of the project
      type: object
      title: PatchProjectRequest
      description: Request model for partially updating a project.
    GetProjectUserlistResponse:
      items:
        $ref: '#/components/schemas/ProjectUser'
      type: array
      title: GetProjectUserlistResponse
      description: Response model for getting project user list.
    ProjectUser:
      properties:
        type:
          type: string
          const: user
          title: Type
          default: user
        id:
          type: string
          title: Id
          description: The unique identifier of the user
          examples:
          - '123456789'
        user_name:
          type: string
          title: User Name
          description: The username of the user
          examples:
          - Chuck Norris
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The UTC timestamp of the time the user has been created in ISO 8601 format.
          examples:
          - '2024-08-08T15:09:00Z'
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: The UTC timestamp of the time the user has been updated in ISO 8601 format.
          examples:
          - '2024-08-08T15:09:00Z'
        email:
          type: string
          title: Email
          description: The email of the user
          examples:
          - chuck@norris.com
        profile:
          $ref: '#/components/schemas/UserProfile'
          description: The profile of the user
        role:
          $ref: '#/components/schemas/WPUserRole'
          description: The role of the user in a project
          examples:
          - owner
          - member
      type: object
      required:
      - id
      - user_name
      - created_at
      - updated_at
      - email
      - profile
      - role
      title: ProjectUser
      description: User model with project role information.
    ProjectRequest:
      properties:
        name:
          type: string
          maxLength: 100
          title: Name
          description: The name of the project.
          examples:
          - Project
        description:
          anyOf:
          - type: string
            maxLength: 1000
          - type: 'null'
          title: Description
          description: The description of the project.
          examples:
          - This is a project.
      type: object
      required:
      - name
      title: ProjectRequest
      description: Request model for creating or updating a project.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT