openapi: 3.0.3
info:
  title: Blind Insight REST API
  version: 5.5.2
  description: End-to-end encrypted datastore
paths:
  /api/accounts/change-password/:
    post:
      operationId: accounts_change-password
      description: |-
        Change the password of the currently authenticated user. The `old_password`
        field must match the currently set password. The `password` and
        `password_confirm` fields must match.

        The response will be a detail message indicating if the password change was
        successful.

        **On the command line:**

        ```bash
        blind accounts change-password --data password-change.json
        ```
      summary: Change user password
      tags:
        - accounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChangePassword"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/ChangePassword"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/ChangePassword"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PasswordChanged"
          description: ""
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PasswordChangedError"
          description: ""
  /api/accounts/login/:
    post:
      operationId: accounts_login
      description: |-
        Log in a user using their email and password. On success, returns a JSON web
        token which should be included in the `Authorization` header for all subsequent
        API requests in client implementations.

        The response will be a detail message indicating if the login was successful.

        **On the command line:**

        ```bash
        blind accounts login --data login.json
        ```
      summary: Login a user account
      tags:
        - accounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DefaultLogin"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/DefaultLogin"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/DefaultLogin"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
        - {}
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoginSuccessful"
          description: ""
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoginSuccessfulError"
          description: ""
  /api/accounts/logout/:
    post:
      operationId: accounts_logout
      description: |-
        Log out the currently authenticated user. This simply invalidates the JSON web
        token used.

        This is separate from the porcelain `blind logout` command which removes stored
        credentials on the local machine.

        The response will be a detail message indicating if the logout was successful.

        **On the command line:**

        ```bash
        blind accounts logout
        ```
      summary: Logout a user account
      tags:
        - accounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Logout"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/Logout"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/Logout"
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LogoutSuccessful"
          description: ""
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LogoutSuccessfulError"
          description: ""
  /api/accounts/profile/:
    get:
      operationId: accounts_profile_retrieve
      description: |-
        Retrieve the profile of the currently authenticated user.

        The response will be the profile object.

        **On the command line:**

        ```bash
        blind accounts profile retrieve
        ```
      summary: Get user profile
      tags:
        - accounts
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DefaultUserProfile"
          description: ""
    post:
      operationId: accounts_profile_create
      description: |-
        Create a profile for the currently authenticated user. This is useful if you
        don't have a profile yet, or if you want to edit an existing profile.

        The response will be the newly created profile object.

        **On the command line:**

        ```bash
        blind accounts profile create --data profile.json
        ```
      summary: Create user profile
      tags:
        - accounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DefaultUserProfile"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/DefaultUserProfile"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/DefaultUserProfile"
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DefaultUserProfile"
          description: ""
    put:
      operationId: accounts_profile_update
      description: |-
        Replace the currently authenticated user's profile with the data provided in
        the request. Fields not specified in the request will be dropped.

        The response will be the updated profile object.

        **On the command line:**

        ```bash
        blind accounts profile update --data profile.json
        ```
      summary: Update user profile
      tags:
        - accounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DefaultUserProfile"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/DefaultUserProfile"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/DefaultUserProfile"
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DefaultUserProfile"
          description: ""
    patch:
      operationId: accounts_profile_partial-update
      description: |-
        Update one or more fields of the currently authenticated user's profile. This
        does not replace the entire profile, it only updates the fields provided in
        the request.

        The response will be the updated profile object.

        **On the command line:**

        ```bash
        blind accounts profile partial-update --data profile-update.json
        ```
      summary: Partially update user profile
      tags:
        - accounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchedDefaultUserProfile"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/PatchedDefaultUserProfile"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/PatchedDefaultUserProfile"
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DefaultUserProfile"
          description: ""
  /api/accounts/register/:
    post:
      operationId: accounts_register
      description: |-
        This endpoint registers a new user. The user will receive an email with a link to activate their account.

        This will also create a new Organization for the user. The user will be the owner of the organization.

        See the [user registration](https://docs.blindinsight.io/) documentation for more information.

        The response will be the newly created user object.

        **On the command line:**

        You can supply record data on standard input with the `--data -` or write it to
        a file and give the `--data <filename>` flag.

        ```bash
        blind accounts register --data '{
          "email": "demo@example.com",
          "first_name": "Demo",
          "last_name": "User",
          "organization_name": "Demo",
          "password": "pass1234",
          "password_confirm": "pass1234"
        }'
        ```
      summary: Register a new user account
      tags:
        - accounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OrganizationRegisterUser"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/OrganizationRegisterUser"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/OrganizationRegisterUser"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
        - {}
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrganizationUserProfile"
          description: ""
  /api/accounts/register-email/:
    post:
      operationId: accounts_register-email
      description: |-
        Register a new email address for the currently authenticated user. This is
        useful if the user wants to change email addresses associated with
        their account.

        The new email must be verified before it is associated with the account.

        The response will be a detail message indicating if the email was registered.

        **On the command line:**

        ```bash
        blind accounts register-email --data '{"email": "demo-example@example.com"}'
        ```
      summary: Register user email
      tags:
        - accounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DefaultRegisterEmail"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/DefaultRegisterEmail"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/DefaultRegisterEmail"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegisteredEmail"
          description: ""
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegisteredEmailError"
          description: ""
  /api/accounts/reset-password/:
    post:
      operationId: accounts_reset-password
      description: |-
        Reset the password of the given user using the provided signature and timestamp.

        This endpoint is generally only used by an administrator to reset a user's
        password.

        The response will be a detail message indicating if the password reset was
        successful.

        **On the command line:**

        ```bash
        blind accounts reset-password --data reset-password.json
        ```
      summary: Reset user password
      tags:
        - accounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ResetPassword"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/ResetPassword"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/ResetPassword"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
        - {}
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PasswordReset"
          description: ""
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PasswordResetError"
          description: ""
  /api/accounts/send-reset-password-link/:
    post:
      operationId: accounts_send-reset-password-link
      description: |-
        Send a password reset link email to the user with the given email address. This
        endpoint does not require the user to have activated their account yet.

        The response will be a detail message indicating if the reset link was sent.

        **On the command line:**

        ```bash
        blind accounts send-reset-password-link --data '{"email": "demo@example.com"}'
        ```
      summary: Send reset password link
      tags:
        - accounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DefaultSendResetPasswordLink"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/DefaultSendResetPasswordLink"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/DefaultSendResetPasswordLink"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
        - {}
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResetPasswordLinkSent"
          description: ""
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResetPasswordLinkSentError"
          description: ""
  /api/accounts/verify-email/:
    post:
      operationId: accounts_verify-email
      description: |-
        Verify the authenticated user's email address. This is useful if you want to
        automate onboarding of users within your organization.

        The response will be a detail message indicating if the verification was
        successful.

        **On the command line:**

        ```bash
        blind accounts verify-email --data verification.json
        ```
      summary: Verify user email
      tags:
        - accounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/VerifyEmail"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/VerifyEmail"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/VerifyEmail"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
        - {}
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VerifiedEmail"
          description: ""
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VerifiedEmailError"
          description: ""
  /api/accounts/verify-registration/:
    post:
      operationId: accounts_verify-registration
      description: |-
        This endpoint verifies a new user with their user ID, a timestamp, and a signature. These values must come from the received verification email.

        The response will be a detail message indicating if the verification was successful.

        **On the command line:**

        ```bash
        blind accounts verify-registration --data registration.json
        ```
      summary: Verify a new user account
      tags:
        - accounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/VerifyRegistration"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/VerifyRegistration"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/VerifyRegistration"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
        - {}
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountVerified"
          description: ""
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountVerifiedError"
          description: ""
  /api/datasets/:
    get:
      operationId: datasets_list
      description:
        Retrieve a list of datasets. You can filter the list by providing
        query parameters.
      summary: Retrieve a list of Dataset objects, with filters
      parameters:
        - in: query
          name: description
          schema:
            type: string
          description: A longer description of the dataset.
        - in: query
          name: id
          schema:
            type: string
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: name
          schema:
            type: string
          description: A human-readable name for this dataset.
        - name: offset
          required: false
          in: query
          description: The initial index from which to return the results.
          schema:
            type: integer
        - in: query
          name: organization
          schema:
            type: string
          description: The organization that this dataset belongs to.
        - in: query
          name: slug
          schema:
            type: string
          description: A unique slug for this dataset.
      tags:
        - datasets
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginatedDatasetList"
          description: ""
    post:
      operationId: datasets_create
      description: Create a new dataset.
      summary: Create a new Dataset
      tags:
        - datasets
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Dataset"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/Dataset"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/Dataset"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Dataset"
          description: ""
  /api/datasets/{id}/:
    get:
      operationId: datasets_retrieve
      description: Retrieve one dataset.
      summary: Retrieve one Dataset object
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this dataset.
          required: true
      tags:
        - datasets
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Dataset"
          description: ""
    put:
      operationId: datasets_update
      description: Update an existing dataset.
      summary: Update a Dataset
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this dataset.
          required: true
      tags:
        - datasets
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Dataset"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/Dataset"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/Dataset"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Dataset"
          description: ""
    patch:
      operationId: datasets_partial_update
      description: Update an existing dataset with only the specified fields.
      summary: Partially update a Dataset
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this dataset.
          required: true
      tags:
        - datasets
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchedDataset"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/PatchedDataset"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/PatchedDataset"
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Dataset"
          description: ""
    delete:
      operationId: datasets_destroy
      description: Delete an existing dataset.
      summary: Delete a Dataset
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this dataset.
          required: true
      tags:
        - datasets
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "204":
          description: No response body
  /api/datasets/{id}/schema/{slug}/:
    get:
      operationId: datasets_schema
      description: Retrieve a dataset schema by its slug.
      summary: Retrieve a dataset schema by slug
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this dataset.
          required: true
        - in: path
          name: slug
          schema:
            type: string
            pattern: ^[-a-zA-Z0-9_]+$
          required: true
      tags:
        - datasets
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Dataset"
          description: ""
  /api/organizations/:
    get:
      operationId: organizations_list
      description: |-
        Query for a list of all organizations that the currently authenticated user has
        access to.

        The response will be a list of organization objects.

        **On the command line:**

        ```bash
        blind organizations list
        ```
      summary: List organizations
      parameters:
        - in: query
          name: created
          schema:
            type: string
            format: date-time
        - in: query
          name: id
          schema:
            type: string
        - in: query
          name: is_active
          schema:
            type: boolean
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: modified
          schema:
            type: string
            format: date-time
        - in: query
          name: name
          schema:
            type: string
          description: The name of the organization
        - name: offset
          required: false
          in: query
          description: The initial index from which to return the results.
          schema:
            type: integer
        - in: query
          name: slug
          schema:
            type: string
          description: The name in all lowercase, suitable for URL identification
        - in: query
          name: users
          schema:
            type: array
            items:
              type: string
          explode: true
          style: form
      tags:
        - organizations
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginatedOrganizationList"
          description: ""
    post:
      operationId: organizations_create
      description: |-
        Create a new organization. The only required field is `name`. The currently
        authenticated user will be set as the owner of the organization.

        The response will be the newly created organization object.

        **On the command line:**

        ```bash
        blind organizations create --data '{"name": "Example Organization"}'
        ```
      summary: Create organization
      tags:
        - organizations
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OrganizationCreate"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/OrganizationCreate"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/OrganizationCreate"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrganizationCreate"
          description: ""
  /api/organizations/{id}/:
    get:
      operationId: organizations_retrieve
      description: |-
        Retrieve a single organization by its ID.

        The response will be the organization object.

        **On the command line:**

        ```bash
        blind organizations retrieve --id "<organization-id>"
        ```
      summary: Retrieve organization
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this organization.
          required: true
      tags:
        - organizations
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Organization"
          description: ""
    put:
      operationId: organizations_update
      description: |-
        Replace an organization with the data provided in the request.

        The response will be the updated organization object.

        **On the command line:**

        ```bash
        blind organizations update --id "<organization-id>" --data organization.json
        ```
      summary: Update organization
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this organization.
          required: true
      tags:
        - organizations
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OrganizationUpdate"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/OrganizationUpdate"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/OrganizationUpdate"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrganizationUpdate"
          description: ""
    patch:
      operationId: organizations_partial-update
      description: |-
        Update one or more fields of an organization. This does not replace the entire
        organization, it only updates the fields provided in the request.

        The response will be the updated organization object.

        **On the command line:**

        ```bash
        blind organizations partial-update --id "<organization-id>" --data organization-update.json
        ```
      summary: Partial update organization
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this organization.
          required: true
      tags:
        - organizations
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchedOrganizationUpdate"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/PatchedOrganizationUpdate"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/PatchedOrganizationUpdate"
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrganizationUpdate"
          description: ""
    delete:
      operationId: organizations_destroy
      description: |-
        Delete an organization. Note that this does not delete the organization's
        members or any associated data.

        The response will be a 204 No Content if successful.

        **On the command line:**

        ```bash
        blind organizations delete --id "<organization-id>"
        ```
      summary: Delete organization
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this organization.
          required: true
      tags:
        - organizations
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "204":
          description: No response body
  /api/organizations/{id}/dataset/{slug}/:
    get:
      operationId: organizations_dataset
      description: |-
        Retrieve a single organization dataset by its slug.

        The response is the dataset object.

        **On the command line:**

        ```bash
        blind organizations dataset --id "<organization-id>" --slug "<dataset-slug>"
        ```
      summary: Retrieve organization dataset by slug
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this organization.
          required: true
        - in: path
          name: slug
          schema:
            type: string
            pattern: ^[-a-zA-Z0-9_]+$
          required: true
      tags:
        - organizations
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Organization"
          description: ""
  /api/organizations/{id}/owner/:
    get:
      operationId: organizations_owner
      description: |-
        Retrieve a single owner of an organization by its ID.

        The response will be the user object of the owner.

        **On the command line:**

        ```bash
        blind organizations owner --id "<organization-id>"
        ```
      summary: Retrieve organization owner
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this organization.
          required: true
      tags:
        - organizations
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Organization"
          description: ""
  /api/organizations/{organization_id}/invitations/:
    get:
      operationId: organizations_invitations_list
      description: |-
        Return a list of all organization invitations, including those which have
        already been accepted.

        The response is a list of invitation objects.

        **On the command line:**

        ```bash
        blind organizations invitations list --organization-id "<organization-id>"
        ```
      summary: List organization invitations
      parameters:
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: offset
          required: false
          in: query
          description: The initial index from which to return the results.
          schema:
            type: integer
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
      tags:
        - organizations
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginatedOrganizationInvitationList"
          description: ""
    post:
      operationId: organizations_invitations_create
      description: |-
        Invite a user to join an organization.

        The response is the newly created invitation object.

        **On the command line:**

        ```bash
        blind organizations invitations create --organization-id "<organization-id>" --data organization-invitation.json
        ```
      summary: Create organization invitation
      parameters:
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
      tags:
        - organizations
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OrganizationInvitationCreate"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/OrganizationInvitationCreate"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/OrganizationInvitationCreate"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrganizationInvitationCreate"
          description: ""
  /api/organizations/{organization_id}/invitations/{id}/:
    get:
      operationId: organizations_invitations_retrieve
      description: |-
        Retrieve a single organization invitation by its ID.

        The response is the invitation object.

        **On the command line:**

        ```bash
        blind organizations invitations retrieve --organization-id "<organization-id>" --id "<invitation-id>"
        ```
      summary: Retrieve organization invitation
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this organization invitation.
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
      tags:
        - organizations
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrganizationInvitation"
          description: ""
    put:
      operationId: organizations_invitations_update
      description: |-
        Update an organization invitation.

        The response is the updated invitation object.

        **On the command line:**

        ```bash
        blind organizations invitations update --organization-id "<organization-id>" --id "<invitation-id>" --data organization-invitation.json
        ```
      summary: Update organization invitation
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this organization invitation.
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
      tags:
        - organizations
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OrganizationInvitation"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/OrganizationInvitation"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/OrganizationInvitation"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrganizationInvitation"
          description: ""
    patch:
      operationId: organizations_invitations_partial-update
      description: |-
        Update one or more fields of an organization invitation. This does not replace
        the entire invitation, it only updates the fields provided in the request.

        The response is the updated invitation object.

        **On the command line:**

        ```bash
        blind organizations invitations partial-update --organization-id "<organization-id>" --id "<invitation-id>" --data organization-invitation-update.json
        ```
      summary: Partial update organization invitation
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this organization invitation.
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
      tags:
        - organizations
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchedOrganizationInvitation"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/PatchedOrganizationInvitation"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/PatchedOrganizationInvitation"
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrganizationInvitation"
          description: ""
    delete:
      operationId: organizations_invitations_destroy
      description: |-
        Delete an organization invitation.

        The response is a 204 No Content if successful.

        **On the command line:**

        ```bash
        blind organizations invitations delete --organization-id "<organization-id>" --id "<invitation-id>"
        ```
      summary: Delete organization invitation
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this organization invitation.
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
      tags:
        - organizations
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "204":
          description: No response body
  /api/organizations/{organization_id}/users/:
    get:
      operationId: organizations_users_list
      description: |-
        Return a list of all users of an organization.

        The response is a list of user objects belonging to the organization.

        **On the command line:**

        ```bash
        blind organizations users list --organization-id "<organization-id>"
        ```
      summary: List organization users
      parameters:
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: offset
          required: false
          in: query
          description: The initial index from which to return the results.
          schema:
            type: integer
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
      tags:
        - organizations
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginatedOrganizationUserList"
          description: ""
    post:
      operationId: organizations_users_create
      description: |-
        Add a new user to an organization.

        The response is the newly added user object.

        **On the command line:**

        ```bash
        blind organizations users create --organization-id "<organization-id>" --data organization-user.json
        ```
      summary: Create organization user
      parameters:
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
      tags:
        - organizations
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OrganizationUserCreate"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/OrganizationUserCreate"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/OrganizationUserCreate"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrganizationUserCreate"
          description: ""
  /api/organizations/{organization_id}/users/{id}/:
    get:
      operationId: organizations_users_retrieve
      description: |-
        Retrieve a single user of an organization by their ID.

        The response is the user object.

        **On the command line:**

        ```bash
        blind organizations users retrieve --organization-id "<organization-id>" --id "<user-id>"
        ```
      summary: Retrieve organization user
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this organization user.
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
      tags:
        - organizations
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrganizationUser"
          description: ""
    put:
      operationId: organizations_users_update
      description: |-
        Replace a user of an organization with the data provided in the request.

        The response is the updated user object.

        **On the command line:**

        ```bash
        blind organizations users update --organization-id "<organization-id>" --id "<user-id>" --data organization-user.json
        ```
      summary: Update organization user
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this organization user.
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
      tags:
        - organizations
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OrganizationUserUpdate"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/OrganizationUserUpdate"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/OrganizationUserUpdate"
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrganizationUserUpdate"
          description: ""
    patch:
      operationId: organizations_users_partial-update
      description: |-
        Update one or more fields of a user of an organization. This does not replace
        the entire user, it only updates the fields provided in the request.

        The response is the updated user object.

        **On the command line:**

        ```bash
        blind organizations users partial-update --organization-id "<organization-id>" --id "<user-id>" --data organization-user-update.json
        ```
      summary: Partial update organization user
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this organization user.
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
      tags:
        - organizations
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchedOrganizationUserUpdate"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/PatchedOrganizationUserUpdate"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/PatchedOrganizationUserUpdate"
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrganizationUserUpdate"
          description: ""
    delete:
      operationId: organizations_users_destroy
      description: |-
        Delete a user from an organization.

        The response is a 204 No Content if successful.

        **On the command line:**

        ```bash
        blind organizations users delete --organization-id "<organization-id>" --id "<user-id>"
        ```
      summary: Delete organization user
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this organization user.
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
      tags:
        - organizations
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "204":
          description: No response body
  /api/organizations/by-slug/{slug}/:
    get:
      operationId: organizations_by-slug
      description: |-
        Retrieve a single organization by its slug.

        The response will be the organization object.

        **On the command line:**

        ```bash
        blind organizations by-slug --slug "<organization-slug>"
        ```
      summary: Retrieve organization by slug
      parameters:
        - in: path
          name: slug
          schema:
            type: string
            pattern: ^[-a-zA-Z0-9_]+$
          required: true
      tags:
        - organizations
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Organization"
          description: ""
  /api/records/:
    get:
      operationId: records_list
      description: |-
        List records for the given schema ID. Takes optional pagination parameters
        `limit` and `offset`, as well as an optional query filter `q`.

        The response will be a list of record objects.

        **On the command line:**

        ```bash
        blind records list --schema "<schema-id>"
        ```
      summary: List records
      parameters:
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: offset
          required: false
          in: query
          description: The initial index from which to return the results.
          schema:
            type: integer
        - in: query
          name: q
          schema:
            type: array
            items:
              type: string
          description: Query filter for records.
          explode: true
          style: form
        - in: query
          name: schema
          schema:
            type: string
          description: The schema ID that this record belongs to.
      tags:
        - records
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginatedRecordList"
          description: ""
    post:
      operationId: records_create
      description: |-
        Create a new record with an already encrypted payload. This is the non-porcelain
        endpoint. If you want to create a new record with plaintext data, use the
        `record create` porcelain command or the `records ingest` command with a proxy.

        The response will be the newly created record object.

        **On the command line:**

        ```bash
        blind records create --data encrypted-record.json
        ```
      summary: Create a new record
      tags:
        - records
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/IndexedRecord"
            examples:
              SingleRecord:
                value:
                  data:
                    2516cdf1538b273e39bf91e67abff3a0: b94f2c9129a7b95f4003afd3cb73b55e405f7c
                    1ca62259a4f6aeefa7c54d9b13c5650d: 695d2fe4339e50f5039cfbef464846cf202fc06
                  hashed_label_map:
                    2516cdf1538b273e39bf91e67abff3a0:
                      hashed_value: b4486fe169178ec73d3dfad17227da820b89d27e1994f7
                      field_schema:
                        type: string
                    1ca62259a4f6aeefa7c54d9b13c5650d:
                      hashed_value: 8d90841201a70611da0b964a743564e035fc
                      field_schema:
                        type: number
                        minimum: 0
                        maximum: 10
                  schema: https://demo.blindinsight.io/api/schemas/abcdef012345
                summary: single record
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/IndexedRecord"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/IndexedRecord"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/IndexedRecord"
              examples:
                SingleRecord:
                  value:
                    data:
                      2516cdf1538b273e39bf91e67abff3a0: 961298e17a97e7d0b847b8b743e179b2b
                      b92e749344f081287b034c57b7a02c77f: 695d2fe4339e50f5039cfbef464846cf202fc06
                    schema: https://demo.blindinsight.io/api/schemas/abcdef012345
                    url: https://demo.blindinsight.io/api/records/abcdef012345
                    owner: https://demo.blindinsight.io/api/users/abcdef012345
                    id: abcdef012345
                  summary: single record
          description: ""
  /api/records/{id}/:
    get:
      operationId: records_retrieve
      description: |-
        Retrieve a record by its ID.

        The response will be the record object.

        **On the command line:**

        ```bash
        blind records retrieve --id "<record-id>"
        ```
      summary: Retrieve a record
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this record.
          required: true
      tags:
        - records
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Record"
          description: ""
    delete:
      operationId: records_destroy
      description: |-
        Delete a record by its ID.

        The response will be a 204 No Content if successful.

        **On the command line:**

        ```bash
        blind records delete --id "<record-id>"
        ```
      summary: Delete a record
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this record.
          required: true
      tags:
        - records
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "204":
          description: No response body
  /api/records/decrypt/:
    post:
      operationId: records_decrypt
      description: "[Blind Insight Proxy] Decrypt data and return records"
      summary: Decrypt data and return records (only available via proxy)
      tags:
        - records
      requestBody:
        content:
          application/json:
            schema:
              type: array
              description: An array of records to be ingested.
              items:
                required:
                  - data
                  - schema
                type: object
                properties:
                  data:
                    type: object
                    description: The data to be encrypted and stored as a record
                    additionalProperties:
                      description: Value for the data labels
                      anyOf:
                        - type: string
                        - type: number
                    example:
                      job_function: developer
                      job_level: greybeard
                  schema:
                    description: The schema URL for the record
                    type: string
                    format: uri
            examples:
              SingleRecordDecrypt:
                value:
                  - data:
                      b92e749344f081287b034c57b7a02c77f: b4486fe169178ec73d3dfad17227da820b89d27e1994f7
                      961298e17a97e7d0b847b8b743e179b2b: 8d90841201a70611da0b964a743564e035fc
                      52a1e027e31d4c5bbf126647962822fc1: 6f1374dc5a6314a36f8ef8244c
                    schema: https://demo.blindinsight.io/api/schemas/abcdef012345
                summary: single record decrypt
          application/x-www-form-urlencoded:
            schema:
              type: array
              description: An array of records to be ingested.
              items:
                required:
                  - data
                  - schema
                type: object
                properties:
                  data:
                    type: object
                    description: The data to be encrypted and stored as a record
                    additionalProperties:
                      description: Value for the data labels
                      anyOf:
                        - type: string
                        - type: number
                    example:
                      job_function: developer
                      job_level: greybeard
                  schema:
                    description: The schema URL for the record
                    type: string
                    format: uri
          multipart/form-data:
            schema:
              type: array
              description: An array of records to be ingested.
              items:
                required:
                  - data
                  - schema
                type: object
                properties:
                  data:
                    type: object
                    description: The data to be encrypted and stored as a record
                    additionalProperties:
                      description: Value for the data labels
                      anyOf:
                        - type: string
                        - type: number
                    example:
                      job_function: developer
                      job_level: greybeard
                  schema:
                    description: The schema URL for the record
                    type: string
                    format: uri
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
        - {}
      responses:
        "200":
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Record"
              examples:
                SingleRecordDecrypt:
                  value:
                    - data:
                        job_function: developer
                        job_level: greybeard
                        company: blindinsight
                      schema: https://demo.blindinsight.io/api/schemas/abcdef012345
                      url: https://demo.blindinsight.io/api/records/abcdef012345
                      owner: https://demo.blindinsight.io/api/users/abcdef012345
                      id: abcdef012345
                  summary: single record decrypt
          description: ""
        "422":
          content:
            application/json:
              schema:
                type: object
                example:
                  detail: Unprocessable entity
          description: ""
  /api/records/ingest/:
    post:
      operationId: records_ingest
      description:
        "[Blind Insight Proxy] Ingest data and encrypt it returning the
        encrypted records"
      summary: Ingest data and encrypt it (only available via proxy)
      tags:
        - records
      requestBody:
        content:
          application/json:
            schema:
              type: array
              description: An array of records to be ingested.
              items:
                required:
                  - data
                  - schema
                type: object
                properties:
                  data:
                    type: object
                    description: The data to be encrypted and stored as a record
                    additionalProperties:
                      description: Value for the data labels
                      anyOf:
                        - type: string
                        - type: number
                    example:
                      job_function: developer
                      job_level: greybeard
                  schema:
                    description: The schema URL for the record
                    type: string
                    format: uri
            examples:
              ExampleRecordIngest:
                value:
                  - data:
                      job_function: developer
                      job_level: greybeard
                      company: blindinsight
                    schema: https://demo.blindinsight.io/api/schemas/abcdef012345
                  - data:
                      name: Bob
                      age: 32
                    schema: https://demo.blindinsight.io/api/schemas/zzzxxx987654
                summary: example record ingest
          application/x-www-form-urlencoded:
            schema:
              type: array
              description: An array of records to be ingested.
              items:
                required:
                  - data
                  - schema
                type: object
                properties:
                  data:
                    type: object
                    description: The data to be encrypted and stored as a record
                    additionalProperties:
                      description: Value for the data labels
                      anyOf:
                        - type: string
                        - type: number
                    example:
                      job_function: developer
                      job_level: greybeard
                  schema:
                    description: The schema URL for the record
                    type: string
                    format: uri
          multipart/form-data:
            schema:
              type: array
              description: An array of records to be ingested.
              items:
                required:
                  - data
                  - schema
                type: object
                properties:
                  data:
                    type: object
                    description: The data to be encrypted and stored as a record
                    additionalProperties:
                      description: Value for the data labels
                      anyOf:
                        - type: string
                        - type: number
                    example:
                      job_function: developer
                      job_level: greybeard
                  schema:
                    description: The schema URL for the record
                    type: string
                    format: uri
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
        - {}
      responses:
        "200":
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Record"
              examples:
                SingleRecord:
                  value:
                    - data:
                        2516cdf1538b273e39bf91e67abff3a0: 961298e17a97e7d0b847b8b743e179b2b
                        b92e749344f081287b034c57b7a02c77f: 695d2fe4339e50f5039cfbef464846cf202fc06
                      schema: https://demo.blindinsight.io/api/schemas/abcdef012345
                      url: https://demo.blindinsight.io/api/records/abcdef012345
                      owner: https://demo.blindinsight.io/api/users/abcdef012345
                      id: abcdef012345
                  summary: single record
          description: ""
        "422":
          content:
            application/json:
              schema:
                type: object
                example:
                  detail: Unprocessable entity
          description: ""
  /api/records/search/:
    post:
      operationId: records_search
      description:
        "[Blind Insight Proxy] Search for records by label and value. If
        label or value is specified, both must be present. If neither are present,
        this endpoint does not filter records."
      summary: Search for records (only available via proxy)
      tags:
        - records
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - schema
              properties:
                schema:
                  type: string
                  description: Schema ID to search within
                filters:
                  type: array
                  items:
                    type: object
                    properties:
                      label:
                        type: string
                        description: Label to search for given value
                      value:
                        type: string
                        description: Value to search for given label
                    required:
                      - label
                      - value
                  description: Array of label/value pairs to filter records
                limit:
                  type: integer
                  description: Maximum number of records to return
                offset:
                  type: integer
                  description: Number of records to skip
            examples:
              Search:
                value:
                  schema: KycqdSAKzP4wUZ337b6ngb
                  filters:
                    - label: job_level
                      value: greybeard
                  limit: 10
                  offset: 0
                summary: search
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - schema
              properties:
                schema:
                  type: string
                  description: Schema ID to search within
                filters:
                  type: array
                  items:
                    type: object
                    properties:
                      label:
                        type: string
                        description: Label to search for given value
                      value:
                        type: string
                        description: Value to search for given label
                    required:
                      - label
                      - value
                  description: Array of label/value pairs to filter records
                limit:
                  type: integer
                  description: Maximum number of records to return
                offset:
                  type: integer
                  description: Number of records to skip
          multipart/form-data:
            schema:
              type: object
              required:
                - schema
              properties:
                schema:
                  type: string
                  description: Schema ID to search within
                filters:
                  type: array
                  items:
                    type: object
                    properties:
                      label:
                        type: string
                        description: Label to search for given value
                      value:
                        type: string
                        description: Value to search for given label
                    required:
                      - label
                      - value
                  description: Array of label/value pairs to filter records
                limit:
                  type: integer
                  description: Maximum number of records to return
                offset:
                  type: integer
                  description: Number of records to skip
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
        - {}
      responses:
        "200":
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Record"
              examples:
                SearchSingleRecordFound:
                  value:
                    - data:
                        02c77f5019095cbdef089d7e469d676daf9b9: 23056ec398be4d3dfad17227da820b89d27e1994f7
                        179b2b1888f4db01c8203b0be7af5c8b5b83b: 6718c4f45dd6ea0b964a743564e035fc
                        822fc1e33ea07ea1ddff1ec9aae93da845fee: a3f644f0c206bf8ef8244c
                      schema: https://demo.blindinsight.io/api/schemas/abcdef012345
                  summary: search single record found
          description: ""
        "422":
          content:
            application/json:
              schema:
                type: object
                example:
                  detail: Unprocessable entity
          description: ""
  /api/schemas/:
    get:
      operationId: schemas_list
      description: |-
        List all schemas, filtered by the given parameters. Takes optional pagination
        parameters `limit` and `offset`.

        The response will be a list of schema objects.

        **On the command line:**

        ```bash
        blind schemas list
        ```
      summary: List all schemas
      parameters:
        - in: query
          name: dataset
          schema:
            type: string
          description: The dataset that this schema belongs to.
        - in: query
          name: description
          schema:
            type: string
          description: A longer description of the schema.
        - in: query
          name: id
          schema:
            type: string
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - in: query
          name: name
          schema:
            type: string
          description: A human-readable name for this schema.
        - name: offset
          required: false
          in: query
          description: The initial index from which to return the results.
          schema:
            type: integer
        - in: query
          name: slug
          schema:
            type: string
          description: A unique slug for this schema.
      tags:
        - schemas
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginatedSchemaList"
          description: ""
    post:
      operationId: schemas_create
      description: |-
        Create a new schema.

        The response will be the newly created schema object.

        **On the command line:**

        ```bash
        blind schemas create --data schema.json
        ```
      summary: Create a new schema
      tags:
        - schemas
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Schema"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/Schema"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/Schema"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Schema"
          description: ""
  /api/schemas/{id}/:
    get:
      operationId: schemas_retrieve
      description: |-
        Retrieve a single schema by its ID.

        The response will be the schema object.

        **On the command line:**

        ```bash
        blind schemas retrieve --id "<schema-id>"
        ```
      summary: Retrieve a single schema
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this schema.
          required: true
      tags:
        - schemas
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Schema"
          description: ""
    put:
      operationId: schemas_update
      description: |-
        Update an existing schema by its ID, replacing the entire schema.

        The response will be the updated schema object.

        **On the command line:**

        ```bash
        blind schemas update --id "<schema-id>" --data schema.json
        ```
      summary: Update a schema
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this schema.
          required: true
      tags:
        - schemas
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Schema"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/Schema"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/Schema"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Schema"
          description: ""
    patch:
      operationId: schemas_partial-update
      description: |-
        Update an existing schema with only the specified fields.

        The response will be the updated schema object.

        **On the command line:**

        ```bash
        blind schemas partial-update --id "<schema-id>" --data schema-update.json
        ```
      summary: Partially update a schema
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this schema.
          required: true
      tags:
        - schemas
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchedSchema"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/PatchedSchema"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/PatchedSchema"
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Schema"
          description: ""
    delete:
      operationId: schemas_destroy
      description: |-
        Delete an existing schema by its ID.

        The response will be a 204 No Content if successful.

        **On the command line:**

        ```bash
        blind schemas delete --id "<schema-id>"
        ```
      summary: Delete a schema
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this schema.
          required: true
      tags:
        - schemas
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "204":
          description: No response body
  /api/schemas/decrypt/:
    post:
      operationId: schemas_decrypt
      description: "[Blind Insight Proxy] Decrypt a schema and return a hashed schema"
      summary: Decrypt a schema (only available via proxy)
      tags:
        - schemas
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - id
                - owner
                - name
                - schema
              properties:
                id:
                  type: string
                owner:
                  type: string
                name:
                  type: string
                schema:
                  type: object
            examples:
              SingleSchemaDecryptRequest:
                value:
                  id: abcdef012345
                  owner: https://demo.blindinsight.io/api/users/abcdef012345
                  name: person
                  schema:
                    type: object
                    required:
                      - name
                      - age
                    properties:
                      name:
                        type: string
                      age:
                        type: number
                        minimum: 0
                        maximum: 100
                summary: single schema decrypt request
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - id
                - owner
                - name
                - schema
              properties:
                id:
                  type: string
                owner:
                  type: string
                name:
                  type: string
                schema:
                  type: object
          multipart/form-data:
            schema:
              type: object
              required:
                - id
                - owner
                - name
                - schema
              properties:
                id:
                  type: string
                owner:
                  type: string
                name:
                  type: string
                schema:
                  type: object
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
        - {}
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: object
                  example:
                    02c77f5019095cbdef089d7e469d676daf9b9:
                      type: string
                      name: name
                      minimum: 0
                      maximum: 0
                    179b2b1888f4db01c8203b0be7af5c8b5b83b:
                      type: number
                      name: age
                      minimum: 0
                      maximum: 100
              examples:
                SingleNumericDecryptResponse:
                  value:
                    02c77f5019095cbdef089d7e469d676daf9b9:
                      type: string
                      name: name
                      minimum: 0
                      maximum: 0
                    179b2b1888f4db01c8203b0be7af5c8b5b83b:
                      type: number
                      name: age
                      minimum: 0
                      maximum: 100
                  summary: single numeric decrypt response
          description: ""
        "422":
          content:
            application/json:
              schema:
                type: object
                example:
                  detail: Unprocessable entity
          description: ""
  /api/token/:
    post:
      operationId: token_create
      description: |-
        Create a new token for the user with the given email and password. On success,
        returns a JSON web token which can be used in the `Authorization` header to make
        API requests.

        The response will be an JSON object with the access and refresh tokens.

        **On the command line:**

        ```bash
        blind token create --data '{"email": "demo@example.com", "password": "pass1234"}'
        ```
      summary: Create a new token
      tags:
        - token
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TokenObtainPair"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/TokenObtainPair"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/TokenObtainPair"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TokenObtainPair"
          description: ""
  /api/token/refresh/:
    post:
      operationId: token_refresh
      description: |-
        Refresh an existing token. On success, returns a JSON web token which can be
        used in the `Authorization` header to make API requests.

        The response will be an JSON object with the new access token.

        **On the command line:**

        ```bash
        blind token refresh --data '{"refresh": "<refresh-token>"}'
        ```
      summary: Refresh a token
      tags:
        - token
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TokenRefresh"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/TokenRefresh"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/TokenRefresh"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TokenRefresh"
          description: ""
  /api/token/verify/:
    post:
      operationId: token_verify
      description: |-
        Verify an access or refresh token is valid.

        The response will be an empty object if it is valid, or a 401 unauthorized error
        if it is not.

        **On the command line:**

        ```bash
        blind token verify --data '{"token": "<access-or-refresh-token>"}'
        ```
      summary: Verify a token
      tags:
        - token
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TokenVerify"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/TokenVerify"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/TokenVerify"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TokenVerify"
          description: ""
  /api/users/:
    get:
      operationId: users_list
      description: |-
        Retrieve a list of users. You can filter the list by providing query parameters.
        Only users that you have access to will be returned, which in practice means
        they are in the same organization.

        The response will be a list of user objects.

        **On the command line:**

        ```bash
        blind users list
        ```
      summary: Retrieve one or more User objects, with filters
      parameters:
        - in: query
          name: date_joined
          schema:
            type: string
            format: date-time
        - in: query
          name: email
          schema:
            type: array
            items:
              type: string
              format: email
              title: Email address
          explode: true
          style: form
        - in: query
          name: first_name
          schema:
            type: string
          description: First name (optional)
        - in: query
          name: id
          schema:
            type: string
        - in: query
          name: is_active
          schema:
            type: boolean
          description:
            Designates whether this user should be treated as active. Unselect
            this instead of deleting accounts.
        - in: query
          name: is_staff
          schema:
            type: boolean
          description: Designates whether the user can log into this admin site.
        - in: query
          name: is_superuser
          schema:
            type: boolean
          description:
            Designates that this user has all permissions without explicitly
            assigning them.
        - in: query
          name: last_login
          schema:
            type: string
            format: date-time
        - in: query
          name: last_name
          schema:
            type: string
          description: Last name (optional)
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: offset
          required: false
          in: query
          description: The initial index from which to return the results.
          schema:
            type: integer
      tags:
        - users
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginatedUserList"
          description: ""
    post:
      operationId: users_create
      description: |-
        Create a new user.

        The response will be the newly created user object.

        **On the command line:**

        ```bash
        blind users create --data user.json
        ```
      summary: Create a new User
      tags:
        - users
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/User"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/User"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/User"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
          description: ""
  /api/users/{id}/:
    get:
      operationId: users_retrieve
      description: |-
        Retrieve a single user by their ID.

        The response will be the user object.

        **On the command line:**

        ```bash
        blind users retrieve --id "<user-id>"
        ```
      summary: Retrieve one User object
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this user.
          required: true
      tags:
        - users
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
          description: ""
    put:
      operationId: users_update
      description: |-
        Update an entire existing user, replacing all fields.

        The response will be the updated user object.

        **On the command line:**

        ```bash
        blind users update --id "<user-id>" --data user.json
        ```
      summary: Update a User
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this user.
          required: true
      tags:
        - users
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/User"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/User"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/User"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
          description: ""
    patch:
      operationId: users_partial-update
      description: |-
        Update an existing user with only the specified fields.

        The response will be the updated user object.

        **On the command line:**

        ```bash
        blind users partial-update --id "<user-id>" --data user-update.json
        ```
      summary: Partially update a User
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this user.
          required: true
      tags:
        - users
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchedUser"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/PatchedUser"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/PatchedUser"
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
          description: ""
    delete:
      operationId: users_destroy
      description: |-
        Delete an existing user by their ID.

        The response will be a 204 No Content if successful.

        **On the command line:**

        ```bash
        blind users delete --id "<user-id>"
        ```
      summary: Delete a User
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this user.
          required: true
      tags:
        - users
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "204":
          description: No response body
  /api/users/{user_id}/identities/:
    get:
      operationId: users_identities_list
      description: |-
        List identities, filtered by the given parameters. Takes optional pagination
        parameters.

        The response will be a list of identity objects.

        **On the command line:**

        ```bash
        blind users identities list --user-id "<user_id>"
        ```
      summary: List Identities
      parameters:
        - in: query
          name: device_id
          schema:
            type: string
          description: The device ID associated with this identity.
        - in: query
          name: id
          schema:
            type: string
        - name: limit
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - name: offset
          required: false
          in: query
          description: The initial index from which to return the results.
          schema:
            type: integer
        - in: query
          name: primary_public_key
          schema:
            type: string
          description: The primary PGP key for the identity.
        - in: query
          name: sub_public_key
          schema:
            type: string
          description: The PGP sub-key for the identity.
        - in: query
          name: user
          schema:
            type: string
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - users
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaginatedIdentityList"
          description: ""
    post:
      operationId: users_identities_create
      description: |-
        Create a new identity.

        The response will be the newly created identity object.

        **On the command line:**

        ```bash
        blind users identities create --user-id "<user_id>" --data identity.json
        ```
      summary: Create a new Identity
      parameters:
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - users
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Identity"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/Identity"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/Identity"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Identity"
          description: ""
  /api/users/{user_id}/identities/{id}/:
    get:
      operationId: users_identities_retrieve
      description: |-
        Retrieve an identity by its ID.

        The response will be the identity object.

        **On the command line:**

        ```bash
        blind users identities retrieve --user-id "<user_id>" --id "<identity_id>"
        ```
      summary: Retrieve a single Identity
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this identity.
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - users
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Identity"
          description: ""
    put:
      operationId: users_identities_update
      description: |-
        Update an identity replacing it entirely.

        The response will be the updated identity object.

        **On the command line:**

        ```bash
        blind users identities update --user-id "<user_id>" --id "<identity_id>" --data identity.json
        ```
      summary: Update an Identity
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this identity.
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - users
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Identity"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/Identity"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/Identity"
        required: true
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Identity"
          description: ""
    patch:
      operationId: users_identities_partial-update
      description: |-
        Update an identity with only the specified fields.

        The response will be the updated identity object.

        **On the command line:**

        ```bash
        blind users identities partial-update --user-id "<user_id>" --id "<identity_id>" --data identity-update.json
        ```
      summary: Partially update an Identity
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this identity.
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - users
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchedIdentity"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/PatchedIdentity"
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/PatchedIdentity"
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Identity"
          description: ""
    delete:
      operationId: users_identities_destroy
      description: |-
        Delete an identity.

        The response will be an empty object with a 204 status.

        **On the command line:**

        ```bash
        blind users identities delete --user-id "<user_id>" --id "<identity_id>"
        ```
      summary: Delete an Identity
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: A unique value identifying this identity.
          required: true
        - in: path
          name: user_id
          schema:
            type: string
          required: true
      tags:
        - users
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "204":
          description: No response body
  /api/users/by_name/{email}/:
    get:
      operationId: users_by-name
      description: |-
        Retrieve a single user by their name (email).

        The response will be the user object.

        **On the command line:**

        ```bash
        blind users by-name --email "<user-name>"
        ```
      summary: Retrieve one User object by name
      parameters:
        - in: path
          name: email
          schema:
            type: string
          required: true
      tags:
        - users
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
          description: ""
  /api/users/self/:
    get:
      operationId: users_self
      description: |-
        Retrieve the currently authenticated user.

        The response will be the user object.

        **On the command line:**

        ```bash
        blind users self
        ```
      summary: Retrieve current user
      tags:
        - users
      security:
        - cookieAuth: []
        - basicAuth: []
        - jwtAuth: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/User"
          description: ""
components:
  schemas:
    AccountVerified:
      type: object
      properties:
        detail:
          type: string
          default: User verified successfully
    AccountVerifiedError:
      type: object
      properties:
        detail:
          type: string
          default: <Error message>
    ChangePassword:
      type: object
      properties:
        old_password:
          type: string
        password:
          type: string
        password_confirm:
          type: string
          writeOnly: true
      required:
        - old_password
        - password
        - password_confirm
    Dataset:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        organization:
          type: string
          format: uri
        name:
          type: string
          description: A human-readable name for this dataset.
          maxLength: 127
        slug:
          type: string
          description: A unique slug for this dataset.
          maxLength: 127
          pattern: ^[-a-zA-Z0-9_]+$
        description:
          type: string
          description: A longer description of the dataset.
          maxLength: 255
      required:
        - id
        - name
        - organization
        - url
    DefaultLogin:
      type: object
      description: |-
        Default serializer used for user login. Please keep in mind that
        the authentication is done by separate function defined by
        :ref:`login-authenticator-setting` setting.

        By default :ref:`login-authenticator-setting` function will use
        :ref:`user-login-fields-setting` setting to extract the login field
        from the validated serializer data either by using the 'login' key
        (which is used here) or the specific login field name(s)
        (e.g. 'username', 'email').

        If you want different behavior, you need to
        override :ref:`login-authenticator-setting` in your settings.
      properties:
        login:
          type: string
        password:
          type: string
      required:
        - login
        - password
    DefaultRegisterEmail:
      type: object
      description: Default serializer used for e-mail registration (e-mail change).
      properties:
        email:
          type: string
          format: email
      required:
        - email
    DefaultSendResetPasswordLink:
      type: object
      description: |-
        Default serializer used for sending reset password link.

        It will use :ref:`send-reset-password-link-serializer-use-email-setting`
        setting.
      properties:
        email:
          type: string
      required:
        - email
    DefaultUserProfile:
      type: object
      description: |-
        Default serializer used for user profile. It will use these:

        * User fields
        * :ref:`user-hidden-fields-setting` setting
        * :ref:`user-public-fields-setting` setting
        * :ref:`user-editable-fields-setting` setting

        to automagically generate the required serializer fields.
      properties:
        email:
          type: string
          format: email
          readOnly: true
          title: Email address
        id:
          type: string
          readOnly: true
        first_name:
          type: string
          description: First name (optional)
          maxLength: 150
        last_name:
          type: string
          description: Last name (optional)
          maxLength: 150
      required:
        - email
        - id
    Identity:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        user:
          type: string
          format: uri
        device_id:
          type: string
          description: The device ID associated with this identity.
          maxLength: 255
        primary_public_key:
          type: string
          description: The primary PGP key for the identity.
        sub_public_key:
          type: string
          description: The PGP sub-key for the identity.
      required:
        - device_id
        - id
        - primary_public_key
        - sub_public_key
        - url
        - user
    IndexedRecord:
      type: object
      description:
        Serializer for creating a Record and creating the schema index
        values together.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        schema:
          type: string
          format: uri
        hashed_label_map:
          type: object
          example:
            b92e749344f081287b034c57b7a02c77f:
              hashed_value: b4486fe169178ec73d3dfad17227da820b89d27e1994f7
              field_schema:
                type: string
            961298e17a97e7d0b847b8b743e179b2b:
              hashed_value: 8d90841201a70611da0b964a743564e035fc
              field_schema:
                type: number
                minimum: 0
                maximum: 10
          additionalProperties:
            type: object
            properties:
              field_schema:
                type: object
                properties:
                  type:
                    type: string
                  minimum:
                    type: number
                    example: 0
                  maximum:
                    type: number
                    example: 10
                required:
                  - type
              hashed_value:
                type: string
          writeOnly: true
        data:
          type: object
          description: The data that this record represents.
      required:
        - hashed_label_map
        - id
        - schema
        - url
    LoginSuccessful:
      type: object
      properties:
        detail:
          type: string
          default: Login successful
    LoginSuccessfulError:
      type: object
      properties:
        detail:
          type: string
          default: <Error message>
    Logout:
      type: object
      properties:
        revoke_token:
          type: boolean
          default: false
    LogoutSuccessful:
      type: object
      properties:
        detail:
          type: string
          default: Logout successful
    LogoutSuccessfulError:
      type: object
      properties:
        detail:
          type: string
          default: <Error message>
    Organization:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        owner:
          type: string
          format: uri
        organization_users:
          type: array
          items:
            type: string
            format: uri
          readOnly: true
        name:
          type: string
          title: Display Name
          description: A human-readable name for this organization
          maxLength: 200
        is_active:
          type: boolean
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
        slug:
          type: string
          readOnly: true
          title: Organization Slug
          description: A unique ID used to identify this organization
          pattern: ^[-a-zA-Z0-9_]+$
      required:
        - created
        - id
        - modified
        - name
        - organization_users
        - owner
        - slug
        - url
    OrganizationCreate:
      type: object
      description: |-
        Organiation create serializer.

        Note that this explicitly disallows a slug from being specified on-create.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        owner:
          type: string
          format: uri
        organization_users:
          type: array
          items:
            type: string
            format: uri
          readOnly: true
        name:
          type: string
          title: Display Name
          description: A human-readable name for this organization
          maxLength: 200
        is_active:
          type: boolean
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
        slug:
          type: string
          readOnly: true
          title: Organization Slug
          description: A unique ID used to identify this organization
          pattern: ^[-a-zA-Z0-9_]+$
      required:
        - created
        - id
        - modified
        - name
        - organization_users
        - slug
        - url
    OrganizationInvitation:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        organization:
          type: string
          format: uri
        guid:
          type: string
          format: uuid
          readOnly: true
        invitee_identifier:
          type: string
          description:
            The contact identifier for the invitee, email, phone number,
            social media handle, etc.
          maxLength: 1000
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
        invited_by:
          type: string
          format: uri
        invitee:
          type: string
          format: uri
          nullable: true
      required:
        - created
        - guid
        - id
        - invited_by
        - invitee_identifier
        - modified
        - organization
        - url
    OrganizationInvitationCreate:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        organization:
          type: string
          format: uri
        email:
          type: string
          format: email
          writeOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
        is_admin:
          type: boolean
          default: false
      required:
        - created
        - email
        - id
        - modified
        - url
    OrganizationRegisterUser:
      type: object
      description: |-
        Overloads DefaultRegisterUserSerializer to create an organization.

        Note that this explicitly disallows a slug from being specified on-create.
      properties:
        password:
          type: string
          maxLength: 128
        email:
          type: string
          format: email
          title: Email address
          maxLength: 255
        id:
          type: string
          readOnly: true
        first_name:
          type: string
          description: First name (optional)
          maxLength: 150
        last_name:
          type: string
          description: Last name (optional)
          maxLength: 150
        password_confirm:
          type: string
          writeOnly: true
        organization_name:
          type: string
          writeOnly: true
          description: Organization Name
          maxLength: 50
      required:
        - email
        - id
        - organization_name
        - password
        - password_confirm
    OrganizationUpdate:
      type: object
      description: |-
        Update an Organization, allowing for the owner to be changed.

        Since an Owner is a 1:1 relationship, we can't use the default
        `NestedHyperlinkedRelatedField` and must change it to an `OrganizationUser`
        queryset limited to organization members.

        The `to_representation()` method is overloaded to return the correct URL for
        the owner.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        owner:
          type: string
          format: uri
        organization_users:
          type: array
          items:
            type: string
            format: uri
          readOnly: true
        slug:
          type: string
          title: Organization Slug
          description: A unique ID used to identify this organization
          pattern: ^[-a-zA-Z0-9_]+$
        name:
          type: string
          title: Display Name
          description: A human-readable name for this organization
          maxLength: 200
        is_active:
          type: boolean
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - created
        - id
        - modified
        - name
        - organization_users
        - owner
        - url
    OrganizationUser:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        organization:
          type: string
          format: uri
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
        is_admin:
          type: boolean
        user:
          type: string
          format: uri
          readOnly: true
      required:
        - created
        - id
        - modified
        - organization
        - url
        - user
    OrganizationUserCreate:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        organization:
          type: string
          format: uri
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
        is_admin:
          type: boolean
          default: false
        user:
          type: string
          format: uri
      required:
        - created
        - id
        - modified
        - url
        - user
    OrganizationUserProfile:
      type: object
      description:
        Oerloads DefaultUserProfileSerializer to include organization_name
        and organization_slug.
      properties:
        email:
          type: string
          format: email
          readOnly: true
          title: Email address
        id:
          type: string
          readOnly: true
        first_name:
          type: string
          description: First name (optional)
          maxLength: 150
        last_name:
          type: string
          description: Last name (optional)
          maxLength: 150
        organization_name:
          type: string
          readOnly: true
          description: Organization Name
          maxLength: 50
        organization_slug:
          type: string
          readOnly: true
          description: Organization URL
          maxLength: 50
          pattern: ^[-a-zA-Z0-9_]+$
        url:
          type: string
          format: uri
          readOnly: true
      required:
        - email
        - id
        - organization_name
        - organization_slug
        - url
    OrganizationUserUpdate:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        organization:
          type: string
          format: uri
          readOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
        is_admin:
          type: boolean
        user:
          type: string
          format: uri
          readOnly: true
      required:
        - created
        - id
        - modified
        - organization
        - url
        - user
    PaginatedDatasetList:
      type: array
      items:
        $ref: "#/components/schemas/Dataset"
    PaginatedIdentityList:
      type: array
      items:
        $ref: "#/components/schemas/Identity"
    PaginatedOrganizationInvitationList:
      type: array
      items:
        $ref: "#/components/schemas/OrganizationInvitation"
    PaginatedOrganizationList:
      type: array
      items:
        $ref: "#/components/schemas/Organization"
    PaginatedOrganizationUserList:
      type: array
      items:
        $ref: "#/components/schemas/OrganizationUser"
    PaginatedRecordList:
      type: array
      items:
        $ref: "#/components/schemas/Record"
    PaginatedSchemaList:
      type: array
      items:
        $ref: "#/components/schemas/Schema"
    PaginatedUserList:
      type: array
      items:
        $ref: "#/components/schemas/User"
    PasswordChanged:
      type: object
      properties:
        detail:
          type: string
          default: Password changed successfully
    PasswordChangedError:
      type: object
      properties:
        detail:
          type: string
          default: <Error message>
    PasswordReset:
      type: object
      properties:
        detail:
          type: string
          default: Reset password successful
    PasswordResetError:
      type: object
      properties:
        detail:
          type: string
          default: <Error message>
    PatchedDataset:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        organization:
          type: string
          format: uri
        name:
          type: string
          description: A human-readable name for this dataset.
          maxLength: 127
        slug:
          type: string
          description: A unique slug for this dataset.
          maxLength: 127
          pattern: ^[-a-zA-Z0-9_]+$
        description:
          type: string
          description: A longer description of the dataset.
          maxLength: 255
    PatchedDefaultUserProfile:
      type: object
      description: |-
        Default serializer used for user profile. It will use these:

        * User fields
        * :ref:`user-hidden-fields-setting` setting
        * :ref:`user-public-fields-setting` setting
        * :ref:`user-editable-fields-setting` setting

        to automagically generate the required serializer fields.
      properties:
        email:
          type: string
          format: email
          readOnly: true
          title: Email address
        id:
          type: string
          readOnly: true
        first_name:
          type: string
          description: First name (optional)
          maxLength: 150
        last_name:
          type: string
          description: Last name (optional)
          maxLength: 150
    PatchedIdentity:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        user:
          type: string
          format: uri
        device_id:
          type: string
          description: The device ID associated with this identity.
          maxLength: 255
        primary_public_key:
          type: string
          description: The primary PGP key for the identity.
        sub_public_key:
          type: string
          description: The PGP sub-key for the identity.
    PatchedOrganizationInvitation:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        organization:
          type: string
          format: uri
        guid:
          type: string
          format: uuid
          readOnly: true
        invitee_identifier:
          type: string
          description:
            The contact identifier for the invitee, email, phone number,
            social media handle, etc.
          maxLength: 1000
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
        invited_by:
          type: string
          format: uri
        invitee:
          type: string
          format: uri
          nullable: true
    PatchedOrganizationUpdate:
      type: object
      description: |-
        Update an Organization, allowing for the owner to be changed.

        Since an Owner is a 1:1 relationship, we can't use the default
        `NestedHyperlinkedRelatedField` and must change it to an `OrganizationUser`
        queryset limited to organization members.

        The `to_representation()` method is overloaded to return the correct URL for
        the owner.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        owner:
          type: string
          format: uri
        organization_users:
          type: array
          items:
            type: string
            format: uri
          readOnly: true
        slug:
          type: string
          title: Organization Slug
          description: A unique ID used to identify this organization
          pattern: ^[-a-zA-Z0-9_]+$
        name:
          type: string
          title: Display Name
          description: A human-readable name for this organization
          maxLength: 200
        is_active:
          type: boolean
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
    PatchedOrganizationUserUpdate:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        organization:
          type: string
          format: uri
          readOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
        is_admin:
          type: boolean
        user:
          type: string
          format: uri
          readOnly: true
    PatchedSchema:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        dataset:
          type: string
          format: uri
        name:
          type: string
          description: A human-readable name for this schema.
          maxLength: 127
        slug:
          type: string
          description: A unique slug for this schema.
          maxLength: 127
          pattern: ^[-a-zA-Z0-9_]+$
        description:
          type: string
          description: A longer description of the schema.
          maxLength: 255
        schema:
          type: object
          description: The JSON schema definition.
    PatchedUser:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        last_login:
          type: string
          format: date-time
          nullable: true
        is_superuser:
          type: boolean
          title: Superuser status
          description:
            Designates that this user has all permissions without explicitly
            assigning them.
        email:
          type: string
          format: email
          title: Email address
          maxLength: 255
        is_staff:
          type: boolean
          title: Staff status
          description: Designates whether the user can log into this admin site.
        is_active:
          type: boolean
          title: Active
          description:
            Designates whether this user should be treated as active. Unselect
            this instead of deleting accounts.
        date_joined:
          type: string
          format: date-time
        first_name:
          type: string
          description: First name (optional)
          maxLength: 150
        last_name:
          type: string
          description: Last name (optional)
          maxLength: 150
        settings:
          type: object
    Record:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        schema:
          type: string
          format: uri
        data:
          type: object
          description: The data that this record represents.
      required:
        - id
        - schema
        - url
    RegisteredEmail:
      type: object
      properties:
        detail:
          type: string
          default: Register email link email sent
    RegisteredEmailError:
      type: object
      properties:
        detail:
          type: string
          default: <Error message>
    ResetPassword:
      type: object
      properties:
        user_id:
          type: string
        timestamp:
          type: integer
        signature:
          type: string
        password:
          type: string
      required:
        - password
        - signature
        - timestamp
        - user_id
    ResetPasswordLinkSent:
      type: object
      properties:
        detail:
          type: string
          default: Reset link sent
    ResetPasswordLinkSentError:
      type: object
      properties:
        detail:
          type: string
          default: <Error message>
    Schema:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        dataset:
          type: string
          format: uri
        name:
          type: string
          description: A human-readable name for this schema.
          maxLength: 127
        slug:
          type: string
          description: A unique slug for this schema.
          maxLength: 127
          pattern: ^[-a-zA-Z0-9_]+$
        description:
          type: string
          description: A longer description of the schema.
          maxLength: 255
        schema:
          type: object
          description: The JSON schema definition.
      required:
        - dataset
        - id
        - name
        - url
    TokenObtainPair:
      type: object
      properties:
        email:
          type: string
          writeOnly: true
        password:
          type: string
          writeOnly: true
        access:
          type: string
          readOnly: true
        refresh:
          type: string
          readOnly: true
      required:
        - access
        - email
        - password
        - refresh
    TokenRefresh:
      type: object
      properties:
        access:
          type: string
          readOnly: true
        refresh:
          type: string
          writeOnly: true
      required:
        - access
        - refresh
    TokenVerify:
      type: object
      properties:
        token:
          type: string
          writeOnly: true
      required:
        - token
    User:
      type: object
      description: HyperlinkedModelSerializer with `id` as the first field.
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          format: uri
          readOnly: true
        last_login:
          type: string
          format: date-time
          nullable: true
        is_superuser:
          type: boolean
          title: Superuser status
          description:
            Designates that this user has all permissions without explicitly
            assigning them.
        email:
          type: string
          format: email
          title: Email address
          maxLength: 255
        is_staff:
          type: boolean
          title: Staff status
          description: Designates whether the user can log into this admin site.
        is_active:
          type: boolean
          title: Active
          description:
            Designates whether this user should be treated as active. Unselect
            this instead of deleting accounts.
        date_joined:
          type: string
          format: date-time
        first_name:
          type: string
          description: First name (optional)
          maxLength: 150
        last_name:
          type: string
          description: Last name (optional)
          maxLength: 150
        settings:
          type: object
      required:
        - email
        - id
        - url
    VerifiedEmail:
      type: object
      properties:
        detail:
          type: string
          default: Email verified successfully
    VerifiedEmailError:
      type: object
      properties:
        detail:
          type: string
          default: <Error message>
    VerifyEmail:
      type: object
      properties:
        user_id:
          type: string
        email:
          type: string
          format: email
        timestamp:
          type: integer
        signature:
          type: string
      required:
        - email
        - signature
        - timestamp
        - user_id
    VerifyRegistration:
      type: object
      properties:
        user_id:
          type: string
        timestamp:
          type: integer
        signature:
          type: string
      required:
        - signature
        - timestamp
        - user_id
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
    cookieAuth:
      type: apiKey
      in: cookie
      name: sessionid
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
