swagger: '2.0'
info:
  title: Stencila Hub API
  description: |
    ## Authentication

    Many endpoints in the Stencila Hub API require an authentication token. These tokens carry many privileges, so be sure to keep them secure. Do not place your tokens in publicly accessible areas such as client-side code. The API is only served over HTTPS to avoid exposing tokens and other data on the network.

    To obtain a token, [`POST /api/tokens`](#operations-tokens-tokens_create) with either a `username` and `password` pair, or an [OpenID Connect](https://openid.net/connect/) token. Then use the token in the `Authorization` header of subsequent requests with the prefix `Token` e.g.

        curl -H "Authorization: Token 48866b1e38a2e9db0baada2140b2327937f4a3636dd5f2dfd8c212341c88d34" https://hub.stenci.la/api/projects/

    Alternatively, you can use `Basic` authentication with the token used as the username and no password. This can be more convenient when using command line tools such as [cURL](https://curl.haxx.se/) e.g.

        curl -u 48866b1e38a2e9db0baada2140b2327937f4a3636dd5f2dfd8c212341c88d34: https://hub.stenci.la/api/projects/

    Or, the less ubiquitous, but more accessible [httpie](https://httpie.org/):

        http --auth 48866b1e38a2e9db0baada2140b2327937f4a3636dd5f2dfd8c212341c88d34: https://hub.stenci.la/api/projects/

    In both examples above, the trailing colon is not required but avoids being asked for a password.

    ## Versioning

    The Stencila Hub is released using semantic versioning. The current version is available from the [`GET /api/status`](/api/status) endpoint. Please see the [Github release page](https://github.com/stencila/hub/releases) and the [changelog](https://github.com/stencila/hub/blob/master/CHANGELOG.md) for details on each release. We currently do not provide versioning of the API but plan to do so soon (probably by using a `Accept: application/vnd.stencila.hub+json;version=1.0` request header). If you are using, or interested in using, the API please contact us and we may be able to expedite this.
  version: v1
host: hub.stenci.la
schemes:
  - https
basePath: /api
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  Token:
    type: apiKey
    name: Authorization
    in: header
security:
  - Token: []
paths:
  /accounts/:
    get:
      operationId: accounts_list
      summary: List accounts.
      description: |-
        The returned list can be filtered using query parameters, `is`, `role`, and `search`.

        The `role` filter applies to the currently authenticated user, and
        as such has no effected for unauthenticated requests. When `role=member` will return
        all accounts that the user is a `member`, `manager`, or `owner` of. When `role=manager`
        will return all accounts that the user is a `manager` or `owner` of.

        For example, to list all organizational accounts for which the authenticated user is
        a member of (and therefore can create a project for):

            GET /accounts?is=org&role=member
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
        - name: is
          in: query
          description: Whether or the account is for an organization or user.
          type: string
          enum:
            - user
            - org
        - name: role
          in: query
          description: The role that the currently authenticated user has for the
            account e.g. "member", "manager", or "owner"
          type: string
          enum:
            - member
            - manager
            - owner
        - name: search
          in: query
          description: A string to search for in the account `name` or `displayName`.
          type: string
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/AccountList'
      tags:
        - accounts
    post:
      operationId: accounts_create
      summary: Create an account.
      description: |-
        Receives details of the account.
        Returns details of the new account.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/AccountCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/AccountCreate'
      tags:
        - accounts
    parameters: []
  /accounts/{account}/:
    get:
      operationId: accounts_read
      summary: Retrieve an account.
      description: Returns details of the account.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/AccountRetrieve'
      tags:
        - accounts
    patch:
      operationId: accounts_partial_update
      summary: Update an account.
      description: |-
        Receives details of the account.
        Returns updated details of the account.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/AccountUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/AccountUpdate'
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
  /accounts/{account}/broker:
    get:
      operationId: accounts_broker_list
      summary: Connect to the job broker for the account.
      description: |-
        This endpoint is for self-hosted workers. These need to be
        enabled for the account.

        You may need to include your authentication token in the URL.
        For example, when using [Celery](https://www.celeryproject.org/) in Python:

        ```python
        app = Celery(
            broker="https://{token}@hub.stenci.la/api/accounts/{account}/jobs/broker".format(
                token = os.environ.get("STENCILA_TOKEN"),
                account = os.environ.get("STENCILA_ACCOUNT")
            )
        )
        ```
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
  /accounts/{account}/queues/:
    get:
      operationId: accounts_queues_list
      summary: List objects.
      description: Returns a list of objects.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/Queue'
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
  /accounts/{account}/queues/{queue}/:
    get:
      operationId: accounts_queues_read
      summary: Retrieve an object.
      description: Returns data for the object.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Queue'
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
      - name: queue
        in: path
        required: true
        type: string
  /accounts/{account}/teams/:
    get:
      operationId: accounts_teams_list
      summary: List teams.
      description: Returns a list of teams for the account.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/AccountTeam'
      tags:
        - accounts
    post:
      operationId: accounts_teams_create
      summary: Create a team.
      description: Returns data for the new team.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/AccountTeamCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/AccountTeamCreate'
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
  /accounts/{account}/teams/{team}/:
    get:
      operationId: accounts_teams_read
      summary: Retrieve a team.
      description: Returns data for the team.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/AccountTeam'
      tags:
        - accounts
    patch:
      operationId: accounts_teams_partial_update
      summary: Update a team.
      description: Returns data for the team.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/AccountTeamUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/AccountTeamUpdate'
      tags:
        - accounts
    delete:
      operationId: accounts_teams_delete
      summary: Destroy a team.
      description: Returns an empty response.
      parameters: []
      responses:
        '204':
          description: ''
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
      - name: team
        in: path
        required: true
        type: string
  /accounts/{account}/teams/{team}/members/:
    post:
      operationId: accounts_teams_members_create
      description: Add a user to the team.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/UserIdentifier'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/UserIdentifier'
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
      - name: team
        in: path
        required: true
        type: string
  /accounts/{account}/teams/{team}/members/{user}/:
    delete:
      operationId: accounts_teams_members_delete
      description: Remove a user from the team.
      parameters: []
      responses:
        '204':
          description: ''
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
      - name: team
        in: path
        required: true
        type: string
      - name: user
        in: path
        required: true
        type: string
  /accounts/{account}/users/:
    get:
      operationId: accounts_users_list
      summary: List objects.
      description: Returns a list of objects.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/AccountUser'
      tags:
        - accounts
    post:
      operationId: accounts_users_create
      summary: Create an object.
      description: Returns data for the new object.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/AccountUserCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/AccountUserCreate'
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
  /accounts/{account}/users/{user}/:
    get:
      operationId: accounts_users_read
      summary: Retrieve an object.
      description: Returns data for the object.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/AccountUser'
      tags:
        - accounts
    patch:
      operationId: accounts_users_partial_update
      summary: Update an object.
      description: Returns data for the updated object.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/AccountUserPatch'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/AccountUserPatch'
      tags:
        - accounts
    delete:
      operationId: accounts_users_delete
      summary: Destroy an object.
      description: Returns an empty response.
      parameters: []
      responses:
        '204':
          description: ''
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
      - name: user
        in: path
        required: true
        type: string
  /accounts/{account}/workers/:
    get:
      operationId: accounts_workers_list
      summary: List objects.
      description: Returns a list of objects.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/Worker'
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
  /accounts/{account}/workers/{worker}/:
    get:
      operationId: accounts_workers_read
      summary: Retrieve an object.
      description: Returns data for the object.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Worker'
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
      - name: worker
        in: path
        required: true
        type: string
  /accounts/{account}/workers/{worker}/heartbeats/:
    get:
      operationId: accounts_workers_heartbeats_list
      summary: List objects.
      description: Returns a list of objects.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/WorkerHeartbeat'
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
      - name: worker
        in: path
        required: true
        type: string
  /accounts/{account}/zones/:
    get:
      operationId: accounts_zones_list
      summary: List objects.
      description: Returns a list of objects.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/Zone'
      tags:
        - accounts
    post:
      operationId: accounts_zones_create
      summary: Create an object.
      description: Returns data for the new object.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/ZoneCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/ZoneCreate'
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
  /accounts/{account}/zones/{zone}/:
    get:
      operationId: accounts_zones_read
      summary: Retrieve an object.
      description: Returns data for the object.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Zone'
      tags:
        - accounts
    delete:
      operationId: accounts_zones_delete
      summary: Destroy an object.
      description: Returns an empty response.
      parameters: []
      responses:
        '204':
          description: ''
      tags:
        - accounts
    parameters:
      - name: account
        in: path
        required: true
        type: string
      - name: zone
        in: path
        required: true
        type: string
  /dois/:
    get:
      operationId: dois_list
      summary: List DOIs.
      description: Returns a paginated list of all DOIs.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/Doi'
      tags:
        - dois
    post:
      operationId: dois_create
      summary: Create a DOI.
      description: |-
        Receives details of the DOI to create and dispatches a job
        to register it.
        Returns details of the new DOI.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/Doi'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Doi'
      tags:
        - dois
    parameters: []
  /dois/{doi}/:
    get:
      operationId: dois_read
      summary: Retrieve a DOI.
      description: Returns details of the DOI.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Doi'
      tags:
        - dois
    parameters:
      - name: doi
        in: path
        description: The DOI string including both prefix and suffix e.g. 10.47704/stencila.54321
        required: true
        type: string
  /emails/:
    post:
      operationId: emails_create
      summary: Receive an email.
      description: Returns an empty response.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/Email'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Email'
      tags:
        - emails
    parameters: []
  /features/:
    get:
      operationId: features_list
      description: Get the feature settings for the current user.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/MeFeatureFlags'
      tags:
        - features
    patch:
      operationId: features_partial_update
      description: Update the feature settings for the current user.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/MeFeatureFlags'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/MeFeatureFlags'
      tags:
        - features
    parameters: []
  /invites/:
    get:
      operationId: invites_list
      summary: List objects.
      description: Returns a list of objects.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/Invite'
      tags:
        - invites
    post:
      operationId: invites_create
      summary: Create an object.
      description: Returns data for the new object.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/Invite'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Invite'
      tags:
        - invites
    parameters: []
  /invites/{id}/:
    delete:
      operationId: invites_delete
      summary: Destroy an object.
      description: Returns an empty response.
      parameters: []
      responses:
        '204':
          description: ''
      tags:
        - invites
    parameters:
      - name: id
        in: path
        required: true
        type: string
  /jobs/{id}/:
    put:
      operationId: jobs_update
      summary: A view set intended for the `overseer` service to update the status
        of workers.
      description: |-
        Requires that the user is a Stencila staff member.
        Does not require the `overseer` to know which project a job is associated
        with, or have project permission.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/JobUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/JobUpdate'
      tags:
        - jobs
    patch:
      operationId: jobs_partial_update
      summary: Update a job.
      description: |-
        This action is intended only to be used by the `overseer` service
        for it to update the details of a job based on events
        from the job queue.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/JobUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/JobUpdate'
      tags:
        - jobs
    parameters:
      - name: id
        in: path
        description: An autoincrementing integer to allow selecting jobs in the order
          they were created.
        required: true
        type: integer
  /nodes/:
    post:
      operationId: nodes_create
      summary: Create a node.
      description: |-
        Receives a request with the `node` (as JSON) and possibly other information
        e.g. the `project` the node is associated with, the `app` it was created using.

        Returns the key and URL of the node.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/NodeCreateRequest'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/NodeCreateResponse'
      tags:
        - nodes
    parameters: []
  /nodes/{key}/:
    get:
      operationId: nodes_read
      summary: Retrieve a node.
      description: Performs content negotiation and authorization based on the `Accept`
        header.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/NodeRetrieve'
      tags:
        - nodes
    parameters:
      - name: key
        in: path
        required: true
        type: string
  /projects/:
    get:
      operationId: projects_list
      summary: List projects.
      description: |-
        Returns a list of projects that are accessible to the user, including those that are
        public and those that the user is a member of (i.e. has a project role for).

        The returned list can be filtered using query parameters, `account`, `role`, `public`,
        `search`, `source`. The `role` filter applies to the currently authenticated user, and
        as such has no effected for unauthenticated requests. Roles can be specified as a
        comma separated list e.g. `role=author,manager,owner` or using to the `+` operator
        to indicate the minimum required role e.g. `role=author+` (equivalent to the previous
        example).

        For example, to list all projects for which the authenticated user is a member and which
        uses a particular Google Doc as a source:

            GET /projects?role=member&source=gdoc://1BW6MubIyDirCGW9Wq-tSqCma8pioxBI6VpeLyXn5mZA
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
        - name: account
          in: query
          description: The integer of the id of the account that the project belongs
            to.
          type: integer
        - name: role
          in: query
          description: The role that the currently authenticated user has on the project
            e.g. "editor", "owner" (for any role, use "member")
          type: string
        - name: public
          in: query
          description: Whether or not the project is public.
          type: boolean
        - name: search
          in: query
          description: A string to search for in the project `name`, `title` or `description`.
          type: string
        - name: source
          in: query
          description: The address of a project source e.g. `github://<org>/<repo>`,
            `gdoc://<id>`.
          type: string
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/ProjectList'
      tags:
        - projects
    post:
      operationId: projects_create
      summary: Create a project.
      description: |-
        Receives details of the project.
        Returns details of the new project.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/ProjectCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/ProjectCreate'
      tags:
        - projects
    parameters: []
  /projects/{project}/:
    get:
      operationId: projects_read
      summary: Retrieve a project.
      description: Returns details of the project.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/ProjectRetrieve'
      tags:
        - projects
    patch:
      operationId: projects_partial_update
      summary: Update a project.
      description: |-
        Receives details of the project.
        Returns updated details of the project.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/ProjectUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/ProjectUpdate'
      tags:
        - projects
    delete:
      operationId: projects_delete
      summary: Destroy a project.
      description: Returns an empty response on success.
      parameters: []
      responses:
        '204':
          description: ''
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/agents/:
    get:
      operationId: projects_agents_list
      summary: List objects.
      description: Returns a list of objects.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/ProjectAgent'
      tags:
        - projects
    post:
      operationId: projects_agents_create
      summary: Create an object.
      description: Returns data for the new object.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/ProjectAgentCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/ProjectAgentCreate'
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/agents/{agent}/:
    get:
      operationId: projects_agents_read
      summary: Retrieve an object.
      description: Returns data for the object.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/ProjectAgent'
      tags:
        - projects
    patch:
      operationId: projects_agents_partial_update
      summary: Update an object.
      description: Returns data for the updated object.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/ProjectAgentUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/ProjectAgentUpdate'
      tags:
        - projects
    delete:
      operationId: projects_agents_delete
      summary: Destroy an object.
      description: Returns an empty response.
      parameters: []
      responses:
        '204':
          description: ''
      tags:
        - projects
    parameters:
      - name: agent
        in: path
        required: true
        type: string
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/files/:
    get:
      operationId: projects_files_list
      summary: List objects.
      description: Returns a list of objects.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/FileList'
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/files/{file}:
    get:
      operationId: projects_files_read
      summary: Retrieve an object.
      description: Returns data for the object.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/File'
      tags:
        - projects
    delete:
      operationId: projects_files_delete
      summary: Destroy an object.
      description: Returns an empty response.
      parameters: []
      responses:
        '204':
          description: ''
      tags:
        - projects
    parameters:
      - name: file
        in: path
        required: true
        type: string
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/files/{file}!convert:
    post:
      operationId: projects_convert
      summary: Convert a file to another format.
      description: |-
        Confirms that the destination path and other options are
        correct, creates a job and redirects to it.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/File'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/File'
      tags:
        - projects
    parameters:
      - name: file
        in: path
        required: true
        type: string
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/files/{file}!history:
    get:
      operationId: projects_history
      summary: Get the a file's history.
      description: Returns a paginated history of the file
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/File'
      tags:
        - projects
    parameters:
      - name: file
        in: path
        required: true
        type: string
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/jobs/:
    get:
      operationId: projects_jobs_list
      summary: List objects.
      description: Returns a list of objects.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/JobList'
      tags:
        - projects
    post:
      operationId: projects_jobs_create
      summary: Create an object.
      description: Returns data for the new object.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/JobCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/JobCreate'
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/jobs/execute/:
    post:
      operationId: projects_jobs_execute
      summary: Create an execute job.
      description: |-
        Receives the `node` to execute as the request body.
        Returns the executed `node`.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/JobCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/JobCreate'
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/jobs/{job}/:
    get:
      operationId: projects_jobs_read
      summary: Retrieve an object.
      description: Returns data for the object.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/JobRetrieve'
      tags:
        - projects
    patch:
      operationId: projects_jobs_partial_update
      summary: Update an object.
      description: Returns data for the updated object.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/JobRetrieve'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/JobRetrieve'
      tags:
        - projects
    parameters:
      - name: job
        in: path
        required: true
        type: string
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/jobs/{job}/cancel/:
    patch:
      operationId: projects_jobs_cancel
      summary: Cancel a job.
      description: |-
        If the job is cancellable, it will be cancelled
        and it's status set to `REVOKED`.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/JobRetrieve'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/JobRetrieve'
      tags:
        - projects
    parameters:
      - name: job
        in: path
        required: true
        type: string
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/jobs/{job}/connect/{path}/:
    get:
      operationId: projects_jobs_connect_read
      summary: Connect to a job.
      description: |-
        Redirects to the internal URL so that users can
        connect to the job and run methods inside of it.

        This request it proxied through the `router`. This view
        first checks that the user has permission to edit the job.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/JobRetrieve'
      tags:
        - projects
    post:
      operationId: projects_jobs_connect_create
      summary: Connect to a job.
      description: |-
        Redirects to the internal URL so that users can
        connect to the job and run methods inside of it.

        This request it proxied through the `router`. This view
        first checks that the user has permission to edit the job.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/JobRetrieve'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/JobRetrieve'
      tags:
        - projects
    parameters:
      - name: job
        in: path
        required: true
        type: string
      - name: path
        in: path
        required: true
        type: string
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/pull/:
    post:
      operationId: projects_pull
      summary: Pull the project.
      description: Creates a pull job and redirects to it.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/ProjectList'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/ProjectList'
        '302':
          description: Redirect to job
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/reviews/:
    get:
      operationId: projects_reviews_list
      summary: List objects.
      description: Returns a list of objects.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/ReviewRetrieve'
      tags:
        - projects
    post:
      operationId: projects_reviews_create
      summary: Create an object.
      description: Returns data for the new object.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/ReviewCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/ReviewCreate'
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/reviews/{review}/:
    get:
      operationId: projects_reviews_read
      summary: Retrieve an object.
      description: Returns data for the object.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/ReviewRetrieve'
      tags:
        - projects
    patch:
      operationId: projects_reviews_partial_update
      summary: Update an object.
      description: Returns data for the updated object.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/ReviewUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/ReviewUpdate'
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
      - name: review
        in: path
        required: true
        type: string
  /projects/{project}/session/:
    post:
      operationId: projects_session
      summary: Get a session for the project.
      description: |-
        If the user has already created, or is connected to,
        a `session` job for this project, and that job is still running,
        then returns that job. Otherwise, creates a new session.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/ProjectList'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/ProjectList'
        '302':
          description: Redirect to job
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/snapshots/:
    get:
      operationId: projects_snapshots_list
      summary: List objects.
      description: Returns a list of objects.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/Snapshot'
      tags:
        - projects
    post:
      operationId: projects_snapshots_create
      summary: Create an object.
      description: Returns data for the new object.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/Snapshot'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Snapshot'
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/snapshots/{snapshot}/:
    get:
      operationId: projects_snapshots_read
      summary: Retrieve an object.
      description: Returns data for the object.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Snapshot'
      tags:
        - projects
    delete:
      operationId: projects_snapshots_delete
      summary: Destroy an object.
      description: Returns an empty response.
      parameters: []
      responses:
        '204':
          description: ''
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
      - name: snapshot
        in: path
        required: true
        type: string
  /projects/{project}/snapshots/{snapshot}/archive/:
    get:
      operationId: projects_snapshots_archive_read
      summary: Retrieve an archive for a project snapshot.
      description: The user should have read access to the project.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Snapshot'
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
      - name: snapshot
        in: path
        required: true
        type: string
  /projects/{project}/snapshots/{snapshot}/files/{path}/:
    get:
      operationId: projects_snapshots_files
      summary: Retrieve a file within a snapshot of the project.
      description: |-
        For `index.html` will add necessary headers and if necessary
        inject content required to connect to a session. For other files
        redirects to the URL for the file (which may be in a
        remote storage bucket for example).

        For security reasons, this function will be deprecated in
        favour of getting content from the account subdomain.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Snapshot'
      tags:
        - projects
    parameters:
      - name: path
        in: path
        required: true
        type: string
      - name: project
        in: path
        required: true
        type: string
      - name: snapshot
        in: path
        required: true
        type: string
  /projects/{project}/snapshots/{snapshot}/session/:
    post:
      operationId: projects_snapshots_session
      summary: Get a session for the snapshot.
      description: |-
        If the user has already created, or is connected to,
        a `session` job for this snapshot, and that job is still running,
        then returns that job. Otherwise, creates a new session.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/Snapshot'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Snapshot'
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
      - name: snapshot
        in: path
        required: true
        type: string
  /projects/{project}/sources/:
    get:
      operationId: projects_sources_list
      summary: List a project's sources.
      description: |-
        Returns a list of sources in the project.
        The returned list can be filtered using the query parameter, `search` which matches
        against the source's `path` string.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
        - name: search
          in: query
          description: A string to search for in the source's `path`.
          type: string
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/Source'
      tags:
        - projects
    post:
      operationId: projects_sources_create
      summary: Create a project source.
      description: |-
        Receives details of the source. This should include the `type` of source, a string matching
        one of the implemented source classes e.g. `ElifeSource`, `GoogleDocsSource`, `GithubSource`
        as well as the destination `path`, and other type specific properties.
        See https://github.com/stencila/hub/blob/master/manager/projects/models/sources.py.

        For example, to create a new source for a Google Doc:

        ```json
        {
            "type": "GoogleDocsSource",
            "path": "report.gdoc",
            "docId": "1BW6MubIyDirCGW9Wq-tSqCma8pioxBI6VpeLyXn5mZA"
        }
        ```

        Alternatively, if the request includes a `url`, then the type will be inferred from
        the URL, falling back to a `UrlSource`. For example, the create the above Google Doc:

        ```json
        {
            "url": "https://docs.google.com/document/u/1/d/1BW6MubIyDirCGW9Wq-tSqCma8pioxBI6VpeLyXn5mZA/edit"
            "path": "report.gdoc",
        }
        ```

        Returns details of the new source.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/SourcePolymorphic'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/SourcePolymorphic'
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
  /projects/{project}/sources/{source}/:
    get:
      operationId: projects_sources_read
      summary: Retrieve a project source.
      description: Returns details of the source.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/SourcePolymorphic'
      tags:
        - projects
    patch:
      operationId: projects_sources_partial_update
      summary: Update a project source.
      description: |-
        Receives details of the source.
        Returns updated details of the source.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/SourcePolymorphic'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/SourcePolymorphic'
      tags:
        - projects
    delete:
      operationId: projects_sources_delete
      summary: Destroy a project source.
      description: |-
        Removes the source from the project.
        Returns an empty response on success.
      parameters: []
      responses:
        '204':
          description: ''
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
      - name: source
        in: path
        required: true
        type: string
  /projects/{project}/sources/{source}/event/:
    post:
      operationId: projects_sources_event
      summary: Receive an event notification for a project source.
      description: |-
        Receives event data from a source provider (e.g. Github, Google)
        and forward's it on to the source's event handler.
        Returns an empty response.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/SourcePolymorphic'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/SourcePolymorphic'
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
      - name: source
        in: path
        required: true
        type: string
  /projects/{project}/sources/{source}/open/{path}/:
    get:
      operationId: projects_sources_open_read
      summary: Open a project source, or a file within it.
      description: Returns a redirect response to an external URL.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/SourcePolymorphic'
      tags:
        - projects
    parameters:
      - name: path
        in: path
        required: true
        type: string
      - name: project
        in: path
        required: true
        type: string
      - name: source
        in: path
        required: true
        type: string
  /projects/{project}/sources/{source}/pull/:
    post:
      operationId: projects_sources_pull
      summary: Pull a project source.
      description: Creates a pull job and redirects to it.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/SourcePolymorphic'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/SourcePolymorphic'
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
      - name: source
        in: path
        required: true
        type: string
  /projects/{project}/sources/{source}/unwatch/:
    post:
      operationId: projects_sources_unwatch
      summary: Unwatch a project source.
      description: |-
        Removes any subscription to listen to events for the source.
        Returns an empty response on success (including if the source
        was not being watched before the request).
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/SourcePolymorphic'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/SourcePolymorphic'
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
      - name: source
        in: path
        required: true
        type: string
  /projects/{project}/sources/{source}/watch/:
    post:
      operationId: projects_sources_watch
      summary: Watch a project source.
      description: |-
        Creates a subscription to listen to events for the source.
        Returns an empty response on success. Returns a 405 if the
        source type does not support watches.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/SourcePolymorphic'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/SourcePolymorphic'
      tags:
        - projects
    parameters:
      - name: project
        in: path
        required: true
        type: string
      - name: source
        in: path
        required: true
        type: string
  /providers/github/repos/:
    get:
      operationId: providers_github_repos_list
      summary: List GitHub repositories that the current user is a member of.
      description: |-
        Returns a list of GitHub repositories that the user is a member of
        (i.e. has "admin", "pull", or "push" rights) in decending order of
        last update. The returned list can be filtered using query parameter
        `search` which search in the full name (i.e. owner/name) of the repo.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
        - name: search
          in: query
          description: A string to search for in the repo's `full_name`.
          type: string
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/GithubRepo'
      tags:
        - providers
    parameters: []
  /providers/github/repos/refresh/:
    post:
      operationId: providers_github_repos_refresh
      summary: Refresh the list of GitHub repositories for the current user.
      description: Returns an empty response on success.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/GithubRepo'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/GithubRepo'
      tags:
        - providers
    parameters: []
  /status/:
    get:
      operationId: status_read
      description: Get the system status.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/StatusResponse'
      tags:
        - status
    parameters: []
  /tokens/:
    get:
      operationId: tokens_list
      summary: List authentication tokens.
      description: |-
        Returns a list of the authentication tokens for the current user.
        Stencila does not store the raw token only the `id` (the first eight characters).
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/Token'
      tags:
        - tokens
    post:
      operationId: tokens_create
      summary: Create an authentication token.
      description: |-
        Receives a POST with either a (a) user's username and password, or
        (b) an OpenID Connect JSON Web Token (currently, only OpenID tokens issued by Google are accepted),
        or (c) a Django session in a header.
        These alternative authentication methods are used in that order of preference.

        Returns the `username`, and a `token` that can be used for authenticated API requests.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/TokensCreateRequest'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/TokensCreateResponse'
      tags:
        - tokens
    parameters: []
  /tokens/{token}/:
    get:
      operationId: tokens_read
      summary: Retrieve and refresh an authentication token.
      description: |-
        Returns details of the authentication token identified including
        it's new expiry date.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Token'
      tags:
        - tokens
    delete:
      operationId: tokens_delete
      summary: Destroy an authentication token.
      description: Deletes the token, whether or not is is expired.
      parameters: []
      responses:
        '204':
          description: ''
      tags:
        - tokens
    parameters:
      - name: token
        in: path
        required: true
        type: string
  /users/:
    get:
      operationId: users_list
      summary: List users.
      description: |-
        The optional `search` parameter is a search string used to filter user.
        Returns details on each user.
      parameters:
        - name: limit
          in: query
          description: Number of results to return per page.
          required: false
          type: integer
        - name: offset
          in: query
          description: The initial index from which to return the results.
          required: false
          type: integer
        - name: search
          in: query
          description: String to search for within user usernames, first and last
            names and email addresses.
          type: string
      responses:
        '200':
          description: ''
          schema:
            required:
              - count
              - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/User'
      tags:
        - users
    parameters: []
  /users/me/:
    get:
      operationId: users_me
      summary: Retrieve the current user.
      description: Returns details of the user who is currently authenticated.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Me'
      tags:
        - users
    parameters: []
  /users/{user}/:
    get:
      operationId: users_read
      summary: Retrieve a user.
      description: Returns details of the user.
      parameters:
        - name: user
          in: path
          description: Username or integer id
          type: string
          required: true
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/User'
      tags:
        - users
    parameters:
      - name: user
        in: path
        required: true
        type: string
  /workers/heartbeat/:
    post:
      operationId: workers_heartbeat
      summary: Create a worker heartbeat.
      description: |-
        An internal route, intended primarily for the `overseer` service.
        Receives event data.
        Returns an empty response.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/Worker'
      responses:
        '200':
          description: OK
      tags:
        - workers
    parameters: []
  /workers/offline/:
    post:
      operationId: workers_offline
      summary: Record that a worker has gone offline.
      description: |-
        An internal route, intended primarily for the `overseer` service.
        Receives event data.
        Returns an empty response.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/Worker'
      responses:
        '200':
          description: OK
      tags:
        - workers
    parameters: []
  /workers/online/:
    post:
      operationId: workers_online
      summary: Record that a worker has come online.
      description: |-
        An internal route, intended primarily for the `overseer` service.
        Receives event data. Returns an empty response.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/Worker'
      responses:
        '200':
          description: OK
      tags:
        - workers
    parameters: []
  /workers/{hostname}/:
    patch:
      operationId: workers_partial_update
      summary: Update information on the worker.
      description: |-
        An internal route, intended primarily for the `overseer` service
        and intended to be used once per worker put separately to `/online`.
        Receives data such as which virtual host and queues it is listening
        to. Returns an empty response.
      parameters:
        - name: data
          in: body
          required: true
          schema:
            $ref: '#/definitions/Worker'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Worker'
      tags:
        - workers
    parameters:
      - name: hostname
        in: path
        required: true
        type: string
definitions:
  AccountImage:
    description: Get the URLs of alternative image sizes for the account.
    required:
      - small
      - medium
      - large
    type: object
    properties:
      small:
        title: Small
        type: string
        minLength: 1
      medium:
        title: Medium
        type: string
        minLength: 1
      large:
        title: Large
        type: string
        minLength: 1
  AccountList:
    required:
      - name
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      name:
        title: Name
        description: Name of the account. Lowercase and no spaces or leading numbers.
          Will be used in URLS e.g. https://hub.stenci.la/awesome-org
        type: string
        minLength: 1
      displayName:
        title: Display name
        description: Name to display in account profile.
        type: string
        maxLength: 256
        x-nullable: true
      email:
        title: Email
        description: An email to display in account profile. Will not be used by Stencila
          to contact you.
        type: string
        format: email
        maxLength: 254
        x-nullable: true
      image:
        $ref: '#/definitions/AccountImage'
      location:
        title: Location
        description: Location to display in account profile.
        type: string
        maxLength: 256
        x-nullable: true
      website:
        title: Website
        description: URL to display in account profile.
        type: string
        format: uri
        maxLength: 200
        x-nullable: true
      role:
        title: Role
        description: Role of the current user on the account (if any).
        type: string
        readOnly: true
        minLength: 1
  AccountCreate:
    required:
      - name
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      name:
        title: Name
        description: Name of the account. Lowercase and no spaces or leading numbers.
          Will be used in URLS e.g. https://hub.stenci.la/awesome-org
        type: string
        minLength: 1
      user:
        title: User
        description: The user for this account. Only applies to personal accounts.
        type: integer
        x-nullable: true
      created:
        title: Created
        description: The time the account was created.
        type: string
        format: date-time
        readOnly: true
      billingEmail:
        title: Billing email
        description: The email to use for billing (e.g. sending invoices)
        type: string
        format: email
        maxLength: 254
        x-nullable: true
      displayName:
        title: Display name
        description: Name to display in account profile.
        type: string
        maxLength: 256
        x-nullable: true
      location:
        title: Location
        description: Location to display in account profile.
        type: string
        maxLength: 256
        x-nullable: true
      image:
        title: Image
        description: Image for the account.
        type: string
        readOnly: true
        x-nullable: true
        format: uri
      website:
        title: Website
        description: URL to display in account profile.
        type: string
        format: uri
        maxLength: 200
        x-nullable: true
      email:
        title: Email
        description: An email to display in account profile. Will not be used by Stencila
          to contact you.
        type: string
        format: email
        maxLength: 254
        x-nullable: true
      theme:
        title: Theme
        description: The default theme for the account.
        type: string
        enum:
          - bootstrap
          - elife
          - f1000
          - galleria
          - giga
          - latex
          - nature
          - plos
          - rpng
          - skeleton
          - stencila
          - tufte
          - wilmore
      extraHead:
        title: Extra head
        description: Content to inject into the <head> element of HTML served for
          this account.
        type: string
        x-nullable: true
      extraTop:
        title: Extra top
        description: Content to inject at the top of the <body> element of HTML served
          for this account.
        type: string
        x-nullable: true
      extraBottom:
        title: Extra bottom
        description: Content to inject at the bottom of the <body> element of HTML
          served for this account.
        type: string
        x-nullable: true
      hosts:
        title: Hosts
        description: A space separated list of valid hosts for the account. Used for
          setting Content Security Policy headers when serving content for this account.
        type: string
        x-nullable: true
  User:
    required:
      - username
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      username:
        title: Username
        description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_
          only.
        type: string
        pattern: ^[\w.@+-]+$
        maxLength: 150
        minLength: 1
      firstName:
        title: First name
        type: string
        maxLength: 150
      lastName:
        title: Last name
        type: string
        maxLength: 150
      displayName:
        title: Display name
        type: string
        readOnly: true
      location:
        title: Location
        type: string
        readOnly: true
      image:
        $ref: '#/definitions/AccountImage'
      website:
        title: Website
        type: string
        readOnly: true
      publicEmail:
        title: Public email
        type: string
        readOnly: true
  AccountUser:
    required:
      - user
      - role
      - account
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      user:
        $ref: '#/definitions/User'
      role:
        title: Role
        type: string
        enum:
          - MEMBER
          - MANAGER
          - OWNER
      account:
        title: Account
        description: Account to which the user belongs.
        type: integer
  AccountTeam:
    required:
      - account
      - name
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      account:
        title: Account
        description: Account to which the team belongs.
        type: integer
      name:
        title: Name
        description: Name of the account. Lowercase and no spaces or leading numbers.
          Will be used in URLS e.g. https://hub.stenci.la/awesome-org
        type: string
        minLength: 1
      description:
        title: Description
        description: Team description.
        type: string
        x-nullable: true
      members:
        type: array
        items:
          $ref: '#/definitions/User'
        readOnly: true
  AccountRetrieve:
    required:
      - name
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      name:
        title: Name
        description: Name of the account. Lowercase and no spaces or leading numbers.
          Will be used in URLS e.g. https://hub.stenci.la/awesome-org
        type: string
        minLength: 1
      user:
        title: User
        description: The user for this account. Only applies to personal accounts.
        type: integer
        x-nullable: true
      creator:
        title: Creator
        description: The user who created the account.
        type: integer
        x-nullable: true
      created:
        title: Created
        description: The time the account was created.
        type: string
        format: date-time
        readOnly: true
      billingEmail:
        title: Billing email
        description: The email to use for billing (e.g. sending invoices)
        type: string
        format: email
        maxLength: 254
        x-nullable: true
      displayName:
        title: Display name
        description: Name to display in account profile.
        type: string
        maxLength: 256
        x-nullable: true
      location:
        title: Location
        description: Location to display in account profile.
        type: string
        maxLength: 256
        x-nullable: true
      image:
        $ref: '#/definitions/AccountImage'
      website:
        title: Website
        description: URL to display in account profile.
        type: string
        format: uri
        maxLength: 200
        x-nullable: true
      email:
        title: Email
        description: An email to display in account profile. Will not be used by Stencila
          to contact you.
        type: string
        format: email
        maxLength: 254
        x-nullable: true
      theme:
        title: Theme
        description: The default theme for the account.
        type: string
        enum:
          - bootstrap
          - elife
          - f1000
          - galleria
          - giga
          - latex
          - nature
          - plos
          - rpng
          - skeleton
          - stencila
          - tufte
          - wilmore
      extraHead:
        title: Extra head
        description: Content to inject into the <head> element of HTML served for
          this account.
        type: string
        x-nullable: true
      extraTop:
        title: Extra top
        description: Content to inject at the top of the <body> element of HTML served
          for this account.
        type: string
        x-nullable: true
      extraBottom:
        title: Extra bottom
        description: Content to inject at the bottom of the <body> element of HTML
          served for this account.
        type: string
        x-nullable: true
      hosts:
        title: Hosts
        description: A space separated list of valid hosts for the account. Used for
          setting Content Security Policy headers when serving content for this account.
        type: string
        x-nullable: true
      role:
        title: Role
        description: Role of the current user on the account (if any).
        type: string
        readOnly: true
        minLength: 1
      users:
        type: array
        items:
          $ref: '#/definitions/AccountUser'
        readOnly: true
      teams:
        type: array
        items:
          $ref: '#/definitions/AccountTeam'
        readOnly: true
  AccountUpdate:
    required:
      - name
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      name:
        title: Name
        description: Name of the account. Lowercase and no spaces or leading numbers.
          Will be used in URLS e.g. https://hub.stenci.la/awesome-org
        type: string
        minLength: 1
      user:
        title: User
        description: The user for this account. Only applies to personal accounts.
        type: integer
        x-nullable: true
      creator:
        title: Creator
        description: The user who created the account.
        type: integer
        readOnly: true
      created:
        title: Created
        description: The time the account was created.
        type: string
        format: date-time
        readOnly: true
      billingEmail:
        title: Billing email
        description: The email to use for billing (e.g. sending invoices)
        type: string
        format: email
        maxLength: 254
        x-nullable: true
      displayName:
        title: Display name
        description: Name to display in account profile.
        type: string
        maxLength: 256
        x-nullable: true
      location:
        title: Location
        description: Location to display in account profile.
        type: string
        maxLength: 256
        x-nullable: true
      image:
        title: Image
        description: Image for the account.
        type: string
        readOnly: true
        x-nullable: true
        format: uri
      website:
        title: Website
        description: URL to display in account profile.
        type: string
        format: uri
        maxLength: 200
        x-nullable: true
      email:
        title: Email
        description: An email to display in account profile. Will not be used by Stencila
          to contact you.
        type: string
        format: email
        maxLength: 254
        x-nullable: true
      theme:
        title: Theme
        description: The default theme for the account.
        type: string
        enum:
          - bootstrap
          - elife
          - f1000
          - galleria
          - giga
          - latex
          - nature
          - plos
          - rpng
          - skeleton
          - stencila
          - tufte
          - wilmore
      extraHead:
        title: Extra head
        description: Content to inject into the <head> element of HTML served for
          this account.
        type: string
        x-nullable: true
      extraTop:
        title: Extra top
        description: Content to inject at the top of the <body> element of HTML served
          for this account.
        type: string
        x-nullable: true
      extraBottom:
        title: Extra bottom
        description: Content to inject at the bottom of the <body> element of HTML
          served for this account.
        type: string
        x-nullable: true
      hosts:
        title: Hosts
        description: A space separated list of valid hosts for the account. Used for
          setting Content Security Policy headers when serving content for this account.
        type: string
        x-nullable: true
      firstName:
        title: First name
        description: Your first names (given names).
        type: string
        default: ''
        minLength: 1
      lastName:
        title: Last name
        description: Your last names (family names, surnames).
        type: string
        default: ''
        minLength: 1
  Queue:
    required:
      - name
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      name:
        title: Name
        description: The name of the queue.
        type: string
        maxLength: 512
        minLength: 1
      priority:
        title: Priority
        description: The relative priority of jobs placed on the queue.
        type: integer
        maximum: 2147483647
        minimum: -2147483648
      untrusted:
        title: Untrusted
        description: Whether or not the queue should be sent jobs which run untrusted
          code.
        type: boolean
      interrupt:
        title: Interrupt
        description: 'Whether or not the queue should be sent jobs which can not be
          interupted.False (default): jobs should not be interrupted'
        type: boolean
      zone:
        title: Zone
        description: The zone this job is associated with.
        type: integer
        x-nullable: true
  AccountTeamCreate:
    required:
      - name
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      name:
        title: Name
        description: Name of the account. Lowercase and no spaces or leading numbers.
          Will be used in URLS e.g. https://hub.stenci.la/awesome-org
        type: string
        minLength: 1
      description:
        title: Description
        description: Team description.
        type: string
        x-nullable: true
      members:
        type: array
        items:
          type: integer
        uniqueItems: true
  AccountTeamUpdate:
    required:
      - name
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      name:
        title: Name
        description: Name of the account. Lowercase and no spaces or leading numbers.
          Will be used in URLS e.g. https://hub.stenci.la/awesome-org
        type: string
        minLength: 1
      description:
        title: Description
        description: Team description.
        type: string
        x-nullable: true
      members:
        type: array
        items:
          type: integer
        uniqueItems: true
  UserIdentifier:
    type: object
    properties:
      id:
        title: Id
        type: integer
      username:
        title: Username
        type: string
        minLength: 1
  AccountUserCreate:
    required:
      - role
    type: object
    properties:
      id:
        title: Id
        type: integer
      username:
        title: Username
        type: string
        minLength: 1
      role:
        title: Role
        type: string
        enum:
          - MEMBER
          - MANAGER
          - OWNER
  AccountUserPatch:
    required:
      - user
      - role
      - account
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      user:
        $ref: '#/definitions/User'
      role:
        title: Role
        type: string
        enum:
          - MEMBER
          - MANAGER
          - OWNER
      account:
        title: Account
        description: Account to which the user belongs.
        type: integer
  Worker:
    required:
      - hostname
      - queues
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      active:
        title: Active
        type: boolean
        readOnly: true
      created:
        title: Created
        description: The time that the worker started (time of the first event for
          the worker).
        type: string
        format: date-time
        readOnly: true
      started:
        title: Started
        description: The time that the worker started (only recorded on a 'worker-online'
          event).
        type: string
        format: date-time
        x-nullable: true
      updated:
        title: Updated
        description: The time that the last heatbeat was received for the worker.
        type: string
        format: date-time
        x-nullable: true
      finished:
        title: Finished
        description: The time that the worker finished (only recorded on a 'worker-offline'
          event)
        type: string
        format: date-time
        x-nullable: true
      hostname:
        title: Hostname
        description: The `hostname` of the worker.
        type: string
        maxLength: 512
        minLength: 1
      utcoffset:
        title: Utcoffset
        description: The `utcoffset` of the worker.
        type: integer
        maximum: 2147483647
        minimum: -2147483648
        x-nullable: true
      pid:
        title: Pid
        description: The `pid` of the worker.
        type: integer
        maximum: 2147483647
        minimum: -2147483648
        x-nullable: true
      freq:
        title: Freq
        description: The worker's heatbeat frequency (in seconds)
        type: number
        x-nullable: true
      software:
        title: Software
        description: The name and version of the worker's software.
        type: string
        maxLength: 256
        x-nullable: true
      os:
        title: Os
        description: Operating system that the worker is running on.
        type: string
        maxLength: 64
        x-nullable: true
      details:
        title: Details
        description: Details about the worker including queues and statsSee https://docs.celeryproject.org/en/stable/userguide/workers.html#statistics
        type: object
        x-nullable: true
      signature:
        title: Signature
        description: The signature of the worker used to identify it. It is possible,
          but unlikely, that two or more active workers have the same signature.
        type: string
        maxLength: 512
        x-nullable: true
      queues:
        description: The queues that this worker is listening to.
        type: array
        items:
          description: The queues that this worker is listening to.
          type: integer
        uniqueItems: true
  WorkerHeartbeat:
    required:
      - time
      - clock
      - active
      - processed
      - load
    type: object
    properties:
      time:
        title: Time
        description: The time of the heartbeat.
        type: string
        format: date-time
      clock:
        title: Clock
        description: The tick number of the worker's monotonic clock
        type: integer
        maximum: 2147483647
        minimum: -2147483648
      active:
        title: Active
        description: The number of active jobs on the worker.
        type: integer
        maximum: 2147483647
        minimum: -2147483648
      processed:
        title: Processed
        description: The number of jobs that have been processed by the worker.
        type: integer
        maximum: 2147483647
        minimum: -2147483648
      load:
        title: Load
        description: An array of the system load over the last 1, 5 and 15 minutes.
          From os.getloadavg().
        type: object
  Zone:
    required:
      - name
      - account
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      name:
        title: Name
        description: The identifier of the queue the job was posted to.
        type: string
        pattern: ^[a-z][a-z0-9\-]*$
        maxLength: 256
        minLength: 1
      account:
        title: Account
        description: The account that this zone is linked to.
        type: integer
  ZoneCreate:
    required:
      - name
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      name:
        title: Name
        description: The identifier of the queue the job was posted to.
        type: string
        pattern: ^[a-z][a-z0-9\-]*$
        maxLength: 256
        minLength: 1
  Doi:
    required:
      - node
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      doi:
        title: Doi
        type: string
        readOnly: true
        minLength: 1
      url:
        title: Url
        type: string
        readOnly: true
        minLength: 1
      created:
        title: Created
        description: Date-time the DOI was created.
        type: string
        format: date-time
        readOnly: true
      deposited:
        title: Deposited
        description: Date-time that the deposit request was sent to the registrar.
        type: string
        format: date
        x-nullable: true
      depositSuccess:
        title: Deposit success
        description: Whether or not the deposit was successful.
        type: boolean
        x-nullable: true
      registered:
        title: Registered
        description: Date-time that a registration notification was received from
          the registrar.
        type: string
        format: date
        x-nullable: true
      registrationSuccess:
        title: Registration success
        description: Whether or not the registration was successful.
        type: boolean
        x-nullable: true
      node:
        title: Node
        description: The Stencila node that the DOI points to.
        type: integer
  Email:
    required:
      - sender
      - recipient
      - subject
      - text
      - html
      - spf
    type: object
    properties:
      sender:
        title: Sender
        description: Email sender, as taken from the message headers.
        type: string
        minLength: 1
      recipient:
        title: Recipient
        description: Email recipient field, as taken from the message headers.
        type: string
        minLength: 1
      subject:
        title: Subject
        description: Email subject.
        type: string
        minLength: 1
      text:
        title: Text
        description: Email body in plaintext formatting.
        type: string
        minLength: 1
      html:
        title: Html
        description: HTML body of email. If not set, email did not have an HTML body.
        type: string
        minLength: 1
      spf:
        title: Spf
        description: The results of the Sender Policy Framework verification of the
          message sender and receiving IP address.
        type: string
        minLength: 1
  MeFeatureFlags:
    required:
      - featureFlag
    type: object
    properties:
      featureFlag:
        title: Feature flag
        type: string
        enum:
          - on
          - off
  Invite:
    required:
      - email
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      url:
        title: Url
        type: string
        readOnly: true
      key:
        title: Key
        description: The key for the invite.
        type: string
        readOnly: true
        minLength: 1
      email:
        title: Email
        description: The email address of the person you are inviting.
        type: string
        format: email
        maxLength: 2048
        minLength: 1
      message:
        title: Message
        description: An optional message to send to the invitee.
        type: string
        x-nullable: true
      created:
        title: Created
        description: When the invite was created.
        type: string
        format: date-time
        readOnly: true
      sent:
        title: Sent
        description: When the invite was sent.
        type: string
        format: date-time
        x-nullable: true
      accepted:
        title: Accepted
        description: Whether the invite has been accepted. Will only be true if the
          user has clicked on the invitation AND authenticated.
        type: boolean
      completed:
        title: Completed
        description: When the invite action was completed
        type: string
        format: date-time
        x-nullable: true
      action:
        title: Action
        description: The action to perform when the invitee signs up.
        type: string
        enum:
          - join_account
          - join_team
          - join_project
          - take_tour
        x-nullable: true
      subjectId:
        title: Subject id
        description: The id of the target of the action.
        type: integer
        maximum: 2147483647
        minimum: -2147483648
        x-nullable: true
      arguments:
        title: Arguments
        description: Any additional arguments to pass to the action.
        type: object
        x-nullable: true
      inviter:
        title: Inviter
        description: The user who created the invite.
        type: integer
        x-nullable: true
      subjectType:
        title: Subject type
        description: The type of the target of the action. e.g Team, Account
        type: integer
        x-nullable: true
  JobUpdate:
    type: object
    properties:
      id:
        title: Id
        description: An autoincrementing integer to allow selecting jobs in the order
          they were created.
        type: integer
        readOnly: true
      statusMessage:
        title: Status message
        type: string
        readOnly: true
        minLength: 1
      summaryString:
        title: Summary string
        type: string
        readOnly: true
        minLength: 1
      runtimeFormatted:
        title: Runtime formatted
        type: string
        readOnly: true
        minLength: 1
      urls:
        title: Urls
        type: string
        readOnly: true
      url:
        title: Url
        type: string
        readOnly: true
      position:
        title: Position
        type: integer
        readOnly: true
      children:
        type: array
        items:
          type: integer
        readOnly: true
        uniqueItems: true
      params:
        title: Params
        type: string
        readOnly: true
      key:
        title: Key
        description: A unique, and very difficult to guess, key to access the job
          with.
        type: string
        maxLength: 64
        minLength: 1
      description:
        title: Description
        description: A short description of the job.
        type: string
        x-nullable: true
      created:
        title: Created
        description: The time the job was created.
        type: string
        format: date-time
        readOnly: true
      updated:
        title: Updated
        description: The time the job was last updated.
        type: string
        format: date-time
        readOnly: true
      began:
        title: Began
        description: The time the job began.
        type: string
        format: date-time
        x-nullable: true
      ended:
        title: Ended
        description: The time the job ended.
        type: string
        format: date-time
        x-nullable: true
      status:
        title: Status
        description: The current status of the job.
        type: string
        enum:
          - WAITING
          - DISPATCHED
          - PENDING
          - RECEIVED
          - STARTED
          - RUNNING
          - SUCCESS
          - FAILURE
          - CANCELLED
          - REVOKED
          - TERMINATED
          - REJECTED
          - RETRY
        x-nullable: true
      isActive:
        title: Is active
        description: Is the job active?
        type: boolean
      method:
        title: Method
        description: The job method.
        type: string
        enum:
          - parallel
          - series
          - clean
          - archive
          - zip
          - pull
          - push
          - extract
          - convert
          - pin
          - register
          - compile
          - build
          - execute
          - session
          - sleep
        readOnly: true
      result:
        title: Result
        description: The result of the job; a JSON value.
        type: object
        x-nullable: true
      error:
        title: Error
        description: Any error associated with the job; a JSON object with type, message
          etc.
        type: object
        x-nullable: true
      log:
        title: Log
        description: The job log; a JSON array of log objects, including any errors.
        type: object
        x-nullable: true
      runtime:
        title: Runtime
        description: The running time of the job.
        type: number
        x-nullable: true
      worker:
        title: Worker
        description: The identifier of the worker that ran the job.
        type: string
        maxLength: 64
        x-nullable: true
      retries:
        title: Retries
        description: The number of retries to fulfil the job.
        type: integer
        maximum: 2147483647
        minimum: -2147483648
        x-nullable: true
      callbackId:
        title: Callback id
        description: The id of the object to call back.
        type: string
        maxLength: 256
        x-nullable: true
      callbackMethod:
        title: Callback method
        description: The name of the method to call back.
        type: string
        maxLength: 128
        x-nullable: true
      project:
        title: Project
        description: The project this job is associated with.
        type: integer
        x-nullable: true
      snapshot:
        title: Snapshot
        description: The snapshot that this job is associated with. Usually `session`
          jobs for the snapshot.
        type: string
        x-nullable: true
      creator:
        title: Creator
        description: The user who created the job.
        type: integer
        readOnly: true
      queue:
        title: Queue
        description: The queue that this job was routed to
        type: integer
        readOnly: true
      parent:
        title: Parent
        description: The parent job
        type: integer
        x-nullable: true
      callbackType:
        title: Callback type
        description: The type of the object to call back.
        type: integer
        x-nullable: true
      users:
        description: Users who have created or connected to the job; not necessarily
          currently connected.
        type: array
        items:
          description: Users who have created or connected to the job; not necessarily
            currently connected.
          type: integer
        uniqueItems: true
      anonUsers:
        description: Anonymous users who have created or connected to the job.
        type: array
        items:
          description: Anonymous users who have created or connected to the job.
          type: string
        uniqueItems: true
  NodeCreateRequest:
    required:
      - node
    type: object
    properties:
      project:
        title: Project
        description: The project this node is associated with (if any).
        type: integer
        x-nullable: true
      source:
        title: Source
        description: The id or address of the source the node is a part of
        type: string
        minLength: 1
      app:
        title: App
        description: An identifier for the app that created the node.
        type: string
        x-nullable: true
      host:
        title: Host
        description: URL of the host document within which the node was created.
        type: string
        format: uri
        maxLength: 200
        x-nullable: true
      node:
        title: Node
        description: The node itself.
        type: object
  NodeCreateResponse:
    required:
      - project
    type: object
    properties:
      creator:
        title: Creator
        description: User who created the project.
        type: integer
        x-nullable: true
      created:
        title: Created
        description: When the project was created.
        type: string
        format: date-time
        readOnly: true
      project:
        title: Project
        description: The project this node is associated with (if any).
        type: integer
        x-nullable: true
      source:
        title: Source
        description: The source this node is associated with (if any).
        type: integer
        x-nullable: true
      app:
        title: App
        description: An identifier for the app that created the node.
        type: string
        x-nullable: true
      host:
        title: Host
        description: URL of the host document within which the node was created.
        type: string
        format: uri
        maxLength: 200
        x-nullable: true
      key:
        title: Key
        description: A unique, and very difficult to guess, key to access this node
          if it is not public.
        type: string
        default: 3L7fChHF8obgTrdsVysej3nrx75nALxg
        maxLength: 64
        minLength: 1
      url:
        title: Url
        type: string
        readOnly: true
  NodeRetrieve:
    required:
      - project
      - node
    type: object
    properties:
      creator:
        title: Creator
        description: User who created the project.
        type: integer
        x-nullable: true
      created:
        title: Created
        description: When the project was created.
        type: string
        format: date-time
        readOnly: true
      project:
        title: Project
        description: The project this node is associated with (if any).
        type: integer
        x-nullable: true
      source:
        title: Source
        description: The source this node is associated with (if any).
        type: integer
        x-nullable: true
      app:
        title: App
        description: An identifier for the app that created the node.
        type: string
        x-nullable: true
      host:
        title: Host
        description: URL of the host document within which the node was created.
        type: string
        format: uri
        maxLength: 200
        x-nullable: true
      key:
        title: Key
        description: A unique, and very difficult to guess, key to access this node
          if it is not public.
        type: string
        default: RXGrDEozNm3cczk34fdEh3KGHErb6Qw2
        maxLength: 64
        minLength: 1
      url:
        title: Url
        type: string
        readOnly: true
      node:
        title: Node
        description: The node itself.
        type: object
  ProjectList:
    required:
      - account
      - name
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      account:
        $ref: '#/definitions/AccountList'
      creator:
        title: Creator
        description: The user who created the project.
        type: integer
        x-nullable: true
      created:
        title: Created
        description: The time the project was created.
        type: string
        format: date-time
        readOnly: true
      name:
        title: Name
        description: Name of the project. Lowercase only and unique for the account.
          Will be used in URLS e.g. https://hub.stenci.la/awesome-org/great-project.
        type: string
        format: slug
        pattern: ^[-a-zA-Z0-9_]+$
        maxLength: 50
        minLength: 1
      title:
        title: Title
        description: Title of the project to display in its profile.
        type: string
        maxLength: 256
        x-nullable: true
      description:
        title: Description
        description: Brief description of the project.
        type: string
        x-nullable: true
      imageFile:
        title: Image file
        description: The image used for this project in project listings and HTML
          meta data.
        type: string
        readOnly: true
        x-nullable: true
        format: uri
      imagePath:
        title: Image path
        description: Path of file in the project's working directory to use as this
          project's image. Allows the project's image to update as it is re-executed.
        type: string
        maxLength: 1024
        x-nullable: true
      imageUpdated:
        title: Image updated
        description: When the image file was last updated (e.g. from image_path).
        type: string
        format: date-time
        x-nullable: true
      temporary:
        title: Temporary
        description: Is the project temporary?
        type: boolean
      public:
        title: Public
        description: Is the project publicly visible?
        type: boolean
      featured:
        title: Featured
        description: Is the project to be featured in listings?
        type: boolean
      key:
        title: Key
        description: A unique, and very difficult to guess, key to access this project
          if it is not public.
        type: string
        maxLength: 64
        minLength: 1
      main:
        title: Main
        description: Path of the main file of the project
        type: string
        x-nullable: true
      containerImage:
        title: Container image
        description: The container image to use as the execution environment for this
          project.
        type: string
        x-nullable: true
      sessionTimeout:
        title: Session timeout
        description: The amount of time of inactivity after which a session will end
          (s).
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      sessionTimelimit:
        title: Session timelimit
        description: The maximum duration of a session (s).
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      sessionMemory:
        title: Session memory
        description: The amount of memory allocated (request and limit) for a session
          (MiB).
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      liveness:
        title: Liveness
        description: Where to serve the content for this project from.
        type: string
        enum:
          - live
          - latest
          - pinned
      pinned:
        title: Pinned
        description: If pinned, the snapshot to pin to, when serving content.
        type: string
        x-nullable: true
      theme:
        title: Theme
        description: The name of the theme to use as the default when generating content
          for this project.
        type: string
        enum:
          - bootstrap
          - elife
          - f1000
          - galleria
          - giga
          - latex
          - nature
          - plos
          - rpng
          - skeleton
          - stencila
          - tufte
          - wilmore
      extraHead:
        title: Extra head
        description: Content to inject into the <head> element of HTML served for
          this project.
        type: string
        x-nullable: true
      extraTop:
        title: Extra top
        description: Content to inject at the top of the <body> element of HTML served
          for this project.
        type: string
        x-nullable: true
      extraBottom:
        title: Extra bottom
        description: Content to inject at the bottom of the <body> element of HTML
          served for this project.
        type: string
        x-nullable: true
      role:
        title: Role
        description: Role of the current user on the project (if any).
        type: string
        readOnly: true
        minLength: 1
  ProjectCreate:
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      account:
        title: Account
        description: Account that the project belongs to.
        type: integer
      created:
        title: Created
        description: The time the project was created.
        type: string
        format: date-time
        readOnly: true
      name:
        title: Name
        description: Name of the project. Lowercase only and unique for the account.
          Will be used in URLS e.g. https://hub.stenci.la/awesome-org/great-project.
        type: string
        minLength: 1
      title:
        title: Title
        description: Title of the project to display in its profile.
        type: string
        maxLength: 256
        x-nullable: true
      description:
        title: Description
        description: Brief description of the project.
        type: string
        x-nullable: true
      imageFile:
        title: Image file
        description: The image used for this project in project listings and HTML
          meta data.
        type: string
        readOnly: true
        x-nullable: true
        format: uri
      imagePath:
        title: Image path
        description: Path of file in the project's working directory to use as this
          project's image. Allows the project's image to update as it is re-executed.
        type: string
        maxLength: 1024
        x-nullable: true
      imageUpdated:
        title: Image updated
        description: When the image file was last updated (e.g. from image_path).
        type: string
        format: date-time
        x-nullable: true
      temporary:
        title: Temporary
        description: Is the project temporary?
        type: boolean
      public:
        title: Public
        description: Is the project publicly visible?
        type: boolean
      featured:
        title: Featured
        description: Is the project to be featured in listings?
        type: boolean
      key:
        title: Key
        description: A unique, and very difficult to guess, key to access this project
          if it is not public.
        type: string
        maxLength: 64
        minLength: 1
      main:
        title: Main
        description: Path of the main file of the project
        type: string
        x-nullable: true
      containerImage:
        title: Container image
        description: The container image to use as the execution environment for this
          project.
        type: string
        x-nullable: true
      sessionTimeout:
        title: Session timeout
        description: The amount of time of inactivity after which a session will end
          (s).
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      sessionTimelimit:
        title: Session timelimit
        description: The maximum duration of a session (s).
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      sessionMemory:
        title: Session memory
        description: The amount of memory allocated (request and limit) for a session
          (MiB).
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      liveness:
        title: Liveness
        description: Where to serve the content for this project from.
        type: string
        enum:
          - live
          - latest
          - pinned
      pinned:
        title: Pinned
        description: If pinned, the snapshot to pin to, when serving content.
        type: string
        readOnly: true
      theme:
        title: Theme
        description: The name of the theme to use as the default when generating content
          for this project.
        type: string
        enum:
          - bootstrap
          - elife
          - f1000
          - galleria
          - giga
          - latex
          - nature
          - plos
          - rpng
          - skeleton
          - stencila
          - tufte
          - wilmore
      extraHead:
        title: Extra head
        description: Content to inject into the <head> element of HTML served for
          this project.
        type: string
        x-nullable: true
      extraTop:
        title: Extra top
        description: Content to inject at the top of the <body> element of HTML served
          for this project.
        type: string
        x-nullable: true
      extraBottom:
        title: Extra bottom
        description: Content to inject at the bottom of the <body> element of HTML
          served for this project.
        type: string
        x-nullable: true
  ProjectRetrieve:
    required:
      - account
      - name
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      account:
        $ref: '#/definitions/AccountList'
      creator:
        title: Creator
        description: The user who created the project.
        type: integer
        x-nullable: true
      created:
        title: Created
        description: The time the project was created.
        type: string
        format: date-time
        readOnly: true
      name:
        title: Name
        description: Name of the project. Lowercase only and unique for the account.
          Will be used in URLS e.g. https://hub.stenci.la/awesome-org/great-project.
        type: string
        format: slug
        pattern: ^[-a-zA-Z0-9_]+$
        maxLength: 50
        minLength: 1
      title:
        title: Title
        description: Title of the project to display in its profile.
        type: string
        maxLength: 256
        x-nullable: true
      description:
        title: Description
        description: Brief description of the project.
        type: string
        x-nullable: true
      imageFile:
        title: Image file
        description: The image used for this project in project listings and HTML
          meta data.
        type: string
        readOnly: true
        x-nullable: true
        format: uri
      imagePath:
        title: Image path
        description: Path of file in the project's working directory to use as this
          project's image. Allows the project's image to update as it is re-executed.
        type: string
        maxLength: 1024
        x-nullable: true
      imageUpdated:
        title: Image updated
        description: When the image file was last updated (e.g. from image_path).
        type: string
        format: date-time
        x-nullable: true
      temporary:
        title: Temporary
        description: Is the project temporary?
        type: boolean
      public:
        title: Public
        description: Is the project publicly visible?
        type: boolean
      featured:
        title: Featured
        description: Is the project to be featured in listings?
        type: boolean
        readOnly: true
      key:
        title: Key
        description: A unique, and very difficult to guess, key to access this project
          if it is not public.
        type: string
        readOnly: true
        minLength: 1
      main:
        title: Main
        description: Path of the main file of the project
        type: string
        x-nullable: true
      containerImage:
        title: Container image
        description: The container image to use as the execution environment for this
          project.
        type: string
        x-nullable: true
      sessionTimeout:
        title: Session timeout
        description: The amount of time of inactivity after which a session will end
          (s).
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      sessionTimelimit:
        title: Session timelimit
        description: The maximum duration of a session (s).
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      sessionMemory:
        title: Session memory
        description: The amount of memory allocated (request and limit) for a session
          (MiB).
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      liveness:
        title: Liveness
        description: Where to serve the content for this project from.
        type: string
        enum:
          - live
          - latest
          - pinned
      pinned:
        title: Pinned
        description: If pinned, the snapshot to pin to, when serving content.
        type: string
        x-nullable: true
      theme:
        title: Theme
        description: The name of the theme to use as the default when generating content
          for this project.
        type: string
        enum:
          - bootstrap
          - elife
          - f1000
          - galleria
          - giga
          - latex
          - nature
          - plos
          - rpng
          - skeleton
          - stencila
          - tufte
          - wilmore
      extraHead:
        title: Extra head
        description: Content to inject into the <head> element of HTML served for
          this project.
        type: string
        x-nullable: true
      extraTop:
        title: Extra top
        description: Content to inject at the top of the <body> element of HTML served
          for this project.
        type: string
        x-nullable: true
      extraBottom:
        title: Extra bottom
        description: Content to inject at the bottom of the <body> element of HTML
          served for this project.
        type: string
        x-nullable: true
  ProjectUpdate:
    required:
      - name
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      account:
        title: Account
        description: Account that the project belongs to.
        type: integer
      creator:
        title: Creator
        description: The user who created the project.
        type: integer
        x-nullable: true
      created:
        title: Created
        description: The time the project was created.
        type: string
        format: date-time
        readOnly: true
      name:
        title: Name
        description: Name of the project. Lowercase only and unique for the account.
          Will be used in URLS e.g. https://hub.stenci.la/awesome-org/great-project.
        type: string
        format: slug
        pattern: ^[-a-zA-Z0-9_]+$
        maxLength: 50
        minLength: 1
      title:
        title: Title
        description: Title of the project to display in its profile.
        type: string
        maxLength: 256
        x-nullable: true
      description:
        title: Description
        description: Brief description of the project.
        type: string
        x-nullable: true
      imageFile:
        title: Image file
        description: The image used for this project in project listings and HTML
          meta data.
        type: string
        readOnly: true
        x-nullable: true
        format: uri
      imagePath:
        title: Image path
        description: Path of file in the project's working directory to use as this
          project's image. Allows the project's image to update as it is re-executed.
        type: string
        maxLength: 1024
        x-nullable: true
      imageUpdated:
        title: Image updated
        description: When the image file was last updated (e.g. from image_path).
        type: string
        format: date-time
        x-nullable: true
      temporary:
        title: Temporary
        description: Is the project temporary?
        type: boolean
      public:
        title: Public
        description: Is the project publicly visible?
        type: boolean
      featured:
        title: Featured
        description: Is the project to be featured in listings?
        type: boolean
      key:
        title: Key
        description: A unique, and very difficult to guess, key to access this project
          if it is not public.
        type: string
        maxLength: 64
        minLength: 1
      main:
        title: Main
        description: Path of the main file of the project
        type: string
        x-nullable: true
      containerImage:
        title: Container image
        description: The container image to use as the execution environment for this
          project.
        type: string
        x-nullable: true
      sessionTimeout:
        title: Session timeout
        description: The amount of time of inactivity after which a session will end
          (s).
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      sessionTimelimit:
        title: Session timelimit
        description: The maximum duration of a session (s).
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      sessionMemory:
        title: Session memory
        description: The amount of memory allocated (request and limit) for a session
          (MiB).
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      liveness:
        title: Liveness
        description: Where to serve the content for this project from.
        type: string
        enum:
          - live
          - latest
          - pinned
      pinned:
        title: Pinned
        description: If pinned, the snapshot to pin to, when serving content.
        type: string
        x-nullable: true
      theme:
        title: Theme
        description: The name of the theme to use as the default when generating content
          for this project.
        type: string
        enum:
          - bootstrap
          - elife
          - f1000
          - galleria
          - giga
          - latex
          - nature
          - plos
          - rpng
          - skeleton
          - stencila
          - tufte
          - wilmore
      extraHead:
        title: Extra head
        description: Content to inject into the <head> element of HTML served for
          this project.
        type: string
        x-nullable: true
      extraTop:
        title: Extra top
        description: Content to inject at the top of the <body> element of HTML served
          for this project.
        type: string
        x-nullable: true
      extraBottom:
        title: Extra bottom
        description: Content to inject at the bottom of the <body> element of HTML
          served for this project.
        type: string
        x-nullable: true
  ProjectAgent:
    required:
      - project
      - role
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      project:
        title: Project
        description: Project to which the user or team is being given access to.
        type: integer
      type:
        title: Type
        type: string
        readOnly: true
      agent:
        title: Agent
        type: string
        readOnly: true
      role:
        title: Role
        description: Role the user or team has within the project.
        type: string
        enum:
          - READER
          - REVIEWER
          - EDITOR
          - AUTHOR
          - MANAGER
          - OWNER
  ProjectAgentCreate:
    required:
      - type
      - agent
      - role
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      type:
        title: Type
        type: string
        enum:
          - user
          - team
      agent:
        title: Agent
        type: integer
      role:
        title: Role
        type: string
        enum:
          - READER
          - REVIEWER
          - EDITOR
          - AUTHOR
          - MANAGER
          - OWNER
  ProjectAgentUpdate:
    required:
      - role
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      role:
        title: Role
        description: Role the user or team has within the project.
        type: string
        enum:
          - READER
          - REVIEWER
          - EDITOR
          - AUTHOR
          - MANAGER
          - OWNER
      project:
        title: Project
        description: Project to which the user or team is being given access to.
        type: integer
        readOnly: true
      user:
        title: User
        description: A user given access to the project.
        type: integer
        readOnly: true
      team:
        title: Team
        description: A team given access to the project.
        type: integer
        readOnly: true
  FileList:
    required:
      - path
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      name:
        title: Name
        type: string
        readOnly: true
      isDirectory:
        title: Is directory
        type: boolean
        readOnly: true
      count:
        title: Count
        type: integer
        readOnly: true
      source:
        title: Source
        type: string
        readOnly: true
      path:
        title: Path
        description: The path of the file within the project.
        type: string
        minLength: 1
      current:
        title: Current
        description: Is the file currently in the project? Used to retain a history
          for file paths within a project.
        type: boolean
      created:
        title: Created
        description: The time the file info was created.
        type: string
        format: date-time
        readOnly: true
      updated:
        title: Updated
        description: The time the file info was updated. This field will have the
          last time this row was altered (i.e. changed from current, to not).
        type: string
        format: date-time
        x-nullable: true
      modified:
        title: Modified
        description: The file modification time.
        type: string
        format: date-time
        x-nullable: true
      size:
        title: Size
        description: The size of the file in bytes
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      mimetype:
        title: Mimetype
        description: The mimetype of the file.
        type: string
        maxLength: 512
        x-nullable: true
      encoding:
        title: Encoding
        description: The encoding of the file e.g. gzip
        type: string
        maxLength: 512
        x-nullable: true
      fingerprint:
        title: Fingerprint
        description: The fingerprint of the file
        type: string
        maxLength: 128
        x-nullable: true
      job:
        title: Job
        description: The job that created the file e.g. a source pull or file conversion.
        type: integer
        x-nullable: true
      snapshot:
        title: Snapshot
        description: The snapshot that the file belongs. If the snapshot is deleted
          so will the files.
        type: string
        x-nullable: true
  File:
    required:
      - path
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      path:
        title: Path
        description: The path of the file within the project.
        type: string
        minLength: 1
      current:
        title: Current
        description: Is the file currently in the project? Used to retain a history
          for file paths within a project.
        type: boolean
      created:
        title: Created
        description: The time the file info was created.
        type: string
        format: date-time
        readOnly: true
      updated:
        title: Updated
        description: The time the file info was updated. This field will have the
          last time this row was altered (i.e. changed from current, to not).
        type: string
        format: date-time
        x-nullable: true
      modified:
        title: Modified
        description: The file modification time.
        type: string
        format: date-time
        x-nullable: true
      size:
        title: Size
        description: The size of the file in bytes
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      mimetype:
        title: Mimetype
        description: The mimetype of the file.
        type: string
        maxLength: 512
        x-nullable: true
      encoding:
        title: Encoding
        description: The encoding of the file e.g. gzip
        type: string
        maxLength: 512
        x-nullable: true
      fingerprint:
        title: Fingerprint
        description: The fingerprint of the file
        type: string
        maxLength: 128
        x-nullable: true
      job:
        title: Job
        description: The job that created the file e.g. a source pull or file conversion.
        type: integer
        x-nullable: true
      source:
        title: Source
        description: The source from which the file came (if any). If the source is
          removed from the project, so will this file.
        type: integer
        x-nullable: true
      snapshot:
        title: Snapshot
        description: The snapshot that the file belongs. If the snapshot is deleted
          so will the files.
        type: string
        x-nullable: true
      upstreams:
        description: The files that this file was derived from (if any).
        type: array
        items:
          description: The files that this file was derived from (if any).
          type: integer
        uniqueItems: true
  JobList:
    required:
      - method
    type: object
    properties:
      id:
        title: Id
        description: An autoincrementing integer to allow selecting jobs in the order
          they were created.
        type: integer
        readOnly: true
      statusMessage:
        title: Status message
        type: string
        readOnly: true
        minLength: 1
      summaryString:
        title: Summary string
        type: string
        readOnly: true
        minLength: 1
      runtimeFormatted:
        title: Runtime formatted
        type: string
        readOnly: true
        minLength: 1
      urls:
        title: Urls
        type: string
        readOnly: true
      url:
        title: Url
        type: string
        readOnly: true
      key:
        title: Key
        description: A unique, and very difficult to guess, key to access the job
          with.
        type: string
        maxLength: 64
        minLength: 1
      description:
        title: Description
        description: A short description of the job.
        type: string
        x-nullable: true
      created:
        title: Created
        description: The time the job was created.
        type: string
        format: date-time
        readOnly: true
      updated:
        title: Updated
        description: The time the job was last updated.
        type: string
        format: date-time
        readOnly: true
      began:
        title: Began
        description: The time the job began.
        type: string
        format: date-time
        x-nullable: true
      ended:
        title: Ended
        description: The time the job ended.
        type: string
        format: date-time
        x-nullable: true
      status:
        title: Status
        description: The current status of the job.
        type: string
        enum:
          - WAITING
          - DISPATCHED
          - PENDING
          - RECEIVED
          - STARTED
          - RUNNING
          - SUCCESS
          - FAILURE
          - CANCELLED
          - REVOKED
          - TERMINATED
          - REJECTED
          - RETRY
        x-nullable: true
      isActive:
        title: Is active
        description: Is the job active?
        type: boolean
      method:
        title: Method
        description: The job method.
        type: string
        enum:
          - parallel
          - series
          - clean
          - archive
          - zip
          - pull
          - push
          - extract
          - convert
          - pin
          - register
          - compile
          - build
          - execute
          - session
          - sleep
      runtime:
        title: Runtime
        description: The running time of the job.
        type: number
        x-nullable: true
      worker:
        title: Worker
        description: The identifier of the worker that ran the job.
        type: string
        maxLength: 64
        x-nullable: true
      retries:
        title: Retries
        description: The number of retries to fulfil the job.
        type: integer
        maximum: 2147483647
        minimum: -2147483648
        x-nullable: true
      callbackId:
        title: Callback id
        description: The id of the object to call back.
        type: string
        maxLength: 256
        x-nullable: true
      callbackMethod:
        title: Callback method
        description: The name of the method to call back.
        type: string
        maxLength: 128
        x-nullable: true
      project:
        title: Project
        description: The project this job is associated with.
        type: integer
        x-nullable: true
      snapshot:
        title: Snapshot
        description: The snapshot that this job is associated with. Usually `session`
          jobs for the snapshot.
        type: string
        x-nullable: true
      creator:
        title: Creator
        description: The user who created the job.
        type: integer
        x-nullable: true
      queue:
        title: Queue
        description: The queue that this job was routed to
        type: integer
        x-nullable: true
      parent:
        title: Parent
        description: The parent job
        type: integer
        x-nullable: true
      callbackType:
        title: Callback type
        description: The type of the object to call back.
        type: integer
        x-nullable: true
      users:
        description: Users who have created or connected to the job; not necessarily
          currently connected.
        type: array
        items:
          description: Users who have created or connected to the job; not necessarily
            currently connected.
          type: integer
        uniqueItems: true
      anonUsers:
        description: Anonymous users who have created or connected to the job.
        type: array
        items:
          description: Anonymous users who have created or connected to the job.
          type: string
        uniqueItems: true
  JobCreate:
    required:
      - method
    type: object
    properties:
      id:
        title: Id
        description: An autoincrementing integer to allow selecting jobs in the order
          they were created.
        type: integer
        readOnly: true
      statusMessage:
        title: Status message
        type: string
        readOnly: true
        minLength: 1
      summaryString:
        title: Summary string
        type: string
        readOnly: true
        minLength: 1
      runtimeFormatted:
        title: Runtime formatted
        type: string
        readOnly: true
        minLength: 1
      urls:
        title: Urls
        type: string
        readOnly: true
      url:
        title: Url
        type: string
        readOnly: true
      position:
        title: Position
        type: integer
        readOnly: true
      children:
        type: array
        items:
          type: integer
        readOnly: true
        uniqueItems: true
      params:
        title: Params
        type: object
      method:
        title: Method
        type: string
        enum:
          - parallel
          - series
          - clean
          - archive
          - zip
          - pull
          - push
          - extract
          - convert
          - pin
          - register
          - compile
          - build
          - execute
          - session
          - sleep
      key:
        title: Key
        description: A unique, and very difficult to guess, key to access the job
          with.
        type: string
        maxLength: 64
        minLength: 1
      description:
        title: Description
        description: A short description of the job.
        type: string
        x-nullable: true
      created:
        title: Created
        description: The time the job was created.
        type: string
        format: date-time
        readOnly: true
      updated:
        title: Updated
        description: The time the job was last updated.
        type: string
        format: date-time
        readOnly: true
      began:
        title: Began
        description: The time the job began.
        type: string
        format: date-time
        readOnly: true
      ended:
        title: Ended
        description: The time the job ended.
        type: string
        format: date-time
        readOnly: true
      status:
        title: Status
        description: The current status of the job.
        type: string
        enum:
          - WAITING
          - DISPATCHED
          - PENDING
          - RECEIVED
          - STARTED
          - RUNNING
          - SUCCESS
          - FAILURE
          - CANCELLED
          - REVOKED
          - TERMINATED
          - REJECTED
          - RETRY
        readOnly: true
      isActive:
        title: Is active
        description: Is the job active?
        type: boolean
      result:
        title: Result
        description: The result of the job; a JSON value.
        type: object
        readOnly: true
      error:
        title: Error
        description: Any error associated with the job; a JSON object with type, message
          etc.
        type: object
        x-nullable: true
      log:
        title: Log
        description: The job log; a JSON array of log objects, including any errors.
        type: object
        readOnly: true
      runtime:
        title: Runtime
        description: The running time of the job.
        type: number
        readOnly: true
      worker:
        title: Worker
        description: The identifier of the worker that ran the job.
        type: string
        readOnly: true
        minLength: 1
      retries:
        title: Retries
        description: The number of retries to fulfil the job.
        type: integer
        readOnly: true
      callbackId:
        title: Callback id
        description: The id of the object to call back.
        type: string
        maxLength: 256
        x-nullable: true
      callbackMethod:
        title: Callback method
        description: The name of the method to call back.
        type: string
        maxLength: 128
        x-nullable: true
      snapshot:
        title: Snapshot
        description: The snapshot that this job is associated with. Usually `session`
          jobs for the snapshot.
        type: string
        x-nullable: true
      queue:
        title: Queue
        description: The queue that this job was routed to
        type: integer
        readOnly: true
      parent:
        title: Parent
        description: The parent job
        type: integer
        x-nullable: true
      callbackType:
        title: Callback type
        description: The type of the object to call back.
        type: integer
        x-nullable: true
      users:
        description: Users who have created or connected to the job; not necessarily
          currently connected.
        type: array
        items:
          description: Users who have created or connected to the job; not necessarily
            currently connected.
          type: integer
        readOnly: true
        uniqueItems: true
      anonUsers:
        description: Anonymous users who have created or connected to the job.
        type: array
        items:
          description: Anonymous users who have created or connected to the job.
          type: string
        uniqueItems: true
  JobRetrieve:
    required:
      - method
    type: object
    properties:
      id:
        title: Id
        description: An autoincrementing integer to allow selecting jobs in the order
          they were created.
        type: integer
        readOnly: true
      statusMessage:
        title: Status message
        type: string
        readOnly: true
        minLength: 1
      summaryString:
        title: Summary string
        type: string
        readOnly: true
        minLength: 1
      runtimeFormatted:
        title: Runtime formatted
        type: string
        readOnly: true
        minLength: 1
      urls:
        title: Urls
        type: string
        readOnly: true
      url:
        title: Url
        type: string
        readOnly: true
      position:
        title: Position
        type: integer
        readOnly: true
      children:
        type: array
        items:
          type: integer
        readOnly: true
        uniqueItems: true
      params:
        title: Params
        type: string
        readOnly: true
      key:
        title: Key
        description: A unique, and very difficult to guess, key to access the job
          with.
        type: string
        maxLength: 64
        minLength: 1
      description:
        title: Description
        description: A short description of the job.
        type: string
        x-nullable: true
      created:
        title: Created
        description: The time the job was created.
        type: string
        format: date-time
        readOnly: true
      updated:
        title: Updated
        description: The time the job was last updated.
        type: string
        format: date-time
        readOnly: true
      began:
        title: Began
        description: The time the job began.
        type: string
        format: date-time
        x-nullable: true
      ended:
        title: Ended
        description: The time the job ended.
        type: string
        format: date-time
        x-nullable: true
      status:
        title: Status
        description: The current status of the job.
        type: string
        enum:
          - WAITING
          - DISPATCHED
          - PENDING
          - RECEIVED
          - STARTED
          - RUNNING
          - SUCCESS
          - FAILURE
          - CANCELLED
          - REVOKED
          - TERMINATED
          - REJECTED
          - RETRY
        x-nullable: true
      isActive:
        title: Is active
        description: Is the job active?
        type: boolean
      method:
        title: Method
        description: The job method.
        type: string
        enum:
          - parallel
          - series
          - clean
          - archive
          - zip
          - pull
          - push
          - extract
          - convert
          - pin
          - register
          - compile
          - build
          - execute
          - session
          - sleep
      result:
        title: Result
        description: The result of the job; a JSON value.
        type: object
        x-nullable: true
      error:
        title: Error
        description: Any error associated with the job; a JSON object with type, message
          etc.
        type: object
        x-nullable: true
      log:
        title: Log
        description: The job log; a JSON array of log objects, including any errors.
        type: object
        x-nullable: true
      runtime:
        title: Runtime
        description: The running time of the job.
        type: number
        x-nullable: true
      worker:
        title: Worker
        description: The identifier of the worker that ran the job.
        type: string
        maxLength: 64
        x-nullable: true
      retries:
        title: Retries
        description: The number of retries to fulfil the job.
        type: integer
        maximum: 2147483647
        minimum: -2147483648
        x-nullable: true
      callbackId:
        title: Callback id
        description: The id of the object to call back.
        type: string
        maxLength: 256
        x-nullable: true
      callbackMethod:
        title: Callback method
        description: The name of the method to call back.
        type: string
        maxLength: 128
        x-nullable: true
      project:
        title: Project
        description: The project this job is associated with.
        type: integer
        x-nullable: true
      snapshot:
        title: Snapshot
        description: The snapshot that this job is associated with. Usually `session`
          jobs for the snapshot.
        type: string
        x-nullable: true
      creator:
        title: Creator
        description: The user who created the job.
        type: integer
        x-nullable: true
      queue:
        title: Queue
        description: The queue that this job was routed to
        type: integer
        x-nullable: true
      parent:
        title: Parent
        description: The parent job
        type: integer
        x-nullable: true
      callbackType:
        title: Callback type
        description: The type of the object to call back.
        type: integer
        x-nullable: true
      users:
        description: Users who have created or connected to the job; not necessarily
          currently connected.
        type: array
        items:
          description: Users who have created or connected to the job; not necessarily
            currently connected.
          type: integer
        uniqueItems: true
      anonUsers:
        description: Anonymous users who have created or connected to the job.
        type: array
        items:
          description: Anonymous users who have created or connected to the job.
          type: string
        uniqueItems: true
  ReviewRetrieve:
    required:
      - project
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      created:
        title: Created
        description: The time the review was created.
        type: string
        format: date-time
        readOnly: true
      updated:
        title: Updated
        description: The time the review was last updated.
        type: string
        format: date-time
        readOnly: true
      status:
        title: Status
        description: The status of the review.
        type: string
        enum:
          - PENDING
          - REQUESTED
          - CANCELLED
          - ACCEPTED
          - DECLINED
          - COMPLETED
          - EXTRACTING
          - EXTRACTED
          - FAILED
          - REGISTERED
      reviewAuthorName:
        title: Review author name
        description: The name of the reviewer.
        type: string
        maxLength: 128
        x-nullable: true
      reviewDate:
        title: Review date
        description: The date of the review e.g it's `datePublished`.
        type: string
        format: date-time
        x-nullable: true
      reviewTitle:
        title: Review title
        description: The title of the review.
        type: string
        x-nullable: true
      reviewDescription:
        title: Review description
        description: The description of the review.
        type: string
        x-nullable: true
      reviewComments:
        title: Review comments
        description: The number of comments that the review has.
        type: integer
        maximum: 2147483647
        minimum: -2147483648
        x-nullable: true
      project:
        title: Project
        description: The project that the review is for.
        type: integer
      creator:
        title: Creator
        description: The user who created the review.
        type: integer
        x-nullable: true
      reviewer:
        title: Reviewer
        description: The user who authored the review.
        type: integer
        x-nullable: true
      source:
        title: Source
        description: The source for this review.
        type: integer
        x-nullable: true
      job:
        title: Job
        description: The job that extracted the review from the source.
        type: integer
        x-nullable: true
      subject:
        title: Subject
        description: The node, usually a `CreativeWork`, that is the subject of the
          review.
        type: integer
        x-nullable: true
      review:
        title: Review
        description: The node, of type `Review`, representing the actual review.
        type: integer
        x-nullable: true
  ReviewCreate:
    required:
      - source
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      source:
        title: Source
        type: integer
      reviewer:
        title: Reviewer
        type: string
      created:
        title: Created
        description: The time the review was created.
        type: string
        format: date-time
        readOnly: true
      updated:
        title: Updated
        description: The time the review was last updated.
        type: string
        format: date-time
        readOnly: true
      reviewerEmail:
        title: Reviewer email
        description: The email address of the reviewer.
        type: string
        format: email
        maxLength: 254
        x-nullable: true
      key:
        title: Key
        description: A unique, and very difficult to guess, key for the reviewer to
          access the review if they are not a user.
        type: string
        maxLength: 64
        minLength: 1
      requestMessage:
        title: Request message
        description: The message sent to the reviewer in the request to review.
        type: string
        x-nullable: true
      responseMessage:
        title: Response message
        description: The message provided by the reviewer when accepting or declining
          to review.
        type: string
        x-nullable: true
      cancelMessage:
        title: Cancel message
        description: The message sent to the reviewer when the review was cancelled.
        type: string
        x-nullable: true
      reviewAuthorName:
        title: Review author name
        description: The name of the reviewer.
        type: string
        maxLength: 128
        x-nullable: true
      reviewDate:
        title: Review date
        description: The date of the review e.g it's `datePublished`.
        type: string
        format: date-time
        x-nullable: true
      reviewTitle:
        title: Review title
        description: The title of the review.
        type: string
        x-nullable: true
      reviewDescription:
        title: Review description
        description: The description of the review.
        type: string
        x-nullable: true
      reviewComments:
        title: Review comments
        description: The number of comments that the review has.
        type: integer
        maximum: 2147483647
        minimum: -2147483648
        x-nullable: true
      creator:
        title: Creator
        description: The user who created the review.
        type: integer
        x-nullable: true
      job:
        title: Job
        description: The job that extracted the review from the source.
        type: integer
        x-nullable: true
      subject:
        title: Subject
        description: The node, usually a `CreativeWork`, that is the subject of the
          review.
        type: integer
        x-nullable: true
      review:
        title: Review
        description: The node, of type `Review`, representing the actual review.
        type: integer
        x-nullable: true
  ReviewUpdate:
    type: object
    properties:
      status:
        title: Status
        type: string
        enum:
          - PENDING
          - REQUESTED
          - CANCELLED
          - ACCEPTED
          - DECLINED
          - COMPLETED
          - EXTRACTING
          - EXTRACTED
          - FAILED
          - REGISTERED
      filterA:
        title: Filter a
        type: string
        minLength: 1
      reviewer:
        title: Reviewer
        type: string
      responseMessage:
        title: Response message
        description: The message provided by the reviewer when accepting or declining
          to review.
        type: string
        x-nullable: true
      cancelMessage:
        title: Cancel message
        description: The message sent to the reviewer when the review was cancelled.
        type: string
        x-nullable: true
  Snapshot:
    type: object
    properties:
      id:
        title: Id
        description: The unique id of the snapshot.
        type: string
        readOnly: true
        minLength: 1
      number:
        title: Number
        description: The number of the snapshot within the project.
        type: integer
        readOnly: true
      created:
        title: Created
        description: The time the snapshot was created.
        type: string
        format: date-time
        readOnly: true
      path:
        title: Path
        description: The path of the snapshot's directory within the snapshot storage
          volume.
        type: string
        maxLength: 1024
        minLength: 1
        x-nullable: true
      zipName:
        title: Zip name
        description: The name of snapshot's Zip file (within the snapshot directory).
        type: string
        maxLength: 1024
        minLength: 1
        x-nullable: true
      containerImage:
        title: Container image
        description: The container image to use as the execution environment for this
          snapshot.
        type: string
        readOnly: true
        minLength: 1
      creator:
        title: Creator
        description: The user who created the snapshot.
        type: integer
        readOnly: true
      job:
        title: Job
        description: The job that created the snapshot
        type: integer
        readOnly: true
  Source:
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      type:
        title: Type
        type: string
        readOnly: true
      address:
        title: Address
        description: The address of the source. e.g. github://org/repo/subpath
        type: string
        readOnly: true
        minLength: 1
      path:
        title: Path
        description: The file or folder name, or path, that the source is mapped to.
        type: string
        x-nullable: true
      order:
        title: Order
        description: The order that the source should be pulled into the project (allows
          explicit overwriting of one source by another).
        type: integer
        maximum: 2147483647
        minimum: 0
        x-nullable: true
      created:
        title: Created
        description: The time the source was created.
        type: string
        format: date-time
        readOnly: true
      updated:
        title: Updated
        description: The time the source was last changed.
        type: string
        format: date-time
        readOnly: true
  SourcePolymorphic:
    type: object
    properties:
      type:
        type: string
        enum:
          - ElifeSource
          - GithubSource
          - GoogleDocsSource
          - GoogleSheetsSource
          - GoogleDriveSource
          - PlosSource
          - UploadSource
          - UrlSource
      path:
        type: string
    additionalProperties:
      type: string
    required:
      - type
      - path
  GithubRepo:
    required:
      - fullName
      - imageUrl
      - permissions
      - updated
    type: object
    properties:
      refreshed:
        title: Refreshed
        description: The date-time that this information was last refreshed from GitHub.
        type: string
        format: date-time
        readOnly: true
      fullName:
        title: Full name
        description: The full name of the repository ie. owner/name
        type: string
        maxLength: 512
        minLength: 1
      imageUrl:
        title: Image url
        description: The URL for an image associated with the repository.
        type: string
        format: uri
        maxLength: 200
        minLength: 1
      permissions:
        title: Permissions
        description: A JSON object with permissions that the user has for the repo.
        type: object
      updated:
        title: Updated
        description: The date-time that the repository was last updated.
        type: string
        format: date-time
  StatusResponse:
    required:
      - time
      - version
    type: object
    properties:
      time:
        title: Time
        description: The current time in ISO format
        type: string
        minLength: 1
      version:
        title: Version
        description: The current version
        type: string
        minLength: 1
  Token:
    required:
      - user
      - id
    type: object
    properties:
      user:
        title: User
        type: integer
      id:
        title: Id
        description: First eight characters of the token.
        type: string
        minLength: 1
      created:
        title: Created
        type: string
        format: date-time
        readOnly: true
      expiry:
        title: Expiry
        type: string
        format: date-time
        x-nullable: true
  TokensCreateRequest:
    type: object
    properties:
      username:
        title: Username
        description: User's username
        type: string
        minLength: 1
      password:
        title: Password
        description: User's password
        type: string
        minLength: 1
      openid:
        title: Openid
        description: An OpenID Connect JSON Web Token.
        type: string
        minLength: 1
  TokensCreateResponse:
    required:
      - user
      - id
      - token
      - username
      - firstName
      - lastName
    type: object
    properties:
      user:
        title: User
        description: The id of the user that was authenticated.
        type: integer
      id:
        title: Id
        description: First eight characters of the token.
        type: string
        minLength: 1
      created:
        title: Created
        type: string
        format: date-time
        readOnly: true
      expiry:
        title: Expiry
        type: string
        format: date-time
        x-nullable: true
      token:
        title: Token
        description: Authentication token string.
        type: string
        minLength: 1
      username:
        title: Username
        description: The username of the user that was authenticated.
        type: string
        minLength: 1
      firstName:
        title: First name
        description: The first name of the user that was authenticated.
        type: string
        minLength: 1
      lastName:
        title: Last name
        description: The last name of the user that was authenticated.
        type: string
        minLength: 1
  MeEmailAddress:
    required:
      - email
    type: object
    properties:
      email:
        title: E-mail address
        type: string
        format: email
        maxLength: 254
        minLength: 1
      primary:
        title: Primary
        type: boolean
      verified:
        title: Verified
        type: boolean
  MeLinkedAccount:
    required:
      - provider
      - uid
    type: object
    properties:
      provider:
        title: Provider
        type: string
        enum:
          - github
          - google
          - gas
          - orcid
          - twitter
      email:
        title: Email
        type: string
        readOnly: true
      uid:
        title: Uid
        type: string
        maxLength: 191
        minLength: 1
      dateJoined:
        title: Date joined
        type: string
        format: date-time
        readOnly: true
      lastLogin:
        title: Last login
        type: string
        format: date-time
        readOnly: true
  PersonalAccount:
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      tier:
        title: Tier
        description: The tier of the account. Determines its quota limits.
        type: integer
  Me:
    required:
      - username
      - personalAccount
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      username:
        title: Username
        description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_
          only.
        type: string
        pattern: ^[\w.@+-]+$
        maxLength: 150
        minLength: 1
      firstName:
        title: First name
        type: string
        maxLength: 150
      lastName:
        title: Last name
        type: string
        maxLength: 150
      displayName:
        title: Display name
        type: string
        readOnly: true
      location:
        title: Location
        type: string
        readOnly: true
      image:
        $ref: '#/definitions/AccountImage'
      website:
        title: Website
        type: string
        readOnly: true
      publicEmail:
        title: Public email
        type: string
        readOnly: true
      dateJoined:
        title: Date joined
        type: string
        format: date-time
      lastLogin:
        title: Last login
        type: string
        format: date-time
        x-nullable: true
      emailAddresses:
        type: array
        items:
          $ref: '#/definitions/MeEmailAddress'
        readOnly: true
      linkedAccounts:
        type: array
        items:
          $ref: '#/definitions/MeLinkedAccount'
        readOnly: true
      personalAccount:
        $ref: '#/definitions/PersonalAccount'
      orgsSummary:
        title: Orgs summary
        type: string
        readOnly: true
      projectsSummary:
        title: Projects summary
        type: string
        readOnly: true
      featureFlags:
        title: Feature flags
        type: string
        readOnly: true
