Binarly User API

The User API from Binarly — 3 operation(s) for user.

OpenAPI Specification

binarly-user-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Binarly Assistant User API
  version: 4.275.2
security:
- auth: []
tags:
- name: User
paths:
  /api/v4/users:
    get:
      summary: List Users
      operationId: ListUsers
      x-permission: users.list
      tags:
      - User
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WithUsers'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
    post:
      summary: Create User
      operationId: CreateUser
      x-permission: users.create
      tags:
      - User
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUserPayload'
      responses:
        '201':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v4/users:bulkDelete:
    post:
      summary: Bulk Delete Users
      operationId: BulkDeleteUsers
      x-permission: users.delete
      tags:
      - User
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkIds'
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkIds'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /api/v4/users/me:
    get:
      summary: Get Current User
      operationId: GetCurrentUser
      x-permission: ''
      tags:
      - User
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/WithUser'
                - $ref: '#/components/schemas/WithOrg'
                - $ref: '#/components/schemas/WithAllResourcesPermissions'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  responses:
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ForbiddenErrorResponse'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Conflict:
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    WithOptionalResourceType:
      type: object
      properties:
        resourceType:
          $ref: '#/components/schemas/ResourceType'
    Org:
      allOf:
      - $ref: '#/components/schemas/WithId'
      - $ref: '#/components/schemas/WithName'
    ResourcePermissions:
      allOf:
      - $ref: '#/components/schemas/WithResourceName'
      - $ref: '#/components/schemas/WithPermissions'
    WithUser:
      type: object
      required:
      - user
      properties:
        user:
          $ref: '#/components/schemas/User'
    ErrorDetail:
      type: object
      required:
      - error
      properties:
        reason:
          type: string
          x-go-type-skip-optional-pointer: true
        field:
          type: string
          x-go-type-skip-optional-pointer: true
        service:
          type: string
          x-go-type-skip-optional-pointer: true
    User:
      readOnly: true
      allOf:
      - $ref: '#/components/schemas/WithUserId'
      - $ref: '#/components/schemas/WithOptionalId'
      - $ref: '#/components/schemas/WithOptionalCreateTime'
      - $ref: '#/components/schemas/WithOptionalEmail'
      - $ref: '#/components/schemas/WithOptionalUserStatus'
      - $ref: '#/components/schemas/WithOptionalResourceType'
    WithAllResourcesPermissions:
      type: object
      required:
      - resourcesPermissions
      properties:
        resourcesPermissions:
          type: array
          items:
            $ref: '#/components/schemas/ResourcePermissions'
    WithIds:
      type: object
      required:
      - ids
      properties:
        ids:
          type: array
          items:
            $ref: '#/components/schemas/ULID'
    WithOptionalId:
      type: object
      properties:
        id:
          readOnly: true
          allOf:
          - $ref: '#/components/schemas/ULID'
    WithEmail:
      type: object
      required:
      - email
      properties:
        email:
          type: string
          example: user@binarly.io
    WithOptionalEmail:
      type: object
      properties:
        email:
          type: string
          example: user@binarly.io
    WithOptionalUserStatus:
      type: object
      properties:
        status:
          type: string
          x-go-type: string
          enum:
          - active
          - archived
    ForbiddenErrorResponse:
      type: object
      required:
      - message
      - permission
      - resourceName
      properties:
        message:
          type: string
        permission:
          type: string
        resourceName:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
    WithName:
      type: object
      required:
      - name
      properties:
        name:
          type: string
    ResourceType:
      type: string
      enum:
      - Org
      - Group
      - Product
      - User
      - Image
      - Finding
      - Occurrence
    WithOrg:
      type: object
      required:
      - org
      properties:
        org:
          $ref: '#/components/schemas/Org'
    BulkIds:
      $ref: '#/components/schemas/WithIds'
    ErrorResponse:
      required:
      - message
      type: object
      properties:
        message:
          type: string
          readOnly: true
          x-go-type-skip-optional-pointer: true
        details:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
    CreateUserPayload:
      allOf:
      - $ref: '#/components/schemas/WithEmail'
    WithPermissions:
      type: object
      required:
      - permissions
      properties:
        permissions:
          type: array
          items:
            type: string
            example: users.create
    WithResourceName:
      type: object
      required:
      - resourceName
      properties:
        resourceName:
          type: string
    WithUsers:
      type: object
      required:
      - users
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/User'
    ULID:
      type: string
      format: ulid
      minLength: 26
      maxLength: 26
      example: 01ARZ3NDEKTSV4RRFFQ69G5FAV
      x-go-type: ulid.ULID
      x-go-type-import:
        path: github.com/oklog/ulid/v2
    WithId:
      type: object
      required:
      - id
      properties:
        id:
          readOnly: true
          allOf:
          - $ref: '#/components/schemas/ULID'
    WithOptionalCreateTime:
      type: object
      properties:
        createTime:
          type: string
          readOnly: true
          example: '2024-01-01T01:00:00Z'
    WithUserId:
      type: object
      required:
      - userId
      properties:
        userId:
          type: string
          readOnly: true
          x-go-type-skip-optional-pointer: true
  securitySchemes:
    auth:
      type: http
      scheme: bearer
      bearerFormat: JWT