PlayCanvas Branches API

Version-control branches.

OpenAPI Specification

playcanvas-branches-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: PlayCanvas REST Apps Branches API
  version: 1.0.0-beta
  description: The PlayCanvas REST API lets you automate the PlayCanvas platform — manage project assets, branches and checkpoints (version control), list scenes, export projects, download self-hostable apps, poll asynchronous jobs, and publish Gaussian splats to the SuperSplat platform. The API is currently in beta; endpoints and responses may change. All access is over HTTPS using a Bearer access token generated on your Organization's Account page.
  termsOfService: https://playcanvas.com/terms
  contact:
    name: PlayCanvas Support
    url: https://developer.playcanvas.com/user-manual/api/
  license:
    name: MIT (engine)
    url: https://github.com/playcanvas/engine/blob/main/LICENSE
servers:
- url: https://playcanvas.com/api
  description: PlayCanvas REST API (beta)
security:
- bearerAuth: []
tags:
- name: Branches
  description: Version-control branches.
paths:
  /branches:
    post:
      tags:
      - Branches
      operationId: createBranch
      summary: Create branch
      description: Create a new branch from an existing branch and optionally a specific checkpoint.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              - projectId
              - sourceBranchId
              properties:
                name:
                  type: string
                  maxLength: 1000
                  description: The name of the new branch.
                projectId:
                  type: integer
                  description: The id of the project.
                sourceBranchId:
                  type: string
                  description: The branch to create the new branch from.
                sourceCheckpointId:
                  type: string
                  description: Checkpoint to branch from; defaults to latest of source branch.
      responses:
        '201':
          description: Branch created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Branch'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
  /projects/{projectId}/branches:
    get:
      tags:
      - Branches
      operationId: listBranches
      summary: List branches
      description: 'List all open branches for a project. Cursor pagination: when pagination.hasMore is true, pass ?skip={lastBranchId} for the next page.'
      parameters:
      - $ref: '#/components/parameters/ProjectId'
      responses:
        '200':
          description: List of open branches.
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      $ref: '#/components/schemas/Branch'
                  pagination:
                    $ref: '#/components/schemas/CursorPagination'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: integer
        fullName:
          type: string
        username:
          type: string
    Error:
      type: object
      properties:
        error:
          type: string
          description: The error message.
      required:
      - error
    CursorPagination:
      type: object
      properties:
        hasMore:
          type: boolean
    Branch:
      type: object
      properties:
        id:
          type: string
        projectId:
          type: integer
        name:
          type: string
        createdAt:
          type: string
          format: date-time
        closed:
          type: boolean
        permanent:
          type: boolean
        latestCheckpointId:
          type: string
        user:
          $ref: '#/components/schemas/User'
  responses:
    Forbidden:
      description: Forbidden.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Rate limit exceeded.
      headers:
        X-RateLimit-Limit:
          schema:
            type: integer
          description: Requests allowed per minute.
        X-RateLimit-Remaining:
          schema:
            type: integer
          description: Remaining requests this minute.
        X-RateLimit-Reset:
          schema:
            type: integer
          description: UTC epoch seconds when the window resets.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    ProjectId:
      name: projectId
      in: path
      required: true
      description: The id of the project.
      schema:
        type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Access token generated on the Organization Account page, sent as `Authorization: Bearer {accessToken}`.'