openapi: 3.0.1
info:
  title: To-do Service
  description: A Service keeping track of open to-do items
  version: 1.0.26
servers:
- description: ''
  url: https://api.uat.btx.fr.banqup.com/core/todo
- description: ''
  url: https://api.uat.btx.eu.banqup.com/core/todo
paths:
  /v1/spaces/{spaceId}/todoItems/{todoItemId}:
    get:
      tags:
      - Todo Service
      summary: Retrieve a todo item.
      description: "Get details of a specific todo item.\n        Requires space_read
        on the specified spaceId and only Todo Items where the caller has the scope
        on the resource specified by the TodoItem are returned.\n <br/> Scope: space_read"
      operationId: getTodoItem
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: todoItemId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: The requested todo item.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TodoItemResponse'
        '400':
          description: Invalid Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '403':
          description: Forbidden Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
        '404':
          description: Todo item not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - todo_service:
        - space_read
    put:
      tags:
      - Todo Service
      summary: Update a todo item.
      description: "Modify an existing todo item by its ID.\n        Requires the
        scope todo_item_write on the specified spaceId and scope todo_type_manage
        on the resource matching the type of the created resource.\n <br/> Scope:
        space_foundation_todo_write, todo_type_manage"
      operationId: updateTodoItem
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: todoItemId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TodoItemPatchRequest'
        required: true
      responses:
        '400':
          description: Invalid Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '200':
          description: Todo item updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TodoItemResponse'
        '403':
          description: Forbidden Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
        '404':
          description: Todo item not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - todo_service:
        - space_foundation_todo_write
        - todo_type_manage
    delete:
      tags:
      - Todo Service
      summary: Delete a todo item
      description: "Remove a specific todo item from the collection.\n        Requires
        the scope todo_item_write on the specified spaceId and scope todo_type_manage
        on the resource matching the type of the created resource.\n <br/> Scope:
        space_foundation_todo_write, todo_type_manage"
      operationId: deleteTodoItem
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: todoItemId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '400':
          description: Invalid Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '204':
          description: Todo item deleted successfully.
        '403':
          description: Forbidden Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
        '404':
          description: Todo item not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - todo_service:
        - space_foundation_todo_write
        - todo_type_manage
  /v1/spaces/{spaceId}/todoItems:
    get:
      tags:
      - Todo Service
      summary: List all todo items in a space.
      description: "Retrieve a list of all todo items.\n        Requires space_read
        on the specified spaceId and only Todo Items where the caller has the scope
        on the resource specified by the TodoItem are returned.\n <br/> Scope: space_read"
      operationId: listTodoItems_1
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: type
        in: query
        required: false
        schema:
          type: string
      - name: reference
        in: query
        required: false
        schema:
          type: string
      responses:
        '400':
          description: Invalid Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '403':
          description: Forbidden Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
        '200':
          description: A list of todo items.
          content:
            application/x-ndjson:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TodoItemResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/TodoItemResponseList'
      security:
      - todo_service:
        - space_read
    post:
      tags:
      - Todo Service
      summary: Create a new todo item.
      description: "Add a new todo item to the collection.\n        Requires todo_item_write
        on the specified spaceId and the scope todo_type_manage on the resource matching
        the type of the created resource.\n <br/> Scope: space_foundation_todo_write,
        todo_type_manage"
      operationId: addTodoItem
      parameters:
      - name: spaceId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TodoItemRequest'
        required: true
      responses:
        '400':
          description: Invalid Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '201':
          description: Todo item created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TodoItemResponse'
        '403':
          description: Forbidden Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 403
                error: PERMISSION_DENIED
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: 2018-08-27 12:34:50
                type: about:blank
                title: Forbidden
                detail: Access to the requested resource was denied.
      security:
      - todo_service:
        - space_foundation_todo_write
        - todo_type_manage
  /v1/plugins/todoTypes/authorize:
    post:
      tags:
      - plugin-api-controller
      operationId: authorizeTodoType
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthorizationRequestTodoTypeData'
        required: true
      responses:
        '403':
          description: Todo type authorization failed.
        '204':
          description: Todo type authorized successfully.
      description: ' <br/> Scope: []'
components:
  schemas:
    TodoItemPatchRequest:
      type: object
      properties:
        data:
          type: object
        reference:
          type: string
          description: Optional identifier to quickly find todo items.
          example: bf514229-fa39-4bca-b8d9-b96607e9961e
    ApiErrorProblemDetail:
      required:
      - error
      - requestId
      - timestamp
      type: object
      properties:
        status:
          type: integer
          format: int32
        error:
          type: string
        requestId:
          type: string
        timestamp:
          type: string
          format: date-time
        type:
          type: string
          format: uri
        title:
          type: string
        detail:
          type: string
        instance:
          type: string
          format: uri
        problems:
          type: array
          items:
            $ref: '#/components/schemas/NestedProblem'
        properties:
          type: object
          additionalProperties:
            type: object
    NestedProblem:
      required:
      - detail
      - error
      - title
      type: object
      properties:
        error:
          type: string
        title:
          type: string
        detail:
          type: string
        type:
          type: string
          format: uri
    TodoItemResponse:
      required:
      - data
      - id
      - spaceId
      - type
      type: object
      properties:
        id:
          type: string
          format: uuid
        spaceId:
          type: string
          format: uuid
        type:
          type: string
        data:
          type: object
        reference:
          type: string
        resourceId:
          type: string
        scope:
          type: string
    TodoItemRequest:
      required:
      - data
      - type
      type: object
      properties:
        type:
          type: string
          description: The type of the todo item.
          example: overdueDocument
        data:
          type: object
        reference:
          type: string
          description: Optional identifier to quickly find todo items.
          example: bf514229-fa39-4bca-b8d9-b96607e9961e
        resourceId:
          type: string
          description: The UMA resource needed to view this item.
          example: 1b34de13-4063-41e6-8b68-237f0c391550
        scope:
          type: string
          description: The UMA scope needed on the specified resource.
          example: space_read
    AuthorizationRequestTodoTypeData:
      required:
      - data
      - extensionId
      - name
      - namespace
      - operation
      - subject
      - version
      type: object
      properties:
        subject:
          type: string
        operation:
          type: string
        namespace:
          type: string
        name:
          type: string
        version:
          type: string
        extensionId:
          type: string
        data:
          $ref: '#/components/schemas/TodoTypeData'
    TodoTypeData:
      required:
      - type
      type: object
      properties:
        type:
          type: string
    TodoItemResponseList:
      type: object
      properties:
        todoItems:
          type: array
          items:
            $ref: '#/components/schemas/TodoItemResponse'
  securitySchemes:
    todo_service:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://api.uat.btx.fr.banqup.com/v1/oauth20/authorization
          tokenUrl: https://api.uat.btx.fr.banqup.com/v1/oauth20/token_kc
          scopes: {}
